Score:7

libGL error: failed to load drivers iris and swrast in Ubuntu 20.04

us flag

I have a few problems (refer to messages below) with launching third party scientific softwares (e.g. coot, pymol or chimera).

I use the coot binary (0.9.5). Chimera is 1.14 build 42018. Ubuntu 20.04.2 LTS Gnome. I use the pymol-open-source from Github

Graphic card: VGA compatible controller: Intel Corporation UHD Graphics 620 (Whiskey Lake)
Model: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz

It seems that there are some problems with iris and swrast (please refer the message below).

I always get this message for chimera:

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)
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)
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)
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  890
  Current serial number in output stream:  891

I got this message for pymol:

Qt not available, using GLUT/Tk interface
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)
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)
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)
libGL error: failed to load driver: swrast
freeglut Unable to create OpenGL 1.0 context (flags 0, profile 0)
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  50
  Current serial number in output stream:  51
 PyMOL: abrupt program termination.

Thanks for the help.


lsmod | grep 
drm rm_kms_helper 184320 1 i915 
syscopyarea 16384 1 drm_kms_helper
sysfillrect 16384 1 drm_kms_helper 
sysimgblt 16384 1 drm_kms_helper 
fb_sys_fops 16384 1 drm_kms_helper 
drm 491520 9 drm_kms_helper,i915
$ glxinfo | grep Vendor
Vendor: Intel Open Source Technology Center (0x8086)
$ lshw -C video 
WARNING: you should run this program as super-user. 
*-display 
description: VGA compatible controller 
product: UHD Graphics 620 (Whiskey Lake) 
vendor: Intel Corporation 
physical id: 2 
bus info: pci@0000:00:02.0 
version: 00 
width: 64 bits 
clock: 33MHz 
capabilities: vga_controller bus_master cap_list rom 
configuration: driver=i915 latency=0 
resources: irq:150 memory:9b000000-9bffffff memory:50000000-5fffffff ioport:3000(size=64) 
memory:c0000-dffff
$ vainfo 
libva info: VA-API version 1.7.0 
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so 
libva info: Found init function __vaDriverInit_1_7 
libva info: va_openDriver() returns 0 
vainfo: VA-API version: 1.7 (libva 2.6.0) 
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 () 
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD 
VAProfileMPEG2Main : VAEntrypointVLD 
VAProfileH264Main : VAEntrypointVLD 
VAProfileH264Main : VAEntrypointEncSliceLP 
VAProfileH264High : VAEntrypointVLD 
VAProfileH264High : VAEntrypointEncSliceLP 
VAProfileJPEGBaseline : VAEntrypointVLD 
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3 : VAEntrypointVLD 
VAProfileHEVCMain : VAEntrypointVLD 
VAProfileHEVCMain10 : VAEntrypointVLD 
VAProfileVP9Profile0 : VAEntrypointVLD 
VAProfileVP9Profile2 : VAEntrypointVLD
N0rbert avatar
zw flag
How did you installed coot and chimera? Which versions do you use? What is your current desktop environment?
Tam Heng Keat avatar
us flag
I use the coot binary (0.9.5). Chimera is 1.14 build 42018. Ubuntu 20.04.2 LTS Gnome.
N0rbert avatar
zw flag
Please install `vainfo` and `lshw` utilitis by `sudo apt-get install vainfo lshw`, then run it with `vainfo` and add output to the question. Also add output of `lsmod | grep drm` , `glxinfo | grep Vendor`, `lshw -C video` to the question. Please share the links to program distributions too.
Tam Heng Keat avatar
us flag
lsmod | grep drm rm_kms_helper 184320 1 i915 syscopyarea 16384 1 drm_kms_helper sysfillrect 16384 1 drm_kms_helper sysimgblt 16384 1 drm_kms_helper fb_sys_fops 16384 1 drm_kms_helper drm 491520 9 drm_kms_helper,i915
Tam Heng Keat avatar
us flag
glxinfo | grep Vendor Vendor: Intel Open Source Technology Center (0x8086)
Tam Heng Keat avatar
us flag
lshw -C video WARNING: you should run this program as super-user. *-display description: VGA compatible controller product: UHD Graphics 620 (Whiskey Lake) vendor: Intel Corporation physical id: 2 bus info: pci@0000:00:02.0 version: 00 width: 64 bits clock: 33MHz capabilities: vga_controller bus_master cap_list rom configuration: driver=i915 latency=0 resources: irq:150 memory:9b000000-9bffffff memory:50000000-5fffffff ioport:3000(size=64) memory:c0000-dffff
Tam Heng Keat avatar
us flag
vainfo libva info: VA-API version 1.7.0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_7 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.7 (libva 2.6.0) vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 () vainfo: Supported profile and entrypoints
Tam Heng Keat avatar
us flag
vainfo VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSliceLP VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSliceLP VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture
Tam Heng Keat avatar
us flag
vainfo VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain10 : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointVLD VAProfileVP9Profile2 : VAEntrypointVLD
N0rbert avatar
zw flag
Please move all last comments to question body!
Tam Heng Keat avatar
us flag
What did you mean by 'move all last comments to question body'?
N0rbert avatar
zw flag
Done this for you. I do not see any problems with graphical drivers. Maybe you have outdated local libraries inside application folders.
Score:3
cn flag

