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

后端 未结 1 1933
执念已碎
执念已碎 2021-01-03 10:48

When running an app that uses Qt 4.7 on my Fedora 19 box I am getting the following errors from the application:

libGL: screen 0 does not appear to be DRI2 c         


        
1条回答
  •  心在旅途
    2021-01-03 11:06

    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 and chrpath -l
    2. Replace the wrong path with the correct one (without the offending /usr/lib64) using chrpath -r
      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.

    0 讨论(0)
提交回复
热议问题