mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Can't open viewer with the command"python -m mujoco.viewer" ; Error info:libGL error: MESA-LOADER...

Open cidxb opened this issue 3 years ago • 9 comments

Hi,

I'm looking for some help with the GUI of Mujoco

System Info Ubuntu 22.04 NVIDIA driver 525 Kernel 6.0.0-1010-oem #10-Ubuntu

Error message libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) libGL error: failed to load driver: iris libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) libGL error: failed to load driver: iris libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) libGL error: failed to load driver: swrast /home/jeffery/.local/lib/python3.10/site-packages/glfw/init.py:912: GLFWError: (65543) b'GLX: Failed to create context: BadValue (integer parameter out of range for operation)' warnings.warn(message, GLFWError) ERROR: could not create window

Press Enter to exit ...

Additional

I successfully opened it at the beginning. But then I have accidentally run "apt upgrade" Then occur this problem, the Graphic driver problem(nvidia-smi not showing correctly).

But I have already used the --purge command to remove all graphic driver and reinstall it. The NVIDIA display driver is functional now But this Problem with the Mujoco viewer still.

Please anyone know how to solve it?

I have read some relevant posts online regarding libGL error, however, they were not helpful. Thank you !

cidxb avatar Jan 11 '23 05:01 cidxb

The problem is solved !! It is because the apt update makes the soft links of lib break. use ll command to check the file

strings libstdc++.so.6 | grep GLIBCXX_3.4.30 (if broke can't find it )

locate libstdc++.so.6 (locate workable file )

select one (should be the /usr/lib/x86_64-linux-gnu one ) using the str command above to grep again, the fine is here!

rm the problematic file in dictionary

ln -s the dictionary of good file to the problematic dichotomy .

(create a softlink to the correct location )

Anyway, it its roughly the solution of my case

cidxb avatar Jan 13 '23 07:01 cidxb

@cidxb could you please explain this fix in simple terms? I am currently facing the same issues. I am also on ubuntu 22.04

Rakesh-Paul01 avatar Apr 15 '24 19:04 Rakesh-Paul01

@cidxb could you please explain this fix in simple terms? I am currently facing the same issues. I am also on Ubuntu 22.04

### It is basically a broken file soft link problem, which means the file you want is not here really, but an indicator of where it is, but this link broke, and then the program is unable to find it. SO WE WANT TO REBUILD THE LINK.

  1. use ll command to check the file(in this case, ll iris_dri.so) ### Check the file link
  2. use command strings libstdc++.so.6 | grep GLIBCXX_3.4.30 ### Find this missing .so library
  3. use the command locate libstdc++.so.6 ###To find where in your system has this file/libray
  4. remove the old/problematic file which has been reported as No such file or directory ; Such as the command rm usr/lib/dri/iris_dri.so:
  5. use the command ln -s to link the dictionary of the good file to the problematic dictionary. ### Create a soft link to the correct location

cidxb avatar Apr 16 '24 10:04 cidxb

@cidxb I am sorry I am extremely new to linux so this might sound a dumb question I followed your instructions up till 3, and getting this when I try the locate libstdc++.so.6 image

I don't understand step 4 and 5, how am I supposed to know which is the problematic file? (i would have tried the same file but I don't see that in the options given)

Rakesh-Paul01 avatar Apr 16 '24 17:04 Rakesh-Paul01

@cidxb I am sorry I am extremely new to linux so this might sound a dumb question I followed your instructions up till 3, and getting this when I try the locate libstdc++.so.6 image

I don't understand step 4 and 5, how am I supposed to know which is the problematic file? (i would have tried the same file but I don't see that in the options given)

What is your original error trance back? You can check it. That should state what file went wrong, you delete it, and follow the step 4 and 5 to create a new file that can work. It is very simple.

cidxb avatar Apr 17 '24 13:04 cidxb

Thanks for all the help I finally figured it out. If someone also has some other doubts they can check this stackoverflow post

Rakesh-Paul01 avatar Apr 17 '24 15:04 Rakesh-Paul01

感谢大家的帮助,我终于弄清楚了。 如果有人还有其他疑问,可以查看此stackoverflow 帖子

Solve my problem. Thx

CRLqinliang avatar May 02 '24 06:05 CRLqinliang

conda install -c conda-forge libstdcxx-ng

I tried this, fix issue. Hoe this works for you guys

kingchou007 avatar Mar 12 '25 19:03 kingchou007

@kingchou007 Your method works, thanks. Simple and straightforward~

javierpey avatar Sep 15 '25 20:09 javierpey