Fedora 19使用rpmfussion的NVIDIA驱动程序:libGL错误:无法加载驱动程序:swrast [英] Fedora 19 using rpmfussion's NVIDIA driver: libGL error: failed to load driver: swrast

查看:488
本文介绍了Fedora 19使用rpmfussion的NVIDIA驱动程序:libGL错误:无法加载驱动程序:swrast的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Fedora 19盒子上运行使用Qt 4.7的应用程序时,我从该应用程序中收到以下错误:

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 capable
libGL: OpenDriver: trying /usr/lib64/dri/tls/swrast_dri.so libGL: OpenDriver: trying /usr/lib64/dri/swrast_dri.so 
libGL: Can't open configuration file /home/Matthew.Hoggan/.drirc: No such file or directory. 
libGL error: failed to load driver: swrast ERROR: Error failed to create progam.

在使用glx配置上下文的普通X11应用程序中,我看不到这些错误.我假设这是因为Qt在下面使用了egl.从 http://malideveloper.arm.com/develop-for-mali/tools/opengl-es-3-0-emulator/.

I do not see these errors in a stock X11 application where the context is configured using glx. I am assuming this is because Qt uses egl underneath. The same thing happens when using the EGL 3 emulator from http://malideveloper.arm.com/develop-for-mali/tools/opengl-es-3-0-emulator/ while running their cube example.

我已经验证了是否同时安装了xorg-x11-drv-nvidia-libs.i686和yum install xorg-x11-drv-nvidia-libs.x86_64 rpm.

I have already verified that both xorg-x11-drv-nvidia-libs.i686 and yum install xorg-x11-drv-nvidia-libs.x86_64 rpms are installed.

我的系统信息是:

Linux localhost.localdomain 3.11.9-200.fc19.x86_64 #1 SMP Wed Nov 20 21:22:24 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

而glxinfo是:

[Matthew.Hoggan@localhost QtTest]$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 4.3.0 NVIDIA 331.38
OpenGL core profile shading language version string: 4.30 NVIDIA via Cg compiler
OpenGL version string: 4.4.0 NVIDIA 331.38
OpenGL shading language version string: 4.40 NVIDIA via Cg compiler

这里有任何建议还是需要更多信息?

Any suggestions here or is more information needed?

推荐答案

我们能够消除同样使用Qt的octave-4.0.0-rc1的相同错误消息.可以在此处找到该错误的狩猎历史.

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.

原来是共享库(.so)中的不正确的运行路径.运行路径包含/usr/lib64.因此,在运行时加载了/usr/lib64/libGL.so,而不是正确的nvidia/usr/X11R6/lib64/libGL.so.

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.

  1. 使用ldd <app or lib>chrpath -l <app or lib>
  2. 查找具有错误运行路径的库或可执行文件
  3. 使用chrpath -r <correct path> <app or lib>
    将错误的路径替换为正确的路径(不违反/usr/lib64) 以下一线代码针对liboctgui.so进行了此操作.只需将"liboctgui.so"替换为您的值即可. chrpath -r $(chrpath -l liboctgui.so | cut -d '=' -f '2' | awk '{gsub(/\/usr\/lib64/, "")}; 1') liboctgui.so
  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

来源

错误的运行路径是在编译时从不相关的路径中拾取的 /usr/lib64中的libQt*.la文件中的-L/usr/lib64. 评论#18 解释了为什么它是错误的.

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.

实际上,根据 OpenSUSE自己的建议 lib*.la文件>

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

避免打包libtool配置文件(.la文件).如果你不 打包一个静态库,如果您还要放置共享库 标准搜索目录(即%_lib,/usr/%_ lib)中的库 不需要.

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.

从/usr/lib64中删除lib*.la并重建可以永久解决此问题.

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

这篇关于Fedora 19使用rpmfussion的NVIDIA驱动程序:libGL错误:无法加载驱动程序:swrast的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