Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MUJOCO_GL=osmesa on Windows and macOS #2164

Open
traversaro opened this issue Oct 22, 2024 · 1 comment
Open

Add support for MUJOCO_GL=osmesa on Windows and macOS #2164

traversaro opened this issue Oct 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@traversaro
Copy link
Contributor

The feature, motivation and pitch

I am working on packaging and running the testsuite of gymnasium 1.0.0 on conda-forge (in conda-forge/gymnasium-feedstock#41). The tests are supposed to run on headless CI machines. While all the mujoco tests related to rendering work fine on Linux by setting MUJOCO_GL=osmesa, the rendering test fail on Windows and macOS.

I looked into supporting MUJOCO_GL=osmesa also on Windows and macOS, and the part of the code to modify seem:

The python modifications are trivial, while the one on the glad's C files are a bit more complex.
In particular, on the Linux side to decide if osmesa should be used, Linux-specific strategies like checking if osmesa-symbols are present in the global process symbol table or check libraries already loaded in the process with dl_iterate_phdr. Replicating the same strategy on macOS or Windows may not be trivial given how different the loading of shared libraries works on these operating systems.

However, I wonder if it could make sense on Windows and macOS to just check for the value of the MUJOCO_GL env variable from the C code, and try to load OSMesa only if MUJOCO_GL=osmesa? Or there could be downside there? I would probably avoid to modify the Linux logic if it is working fine at the moment.

Note that this modification would not address the problem on how the user installs the osmesa library in the first place, but that is also the situation on Linux, where osmesa should be installed by some package manager that is also able to install C++ libraries (such as the system apt or yum package manager, or conda).

Alternatives

Do not support MUJOCO_GL=osmesa on Windows and macOS

Additional context

.

@traversaro traversaro added the enhancement New feature or request label Oct 22, 2024
@traversaro
Copy link
Contributor Author

xref to related issue: #959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant