Add support for MUJOCO_GL=osmesa
on Windows and macOS
#2164
Labels
enhancement
New feature or request
MUJOCO_GL=osmesa
on Windows and macOS
#2164
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 ifosmesa
-symbols are present in the global process symbol table or check libraries already loaded in the process withdl_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 loadOSMesa
only ifMUJOCO_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
oryum
package manager, orconda
).Alternatives
Do not support
MUJOCO_GL=osmesa
on Windows and macOSAdditional context
.
The text was updated successfully, but these errors were encountered: