mujoco gets rgb_array error report Failed to initialize OpenGL
Foreword:
Time is urgent, post the source post directly;
Reference link:
Failed to load OpenGL: Found 0 GPUs for rendering. Using device 0.
Desktop (please complete the following information):
OS: ubuntu 20.04
Python Version 3.8.10
Mujoco Version 2.1
mujoco-py version 2.0.2.13
Environment
output of: echo $LD_LIBRARY_PATH -> /home/disc/h.bonnavaud/.mujoco/mujoco210/bin:/usr/lib/nvidia
output of: echo $HOME -> /home/disc/h.bonnavaud
output of: echo $USER -> h.bonnavaud
output of: echo $LD_PRELOAD -> /usr/lib/x86_64-linux-gnu/libGLEW.so
output of: glxinfo | grep “OpenGL version” -> OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.0.3
Additional context
I found many hints about this problem but nothing about an error like “Found 0 GPUs for rendering. Using device 0.”. Reading this line, the problem looks obvious since indice 0 of an empty list is out of range, but I have no idea how to solve it. Do not hesitate to redirect me if I’m at the wrong place, or if you know any helpful other issues reports. Thanks a lot.
Just looking at his error message, it is very pleasing to the eye, and all the information is posted directly, which is very clear.
solution:
Comment out:
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so
I am confused, if it is env.render(), without the above one, it will directly report an error:
Creating window glfw
ERROR: GLEW initalization error: Missing GL version
If you only get the image, you must also comment.
Garbage mujoco...