linux上的gDebugger libGL错误

时间:2014-10-05 11:25:11

标签: linux opengl

我试图用gDEBugger调试我的OpenGl项目,但不幸的是gDEBugger甚至没有启动:

~/bin/gDEBugger581-x86_64> ./gDEBugger-bin 
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
Segmentation fault
~/bin/gDEBugger581-x86_64> LIBGL_DEBUG=verbose ./gDEBugger-bin 
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib64/dri/updates/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/updates/swrast_dri.so
libGL error: dlopen /usr/lib64/dri/updates/swrast_dri.so failed (/usr/lib64/dri/updates    /swrast_dri.so: cannot open shared object file: No such file or directory)
libGL: OpenDriver: trying /usr/lib64/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/swrast_dri.so
libGL error: dlopen /usr/lib64/dri/swrast_dri.so failed (/usr/lib64/dri/swrast_dri.so:     undefined symbol: _glapi_tls_Dispatch)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Segmentation fault

这发生在最后一个gremedy版本(5.8.1),最后一个AMD版本(6.2.4)和最新的CodeXL版本(CodeXL没有崩溃,但同样的错误出现不少和调试没有& #39; t work)。

我在使用OpenSuse 13.1时,我有一张NVIDIA显卡并安装了最新的驱动程序。其他OpenGL程序工作得很好。到目前为止,我已尝试重新安装NVIDIA驱动程序,重新安装所有MESA软件包,将CUDA从5.5更新到6.5,检查所有mesa软件包是否从标准suse repo安装并运行ldd:

~/bin/gDEBugger581-x86_64> ldd gDEBugger-bin 
    linux-vdso.so.1 (0x00007fffe9ffe000)
    libGRBaseTools.so => ./libGRBaseTools.so (0x00007f41df93e000)
    libGROSWrappers.so => ./libGROSWrappers.so (0x00007f41df6cc000)
    libGRAPIClasses.so => ./libGRAPIClasses.so (0x00007f41df358000)
    libGRProcessDebugger.so => ./libGRProcessDebugger.so (0x00007f41df123000)
    libGRApiFunctions.so => ./libGRApiFunctions.so (0x00007f41deedf000)
    libGRApplicationComponents.so => ./libGRApplicationComponents.so (0x00007f41debce000)
    libgDEBuggerAppCode.so => ./libgDEBuggerAppCode.so (0x00007f41de5b0000)
    libwx_base-2.8.so.0 => ./libwx_base-2.8.so.0 (0x00007f41de29e000)
    libwx_gtk2_core-2.8.so.0 => ./libwx_gtk2_core-2.8.so.0 (0x00007f41ddcd9000)
    libwx_gtk2_html-2.8.so.0 => ./libwx_gtk2_html-2.8.so.0 (0x00007f41dda2f000)
    libwx_gtk2_adv-2.8.so.0 => ./libwx_gtk2_adv-2.8.so.0 (0x00007f41dd753000)
    libwx_gtk2_aui-2.8.so.0 => ./libwx_gtk2_aui-2.8.so.0 (0x00007f41dd4e2000)
    libwx_gtk2_gl-2.8.so.0 => ./libwx_gtk2_gl-2.8.so.0 (0x00007f41dd2d5000)
    libwx_gtk2_stc-2.8.so.0 => ./libwx_gtk2_stc-2.8.so.0 (0x00007f41dcfcb000)
    libfreeimage.so.3 => ./libfreeimage.so.3 (0x00007f41dcc35000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f41dc92d000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f41dc62a000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f41dc413000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f41dc065000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f41dbe61000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f41dbc59000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f41dba3b000)
    libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f41db6fd000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f41db4e7000)
    libGL.so.1 => /usr/X11R6/lib64/libGL.so.1 (0x00007f41db19b000)
    libgtk-x11-2.0.so.0 => /usr/lib64/libgtk-x11-2.0.so.0 (0x00007f41dab5c000)
    libgdk-x11-2.0.so.0 => /usr/lib64/libgdk-x11-2.0.so.0 (0x00007f41da8a7000)
    libatk-1.0.so.0 => /usr/lib64/libatk-1.0.so.0 (0x00007f41da683000)
    libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007f41da31c000)
    libpangoft2-1.0.so.0 => /usr/lib64/libpangoft2-1.0.so.0 (0x00007f41da108000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib64/libgdk_pixbuf-2.0.so.0 (0x00007f41d9ee7000)
    libpango-1.0.so.0 => /usr/lib64/libpango-1.0.so.0 (0x00007f41d9c9b000)
    libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f41d9a09000)
    libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007f41d97cc000)
    libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f41d957b000)
    libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007f41d9377000)
    libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007f41d9175000)
    libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f41d8e72000)
    libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x00007f41d8c6f000)
    libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 (0x00007f41d8a69000)
    libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007f41d8861000)
    libGLU.so.1 => /usr/lib64/libGLU.so.1 (0x00007f41d85e2000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f41dfb49000)
    libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f41d83c3000)
    libnvidia-tls.so.340.32 => /usr/lib64/tls/libnvidia-tls.so.340.32 (0x00007f41d81c0000)
    libnvidia-glcore.so.340.32 => /usr/lib64/libnvidia-glcore.so.340.32 (0x00007f41d55ad000)
    libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f41d539b000)
    libpangocairo-1.0.so.0 => /usr/lib64/libpangocairo-1.0.so.0 (0x00007f41d518e000)
    libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007f41d4f88000)
    libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007f41d4c69000)
    libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007f41d4a5f000)
    libXi.so.6 => /usr/lib64/libXi.so.6 (0x00007f41d484f000)
    libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x00007f41d4645000)
    libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x00007f41d443a000)
    libXcomposite.so.1 => /usr/lib64/libXcomposite.so.1 (0x00007f41d4237000)
    libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x00007f41d4034000)
    libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f41d3e10000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f41d3bf9000)
    libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007f41d39a6000)
    libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007f41d3769000)
    libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f41d353f000)
    libffi.so.4 => /usr/lib64/libffi.so.4 (0x00007f41d3337000)
    libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007f41d30d1000)
    libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007f41d2eb5000)
    libuuid.so.1 => /usr/lib64/libuuid.so.1 (0x00007f41d2cb0000)
    libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f41d2aac000)
    libpixman-1.so.0 => /usr/lib64/libpixman-1.so.0 (0x00007f41d2803000)
    libEGL.so.1 => /usr/X11R6/lib64/libEGL.so.1 (0x00007f41d24fa000)
    libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007f41d22f7000)
    libxcb-render.so.0 => /usr/lib64/libxcb-render.so.0 (0x00007f41d20ed000)
    libgraphite2.so.3 => /usr/lib64/libgraphite2.so.3 (0x00007f41d1ed1000)
    libnvidia-glsi.so.340.32 => /usr/lib64/libnvidia-glsi.so.340.32 (0x00007f41d1c49000)

