Description
On a display-less machine (typical CI box or server), rendering fails with pyglet's NoSuchDisplayException — render.py's pyrender usage defaults to the GL platform that needs an X display, so there is no way to produce renders headless.
Reproduced on a Linux server with no X (originally hit during the Open3D-vs-pyrender evaluation for #10, where it was noted in the eval document; filing it as its own issue so it's trackable).
Suggested direction
pyrender supports headless operation via PYOPENGL_PLATFORM=egl (GPU) or PYOPENGL_PLATFORM=osmesa (pure software). Options, roughly in order of usefulness:
- Honor an existing
PYOPENGL_PLATFORM env var (set nothing when unset — zero behavior change on desktops), and document headless usage in the README.
- Or add a
--headless flag that sets osmesa before the pyrender import.
The import-order footnote matters: the env var must be set before pyrender/pyglet are first imported, so the flag/env handling has to run at entrypoint top, not inside the render call.
Happy to submit a PR — with the caveat that this box can verify the osmesa path only if the software-GL dependencies install cleanly; the PR would state exactly which paths were executed.
Filed with AI assistance (Claude); the exception was reproduced on a real headless machine.
Description
On a display-less machine (typical CI box or server), rendering fails with pyglet's
NoSuchDisplayException—render.py's pyrender usage defaults to the GL platform that needs an X display, so there is no way to produce renders headless.Reproduced on a Linux server with no X (originally hit during the Open3D-vs-pyrender evaluation for #10, where it was noted in the eval document; filing it as its own issue so it's trackable).
Suggested direction
pyrender supports headless operation via
PYOPENGL_PLATFORM=egl(GPU) orPYOPENGL_PLATFORM=osmesa(pure software). Options, roughly in order of usefulness:PYOPENGL_PLATFORMenv var (set nothing when unset — zero behavior change on desktops), and document headless usage in the README.--headlessflag that setsosmesabefore the pyrender import.The import-order footnote matters: the env var must be set before
pyrender/pygletare first imported, so the flag/env handling has to run at entrypoint top, not inside the render call.Happy to submit a PR — with the caveat that this box can verify the
osmesapath only if the software-GL dependencies install cleanly; the PR would state exactly which paths were executed.Filed with AI assistance (Claude); the exception was reproduced on a real headless machine.