I just had same issue with Kiwix on Linux Mint and found your question. I was able to solve my issue reading: https://github.com/kiwix/kiwix-desktop/issues/393. The issue I understood is that iris driver is configured on Ubuntu to be used by default on laptops whereas in my case on my old laptop graphic card supports older driver. So the solution/workaround is to set environmental variable before running the app in command prompt, like this:

MESA_LOADER_DRIVER_OVERRIDE=i965 ./kiwix-deskop

Hope that helps you too.

P.S. in case you want to try to set this variable permanently and nothing else breaks, see: How to permanently set an environment variable

anonymous2 avatar
ng flag
Had the same problem running FreeCAD 0.19 on Ubuntu 21.10; this fixed the problem thanks!
Paul Uszak avatar
jp flag
Me too with Python and matplotlib. `export MESA_LOADER_DRIVER_OVERRIDE=i965` did it and it runs cleanly now.
Score:2
dz flag

I ran into a similar problem when trying to run a python app in a virtual environment (anaconda3). It turned out that the library libstdc++.so used by the virtual env was different from the one used by the OS.

I needed first to find out the full paths to libraries involved:

DISPLAY=:0 LIBGL_DEBUG=verbose python test.py

This gave me a hint that the libstdc++.so.6 used here might be different from the one used by OS:

libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/i965_dri.so: /home/fairfax/anaconda3/envs/py3/bin/../lib/libstdc++.so.6
: version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/dri/i965_dri.so)

Then I checked out the library used by the virtual env:

strings /home/fairfax/anaconda3/envs/py3/bin/../lib/libstdc++.so.6 | grep CXXABI

To find out that the flag CXXABI_1.3.8 was indeed missing. I was able to fix this by overwriting the virtual env version with the system version of libstdc++.so.6 and redirecting all symbolic links to the new version:

$~/anaconda3/envs/py3/lib$ ls -al | grep libstdc++     
 lrwxrwxrwx  1 fairfax fairfax       19 lis  1 08:55 libstdc++.so -> libstdc++.so.6.0.25                                                
lrwxrwxrwx  1 fairfax fairfax       19 lis  1 08:55 libstdc++.so.6 -> libstdc++.so.6.0.25                                              
-rw-r--r--  1 fairfax fairfax  1594864 říj 29 16:27 libstdc++.so.6.0.25
vuvu avatar
us flag
Nice solution, thanks! Had very similar error, saw your answer, found all my anaconda3 libstdc++.so.6 items being links to a libstdc++.so.6.0.24, moved that aside [to libstdc++.so.6.0.24.orig] and made a link to the system-provided /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28 with the original anaconda3's file name+location and all worked without complaints anymore!
hfs avatar
se flag
hfs
I was able to fix this problem by updating the packages in the conda environment. This pulled in a newer version of libstdc++
Score:1
zw flag

On the package level this maybe fixed by installing single package:

sudo apt-get install libgl1-mesa-dri

Then about the packages:

  • Pymol is packaged in Ubuntu with version 2.3.0, so it is installable by

    sudo add-apt-repository universe
    sudo apt-get install pymol
    
Tam Heng Keat avatar
us flag
I did 'sudo apt-get install libgl1-mesa-dri' but it doesn't work. I use the pymol-open-source from Github. I tried the 'sudo apt-get install pymol' as well and it doesn't work as well.
Tam Heng Keat avatar
us flag
I wonder it is related to the graphic card as I manage to run all these software with 'export MESA_LOADER_DRIVER_OVERRIDE=i965' in bash.
Alexei Martianov avatar
cn flag
@Tam Heng Keat, I wrote my answer w/out reading your comments here. My answer is essentially about workaround I see you know already but hope it is still useful as I added link and explanation of the root cause of the issue.
Score:0
ng flag

After many searches, I found a stack overflow post with more helpful answers for me at https://stackoverflow.com/questions/48453497/anaconda-libstdc-so-6-version-glibcxx-3-4-20-not-found

[Edit: OK, I solved my problem with the below steps, but now sometimes (not always!) when I run my python programs in this environment it gives the message free(): invalid pointer when my python program terminates, which is scary and undesirable. Though, it's a shorter error message so I'm keeping it for now :P]

Here's how I solved my problem:

  1. I installed the latest version of gcc
conda install libgcc

After I tested it, it still didn't work for me, but maybe it will work for you.

  1. I checked to see what kinds of linker files I had.
sudo find / -wholename "*conda*/**/libstdc++.so*"

Among other output files were the files (this environment is called moon)

/home/alex/miniconda3/envs/moon/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/home/alex/miniconda3/envs/moon/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.26
/home/alex/miniconda3/envs/moon/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so
/home/alex/miniconda3/envs/moon/lib/libstdc++.so.6
/home/alex/miniconda3/envs/moon/lib/libstdc++.so.6.0.26
/home/alex/miniconda3/envs/moon/lib/libstdc++.so
/home/alex/miniconda3/envs/moon/lib/libstdc++.so.6.0.21

Before installing libgcc with conda, I only had the files

/home/alex/miniconda3/envs/moon/lib/libstdc++.so.6
/home/alex/miniconda3/envs/moon/lib/libstdc++.so.6.0.28
/home/alex/miniconda3/envs/moon/lib/libstdc++.so

You are supposed to have exactly 3 files that look something like this in your directory - there was a duplicate created for some reason.

I decided to try getting rid of all of the files that were similar to the old ones with

rm /home/alex/miniconda3/envs/moon/lib/libstdc++*

And after this, my error message disappeared.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.