libGL 错误:无法在 Ubuntu 20.04 中加载驱动程序 iris 和 swrast

libGL 错误:无法在 Ubuntu 20.04 中加载驱动程序 iris 和 swrast

我在启动第三方科学软件(例如 coot、pymol 或 chimera)时遇到了一些问题(请参阅下面的消息)。

我使用 coot 二进制文件 (0.9.5)。Chimera 是 1.14 build 42018。Ubuntu 20.04.2 LTS Gnome。我使用 Github 的 pymol-open-source

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

看来 iris 和 swrast 存在一些问题(请参阅下面的消息)。

我总是收到关于嵌合体的这条消息:

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

我收到了关于 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.

谢谢您的帮助。


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

答案1

我刚刚在 Linux Mint 上使用 Kiwix 时遇到了同样的问题,并找到了您的问题。我能够通过阅读以下内容解决我的问题:https://github.com/kiwix/kiwix-desktop/issues/393。我理解的问题是,Ubuntu 上的 iris 驱动程序配置为笔记本电脑默认使用,而在我的旧笔记本电脑上,显卡支持较旧的驱动程序。因此,解决方案/解决方法是在命令提示符中运行应用程序之前设置环境变量,如下所示:

MESA_LOADER_DRIVER_OVERRIDE=i965 ./kiwix-deskop

希望这也对你有帮助。

PS 如果您想尝试永久设置此变量并且没有其他任何中断,请参阅: 如何永久设置环境变量

答案2

在软件包级别,可以通过安装单身的 包裹

sudo apt-get install libgl1-mesa-dri

然后关于包裹:

  • Pymol 在 Ubuntu 中打包为版本 2.3.0,因此可以通过

    sudo add-apt-repository universe
    sudo apt-get install pymol
    

答案3

当我尝试在虚拟环境 (anaconda3) 中运行 Python 应用程序时,我遇到了类似的问题。结果发现libstdc++.so虚拟环境使用的库与操作系统使用的库不同。

我首先需要找出所涉及库的完整路径:

DISPLAY=:0 LIBGL_DEBUG=verbose python test.py

这提示我libstdc++.so.6这里使用的可能与 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)

然后我检查了虚拟环境使用的库:

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

发现CXXABI_1.3.8确实缺少该标志。我可以通过使用系统版本覆盖虚拟环境版本libstdc++.so.6并将所有符号链接重定向到新版本来解决这个问题:

$~/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

答案4

我通过删除导致冲突的符号链接 ~/anaconda3/lib/libstdc++.so.6 解决了该问题,因为它指向较低的版本。

备份旧文件: mv ~/anaconda3/lib/libstdc++.so.6 ~/libstdc++.so.6

或者删除它 rm ~/anaconda3/lib/libstdc++.so.6

在此向 Fred 表示敬意:https://stackoverflow.com/questions/71263856/kivy-not-working-mesa-loader-failed-to-open-iris-and-swrast

相关内容