Breakend/gym-extensions

'The GLFW library is not initialized' error

ViktorM opened this issue · 12 comments

When I tried to run Walker2dWall-v0 or HumanoidWall-v0 I always got this error:
[2017-10-23 16:30:32,093] GLFW error: 65537, desc: b'The GLFW library is not initialized'
While for example Walker2dWithSensor-v0 is running and visualizing ok. Are there any ideas this error can be fixed?

hmm, i believe i've gotten that error when i've run it on a server with out of date drivers. What's the specs on the machine you're running? Ubuntu 16.04? GPU or No GPU?

which version of mujoco are you using also?

Laptop with Ubuntu 16.04, GPU GTX1070, Mujoco 1.31

hmm i just tested it out on my similar setup and couldn't repro, but let's try to dig in a bit. Are you just trying to run the manual control example? If not can you share how it is you're testing?

https://github.com/Breakend/gym-extensions/blob/master/examples/manual_control_example.py

python examples/manual_control_example.py Walker2dWall-v0

I can try it. But I tried to train agent with my RL algorithms. With usual Walker2d and Humanoid env I had no problems.

Hmm, can you also post your version of openai gym and mujoco_py?

I want to try to recreate the setup and see what's happening

pip install mujoco-py==0.5.7 it works with Mujoco 1.31

manual_control_example.py isn't working for me, it requires roboschool which I don't have installed.

Now my mujoco installation seems is totally broken - the same errors I get running usual Gym environments.

Sorry, missed question about Gym - it's the latest version

did you ever figure this out? if you comment out the roboschool part it should still work

Looks like glfw doesn't like when there are different copies of it - installed and shipped with Mujoco. I've just uninstalled it with "pip uninstall glfw" and Mujoco visualization and training started working again. I can run your environments now, thanks!

Uninstalling glfw may be not an ideal solution -- the above workaround might work when legacy mujoco_py/gym are used but some certain packages do require glfw (e.g., dm_control).

It happens because there are many different copies of libgl.so libglfw.so libraries, so one could use PRELOAD to specify which GL library to load.

  • .../site-packages/glfw/x11/libglfw.so
  • ~/.mujoco/mujoco210/bin/libglfw.so.3
  • /usr/lib/x86_64-linux-gnu/libGLEW.so

Or one could use MUJOCO_GL=EGL instead of GLFW if applicable.