Skip to content

Respect explicit MUJOCO_GL in backend selection#805

Open
sandeepKBM wants to merge 1 commit intoARISE-Initiative:masterfrom
sandeepKBM:fix/render-backend-precedence
Open

Respect explicit MUJOCO_GL in backend selection#805
sandeepKBM wants to merge 1 commit intoARISE-Initiative:masterfrom
sandeepKBM:fix/render-backend-precedence

Conversation

@sandeepKBM
Copy link

@sandeepKBM sandeepKBM commented Mar 19, 2026

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.

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

Labels

None yet

1 participant