我的 OpenGL 根本不起作用
Xlib: extension "GLX" missing on display ":0".
lspci 输出
00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0126] (rev 09) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1246] (rev a1) (prog-if 00 [VGA controller])
消息 | grep -i nvid
[ 9.469068] nvidia: module license 'NVIDIA' taints kernel.
[ 9.538786] nvidia 0000:01:00.0: power state changed by ACPI to D0
[ 9.538792] nvidia 0000:01:00.0: power state changed by ACPI to D0
[ 9.538796] nvidia 0000:01:00.0: enabling device (0006 -> 0007)
[ 9.538803] nvidia 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 9.538809] nvidia 0000:01:00.0: setting latency timer to 64
[ 9.538942] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 304.48 Sun Sep 9
[10300.955799] nvidia 0000:01:00.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[10300.955803] nvidia 0000:01:00.0: restoring config space at offset 0xc (was 0x0, writing 0xfff80000)
[10300.955807] nvidia 0000:01:00.0: restoring config space at offset 0x9 (was 0x1, writing 0x4001)
[10300.955811] nvidia 0000:01:00.0: restoring config space at offset 0x7 (was 0xc, writing 0xd000000c)
[10300.955814] nvidia 0000:01:00.0: restoring config space at offset 0x5 (was 0xc, writing 0xc000000c)
[10300.955817] nvidia 0000:01:00.0: restoring config space at offset 0x4 (was 0x0, writing 0xf0000000)
[10300.955820] nvidia 0000:01:00.0: restoring config space at offset 0x3 (was 0x800000, writing 0x10)
[10300.955823] nvidia 0000:01:00.0: restoring config space at offset 0x1 (was 0x100006, writing 0x100007)
我的电脑是戴尔 XPS l702x
答案1
听起来你还没有启用 Nvidia 驱动程序。单击启动器中的 Dash 图标,搜索“添加”并选择附加驱动程序图标。我正在使用 Nvidia 当前版本,甚至没有发布后更新,驱动程序版本为 304.64。
使用以下命令检查你正在运行的 Nvidia 驱动程序:
dmesg | grep -i nvid
输出应包含类似以下一行:[ 20.731109] NVRM: loading NVIDIA UNIX x86 Kernel Module 304.64 Tue Oct 30 11:09:29 PDT 2012,其中给出了驱动程序版本号。
好的,您有一个较旧的 304 驱动程序,应该可以工作。检查 libglx 库链接是否到位
$ ls -l /usr/lib/i386-linux-gnu/xorg/extra-modules/libglx.so
lrwxrwxrwx 1 root root 16 Nov 6 19:54 /usr/lib/i386-linux-gnu/xorg/extra-modules/libglx.so -> libglx.so.304.64
$ ls -l /usr/lib/i386-linux-gnu/xorg/extra-modules
lrwxrwxrwx 1 root root 51 Jun 13 2012 /usr/lib/i386-linux-gnu/xorg/extra-modules -> /etc/alternatives/i386-linux-gnu_xorg_extra_modules
$ ls /etc/alternatives/i386-linux-gnu_xorg_extra_modules
libglx.so libglx.so.304.64 nvidia_drv.so
文件 /var/log/Xorg.0.log 应该包含如下部分:
[21.014] (II) LoadModule: "glx" [21.014] (II) 正在加载 /usr/lib/i386-linux-gnu/xorg/extra-modules/libglx.so [21.087] (II) Module glx: vendor="NVIDIA Corporation" [21.087] 针对 4.0.2 编译,模块版本 = 1.0.0 [21.087] Module class: X.Org Server Extension [21.087] (II) NVIDIA GLX Module 304.64 Tue Oct 30 11:31:18 PDT 2012 [21.087] (II) 正在加载扩展 GLX
使用以下命令列出系统中的 OpenGL 包:
dpkg -l |egrep -i " GL |glx|opengl"
我的系统上的输出以及许多 compiz 行有:
libgl1-mesa-dri 9.0-0ubuntu1 free implementation of the OpenGL API -- DRI modules
libgl1-mesa-glx 9.0-0ubuntu1 free implementation of the OpenGL API -- GLX runtime libglapi-mesa 9.0-0ubuntu1 free implementation of the GL API -- shared library
libglew1.6 1.6.0-4 OpenGL Extension Wrangler - runtime environment libglewmx1.6 1.6.0-4 OpenGL Extension Wrangler - runtime environment libglu1-mesa 8.0.4-0ubuntu0.2 Mesa OpenGL utility library (GLU)
libqt4-opengl 4:4.8.1-0ubuntu4.3 Qt 4 OpenGL module
libxcb-glx0 1.8.1-1ubuntu0.1 X C Binding, glx extension
mesa-utils 8.0.1+git20110129+d8f7d6b-0ubuntu2 Miscellaneous Mesa GL utilities
也许您应该使用以下命令在虚拟终端中更新系统:
sudo apt-get update
sudo apt-get upgrade
至少要获得更新的 Nvidia 驱动程序,在我的系统上,至少在 304.50? 之前,存在相当严重的问题。