Fedora 19 using rpmfussion's NVIDIA driver: libGL error: failed to load driver: swrast

核能气质少年 提交于 2019-11-30 15:47:27

We were able to get rid of the same error messages for octave-4.0.0-rc1 which also use Qt. The bug hunting history can be found here.

It turned out to be an incorrect runpath in a shared library (.so). The runpath contained /usr/lib64. Hence at runtime the /usr/lib64/libGL.so was loaded, instead of the right nvidia /usr/X11R6/lib64/libGL.so.

Workaround

  1. Find the lib or executable which has the incorrect runpath with ldd <app or lib> and chrpath -l <app or lib>
  2. Replace the wrong path with the correct one (without the offending /usr/lib64) using chrpath -r <correct path> <app or lib>
    The following one-liner did this for liboctgui.so. Just replace "liboctgui.so" by your value. chrpath -r $(chrpath -l liboctgui.so | cut -d '=' -f '2' | awk '{gsub(/\/usr\/lib64/, "")}; 1') liboctgui.so

Origin

The incorrect runpath was picked up at compilation time from an irrelevant -L/usr/lib64 in libQt*.la files located in /usr/lib64. The comment #18 explains why it is wrong.

And indeed, lib*.la files should not be packaged, according to OpenSUSE own recommendations

Avoid packaging libtool config files (.la files). If you do not package a static library, and if you are also placing the shared library in a standard search directory (i.e. %_lib, /usr/%_lib), they will not be needed.

Removing lib*.la from /usr/lib64 and rebuilding fixed the problem for good.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!