-
Notifications
You must be signed in to change notification settings - Fork 823
mujoco_py's MjSim doesn't render (Missing GL version) whereas gym's robotic env works fine #432
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
Comments
Have you checked your OpenGL version? It seems like the pyopengl only supports OpenGL version v1.1 to 4.4 (refer to here), although based on your Cuda version, that should not be the problem |
Thanks for your answer! Just checked, and it seems my OpenGL is too recent? Should I downgrade my OpenGL? |
Thank you for the version string. I thought the Nvidia driver version and OpenGL version are connected. That is only a guess based on what I have searched. I haven't tried that yet because I was worrying about reinstalling not only OpenGL, but also Nvidia driver and Cuda. BTW: Have you encountered with other programs which use OpenGL under current settings? |
thanks again for the time :) No i've never seen OpenGL give any problem. This is still weird that when I'm using gym (that uses mujoco) I don't have any problem (see above pic), and this only happens when using the MjSim from mujoco_py. |
@PierreAlexSW any update on this? |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug

When I try mujoco_py's MjSim and try to render the simulator, I get the classic "ERROR: GLEW initalization error: Missing GL version" error which has been raised by many people, however I failed to find a solution that worked out for me. This is even stranger considering that my gym environments using mujoco work completely fine (see following picture).
EDIT (comment on nvidia drivers)
As you can see on my .bashrc config, I don't have any path to nvidia drivers. I don't see any nvidia drivers being installed in my /usr/lib folder (however, I have a /usr/src/nvidia-390.116 folder with the different patches from the installation?). It doesn't seem to be a problem because I can still run gym's robotic envs and run all my experiment on my GPU.
Here is the easiest code to reproduce the error I get.
To Reproduce
import mujoco_py
import os
mj_path, _ = mujoco_py.utils.discover_mujoco()
print(mj_path)
xml_path = os.path.join(mj_path, 'model', 'humanoid.xml')
model = mujoco_py.load_model_from_path(xml_path)
sim = mujoco_py.MjSim(model)
print(sim.data.qpos)
sim.step()
print(sim.data.qpos)
sim.render()
Error Messages
/home/usernmame/.mujoco/mujoco200
[0. 0. 1.4 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ]
[-1.12164337e-05 7.29847036e-22 1.39975300e+00 9.99999999e-01
1.80085466e-21 4.45933954e-05 -2.70143345e-20 1.30126513e-19
-4.63561234e-05 -1.88020744e-20 -2.24492958e-06 4.79357124e-05
-6.38208396e-04 -1.61130312e-03 -1.37554006e-03 5.54173825e-05
-2.24492958e-06 4.79357124e-05 -6.38208396e-04 -1.61130312e-03
-1.37554006e-03 -5.54173825e-05 -5.73572648e-05 7.63833991e-05
-2.12765194e-05 5.73572648e-05 -7.63833991e-05 -2.12765194e-05]
ERROR: GLEW initalization error: Missing GL version
Desktop (please complete the following information):
Environment
My .bashrc file is the following:
export PATH=$PATH:/usr/local/cuda-9.0/bin
export LD_LIBRARY_PATH=/home/username/.mujoco/mujoco200/bin
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so:/usr/lib/x86_64-linux-gnu/libGL.so
export MUJOCO_LICENSE_PATH=$HOME/.mujoco/mjkey.txt
Additional context
I also tried using the 150 version of Mujoco paired with 1.50 version of mujoco_py but this lead to exactly the same problem.
Thanks for your help!! Let me know if I missed anything worth mentioning to debug this.
The text was updated successfully, but these errors were encountered: