-
Notifications
You must be signed in to change notification settings - Fork 815
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
render mode="human" works, but mode="rgb_array" gives GLEW initialization error #390
Comments
As someone described in a thread for gym. If you render once as 'human' it works afterwards. After trying that, I figured a workaround:
That solves the issue for me. |
Using mujoco_py==1.50.1.1, I had the same problem, but in this version, GlfwContext was not being exported. Simply exporting it and following the workaround proposed by @jendelel solved the issue. |
I am having the exact same problem, but I am using a windows machine. |
In mujoco_env.py change -1 to be 0 works for me |
Describe the bug
When I run
env.render(mode="human")
everything works as it should. However, if instead I runenv.render(mode="rgb_array")
I get the error "ERROR: GLEW initalization error: Missing GL version". I am aware of the issue here, and I have added export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so (actually before doing this, I don't think mode="human" worked either), however it doesn't help fix this. It seems that someone else was having this issue, but it doesn't seem to have been reposted here as suggested.Strangely, if I first call
env.render(mode="human")
I am able to callenv.render(mode="rgb_array")
afterwards without getting this error. So, for example, the following code works:`from gym.envs.mujoco.half_cheetah_v3 import HalfCheetahEnv
import numpy as np
env = HalfCheetahEnv()
test = env.reset()
env.render(mode="human")
for i in range(10000):
a,b,c,d = env.step(np.random.randn(6).clip(-1,1))
img=env.render(mode="rgb_array")`
But if I miss out the initial
env.render(mode="human")
I get the error.Desktop (please complete the following information):
Environment
echo $LD_LIBRARY_PATH
- /home/henry/.mujoco/mujoco200/binecho $HOME
/home/henryecho $USER
- henryThe text was updated successfully, but these errors were encountered: