Mujoco-py: mujoco_py.cymj.GlfwError: Failed to create GLFW window

Created on 19 Nov 2020  路  3Comments  路  Source: openai/mujoco-py

Hi,
I get the error

Traceback (most recent call last): File "/home/ashith/Ash/repo/spaceRobot_RL/MBRL/spacerobot/spacerobot_mbrl.py", line 402, in <module> mbrl.run_mbrl(train=train, iter=500) File "/home/ashith/Ash/repo/spaceRobot_RL/MBRL/spacerobot/spacerobot_mbrl.py", line 83, in run_mbrl iter=iter, retrain_after_iter=30, render=True) File "/home/ashith/Ash/repo/spaceRobot_RL/MBRL/spacerobot/mppi_polo.py", line 383, in run_mppi env.render() File "/home/ashith/Ash/venv_tf_gpu/lib/python3.6/site-packages/gym/envs/mujoco/mujoco_env.py", line 158, in render self._get_viewer(mode).render() File "/home/ashith/Ash/venv_tf_gpu/lib/python3.6/site-packages/gym/envs/mujoco/mujoco_env.py", line 170, in _get_viewer self.viewer = mujoco_py.MjViewer(self.sim) File "/home/ashith/Ash/venv_tf_gpu/lib/python3.6/site-packages/mujoco_py/mjviewer.py", line 137, in __init__ super().__init__(sim) File "/home/ashith/Ash/venv_tf_gpu/lib/python3.6/site-packages/mujoco_py/mjviewer.py", line 28, in __init__ super().__init__(sim) File "mujoco_py/mjrendercontext.pyx", line 311, in mujoco_py.cymj.MjRenderContextWindow.__init__ File "mujoco_py/mjrendercontext.pyx", line 46, in mujoco_py.cymj.MjRenderContext.__init__ File "mujoco_py/mjrendercontext.pyx", line 102, in mujoco_py.cymj.MjRenderContext._setup_opengl_context File "mujoco_py/opengl_context.pyx", line 48, in mujoco_py.cymj.GlfwContext.__init__ File "mujoco_py/opengl_context.pyx", line 99, in mujoco_py.cymj.GlfwContext._create_window mujoco_py.cymj.GlfwError: Failed to create GLFW window GLFW error (code %d): %s 65543 b'GLX: Failed to create context: BadValue (integer parameter out of range for operation)'
I am on Ubuntu 18.04. Followed all the steps as in the README.md. Interestingly it works in my laptop but when I do the exact same steps in lab system, i get the error.
One thing I noticed is that my laptop has no Nvidia card whereas my lab system has. I have already added the following in my bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ashith/.mujoco/mujoco200/bin export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so

Any help would be really appreciated

Most helpful comment

@MianchuWang @ashBabu I have the same issue, have you found a workaround for it?

Hi, fortunately I solved the problem at last. The problem was raising when I was using a headless Linux server. The problem is that glfw is unavailable without a screen. However, we can use a virtual screen xvfb, like xvfb-run python foo.py. You can read http://elementalselenium.com/tips/38-headless for more details.

I don't know whether my situation is similar to yours, but I hope you can solve it soon. : )

All 3 comments

The same issue :(

@MianchuWang @ashBabu I have the same issue, have you found a workaround for it?

@MianchuWang @ashBabu I have the same issue, have you found a workaround for it?

Hi, fortunately I solved the problem at last. The problem was raising when I was using a headless Linux server. The problem is that glfw is unavailable without a screen. However, we can use a virtual screen xvfb, like xvfb-run python foo.py. You can read http://elementalselenium.com/tips/38-headless for more details.

I don't know whether my situation is similar to yours, but I hope you can solve it soon. : )

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abhigenie92 picture abhigenie92  路  5Comments

dialogchat picture dialogchat  路  3Comments

samuela picture samuela  路  3Comments

jjkke88 picture jjkke88  路  6Comments

bebbo203 picture bebbo203  路  3Comments