我注意到,当用LIBGL_DEBUG=verbose运行我自己的程序时,根本就没有libGL输出。如果重要的话,我使用glfw 2.7和glew 1.9。过剩的应用程序。

我认为gDEBugger有一种不同的方式来查找和加载libGL,不知怎的,它最终使用的是mesa而不是nvidia。但是我对台面和nvidia驱动程序及其工作方式的了解非常有限。

编辑: 新信息:

strace -e open ./gDEBugger-bin 2>&1 | grep libGL.so
open("./tls/x86_64/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("./tls/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("./x86_64/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("./libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib64/mpi/gcc/openmpi/lib64/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/damdam/bin/pgmodeler/libGL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/X11R6/lib64/libGL.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/usr/X11R6/lib64/libGL.so.340.32", O_RDONLY) = 3
open("/usr/X11R6/lib64/libGL.so.340.32", O_RDONLY) = 3
open("/usr/X11R6/lib64/libGL.so.340.32", O_RDONLY) = 4
open("/usr/lib64/libGL.so.1", O_RDONLY|O_CLOEXEC) = 7
open("/usr/X11R6/lib64/libGL.so.340.32", O_RDONLY) = 7
open("/usr/lib64/libGL.so.1", O_RDONLY) = 7

为了进行比较,对于工作程序来说,这是相同的:http://paste.opensuse.org/76645738 这是完整的输出(没有grep):http://paste.opensuse.org/8336779

我尝试在/usr/lib64/中设置以下链接:

 libGLESv1_CM.so -> /usr/X11R6/lib64/libGLES
 libGLESv1_CM.so.1 -> /usr/X11R6/lib64/libGL
 libGLESv1_CM.so.1.1.0 -> /usr/X11R6/lib64/l
 libGLESv2.so -> /usr/X11R6/lib64/libGLESv2.
 libGLESv2.so.2 -> /usr/X11R6/lib64/libGLESv
 libGLESv2.so.2.0.0 -> /usr/X11R6/lib64/libG
 libGL.so -> /usr/X11R6/lib64/libGL.so
 libGL.so.1 -> /usr/X11R6/lib64/libGL.so
 libGL.so.1.2 -> /usr/X11R6/lib64/libGL.so
 libGL.so.1.2.0 -> /usr/X11R6/lib64/libGL.so

之后行为发生了变化,程序崩溃了,而且没有打印任何内容。

编辑: 新的消息

时,gremedy gDEBugger(5.8.1)不再加载/usr/lib64/libGL.so
 export LIBGL_DRIVERS_PATH="/usr/X11R6/lib64/"
它只是崩溃了。所以我现在的猜测是,它一直都知道正确的libGL,但无法加载它。要么我的系统有些奇怪,要么就是我第一次报道这个问题。

2 个答案:

答案 0 :(得分:2)

我在同一个发行版中遇到了同样的问题。最后,我将其跟踪到环境变量LD_LIBRARY_PATH

我已将/usr/lib//usr/lib64/添加到LD_LIBRARY_PATH以尝试解决链接问题。似乎包括来自包LD_LIBRARY_PATH的包Mesa-libGL1 hid /usr/lib64/libGL.so.1的{​​{1}}中的/usr/X11R6/lib64/libGL.so.1意味着x11-video-nvidiaG02的目录。

在没有这两个目录的情况下重新导出LD_LIBRARY_PATH已经整理了libGL并再次运行。

答案 1 :(得分:1)

错误消息表明由于某种原因,gDEBugger动态链接libGL.so的Mesa变体(只有Mesa尝试与DRI协议通话)。使用系统中的NVidia GPU,我认为NVidia专有的驱动程序也已经安装和配置,这表明,某些事情已经严重脱落。

另一种可能性是,您根本没有安装NVidia专有驱动程序,而是完全脱离Mesa。问题是,Mesa的NVidia GPU支持对于2005年以后建立的任何GPU都只是基本的。

请注意,如果您使用的是NVidia专有驱动程序,则根本不需要安装Mesa(尽管使用它并使用Mesa libGL.so作为程序的链接目标,即使NVidia也是如此) libGL.so在运行时使用是非常明智的。)