Mrview error on ubuntu

Dear MRTrix community,
I installed MRtrix on Ubuntu 22.04.
Whenever I try to run mrview , the status bar of mrview is not displayed.
The system will prompt me to make an error, the error is as follows.
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
QOpenGLWidget: Failed to create context
qt.qpa.backingstore: composeAndFlush: QOpenGLContext creation failed
qt.qpa.backingstore: composeAndFlush: makeCurrent() failed
qt.qpa.backingstore: composeAndFlush: makeCurrent() failed
Any responses will be greatly appreciated!!


Thanks,
Zhao

Hi @zhao,

The relevant error messages are:

which basically means that it can’t find a usable OpenGL driver for your system. The mesa project handles all the GPU rendering infrastructure on most Linux systems, and provides open drivers for most 3D hardware out there. This is a fundamental part of your system which mrview relies on to do the rendering – along with any other 3D-accelerated rendering application. Unfortunately, there are many reasons why this might not be set up correctly, and there’s not a lot we can do from our side: your system isn’t set up quite right, and it’s going to be tricky to figure out why.

That said, a quick search shows other examples of the same issue you’re facing. This one traces it back to some tweak that Ubuntu have made. This one reckons it has to do with anaconda using a version of the C++ library that is incompatible with the mesa drivers (are you running the anaconda version of MRtrix…?). There may be other reasons I’ve not come across, but hopefully one of these will point you in the right direction.

All the best,
Donald.

I experienced the same issue on a freshly installed Ubuntu 22.04 machine, conda 24.3.0.

This solution worked for me:

  • Locate libstdc++.so.6 (in my case /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
  • run the command ‘export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6’

At this point the variable would not be permanent. So, additional steps would be needed to make it permanent. A quick Google search will help with that.

Hope this helps,
Simone

2 Likes

Ran into this recently. Additionally to @szan’s solution, this also works:

conda install -c conda-forge libstdcxx-ng

See the following for more details.

Hello,
I am also facing the same issue, thanks for asking.