Skip to content

Resolve OpenGL backend lazily - #3407

Open
devshahofficial wants to merge 1 commit into
google-deepmind:mainfrom
devshahofficial:agent/pr3366-lazy-gl-backend
Open

Resolve OpenGL backend lazily#3407
devshahofficial wants to merge 1 commit into
google-deepmind:mainfrom
devshahofficial:agent/pr3366-lazy-gl-backend

Conversation

@devshahofficial

Copy link
Copy Markdown
Contributor

Draft follow-up for #3366, based on the original lazy-backend import fix from @kevinzakka.

This keeps MUJOCO_GL validation at import time but defers importing the selected backend until a GLContext is constructed. That lets import mujoco work on systems that never render and do not have OpenGL libraries available.

Local validation:

  • python3 -m py_compile python/mujoco/rendering/classic/gl_context.py python/mujoco/gl_context_test.py
  • direct importlib/mocked validation for backend delegation, native AttributeError conversion, and backend ImportError conversion
  • git diff --check

Could not run python/mujoco/gl_context_test.py directly in this local Python because absl-py is not installed in the base environment.

Opening as draft to avoid duplicating the existing approved PR unless maintainers want this rebased version.

@devshahofficial
devshahofficial force-pushed the agent/pr3366-lazy-gl-backend branch from 35bec1f to 5867b2f Compare July 19, 2026 14:05
@devshahofficial
devshahofficial marked this pull request as ready for review July 20, 2026 15:34
@devshahofficial

Copy link
Copy Markdown
Contributor Author

Quick CI read: the lone macOS ARM failure is in CMake/GoogleTest discovery for the unrelated engine_inverse_test (empty JSON while linking); the OpenGL diff is not on that path, and the rest of the matrix is green. I tried rerunning the failed job, but fork authors do not have permission on the upstream workflow. Could a maintainer kick that job once? If it reproduces, I’ll dig into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant