Respect explicit MUJOCO_GL in backend selection#805
Open
sandeepKBM wants to merge 1 commit intoARISE-Initiative:masterfrom
Open
Respect explicit MUJOCO_GL in backend selection#805sandeepKBM wants to merge 1 commit intoARISE-Initiative:masterfrom
sandeepKBM wants to merge 1 commit intoARISE-Initiative:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Preserves an explicitly configured MUJOCO_GL value during robosuite import-time backend setup instead of overwriting it in binding_utils when GPU rendering is enabled. This makes backend selection predictable for downstream users who intentionally set values such as glfw. The change also factors backend resolution into a small helper, preserves the current default behavior when MUJOCO_GL is unset, and updates the installation guidance to document the supported configuration flow instead of recommending direct library edits.
How it was tested
Verified that MUJOCO_GL=glfw is preserved during import and is no longer overwritten.
Confirmed that the existing Linux default path still resolves to egl when MUJOCO_GL is unset.
Checked that state-only environments continue to work as before.
Validated that CPU headless offscreen rendering still requires the expected runtime setup of xvfb-run together with MUJOCO_GL=glfw.
Added focused tests covering both the backend-resolution helper and the binding_utils import path.
How to checkout & try? (for the reviewer)
Reviewers can verify the change by inspecting the updated backend-selection logic in binding_utils, reviewing the new helper and tests, and trying robosuite imports with and without MUJOCO_GL set. In particular, setting MUJOCO_GL=glfw before import should now be preserved, while leaving it unset should continue to follow the existing default Linux behavior.