我整天都只能在 1024x768 分辨率下使用 Unity 2D,尝试了各种解决方法但都无济于事。我的问题始于升级到 PPA 中的 mesa9.0 时ubuntu-x-swat/x-updates
。重启后,我被踢进了 Unity2D,无法让 3D 再次工作。我手动将所有软件包降级到 8.0.4,希望这能解决问题,但并没有。我浏览了 AskUbuntu 和 Ubuntu 论坛上的所有主题,遵循了我能找到的所有建议,但仍然一无所获。我的系统似乎处于一种我无法摆脱的不稳定状态。
TL;DR; 解决方案
在这个问题上挣扎了几个小时后,我终于偶然发现了一个 CentOS 的错误报告,有人遇到了类似的问题。原来,在 期间apt-get upgrade
,一个包(我真的不知道是哪个)在 中添加了nomodeset
选项。一旦将其删除(奇怪的是还有一个,也删除了它),英特尔驱动程序就会再次按预期工作。GRUB_CMDLINE_LINUX_DEFAULT
/etc/default/grub
vga=1
我将在周末尝试再次升级 Mesa 9,希望它不会让我直接回到这个话题。
我尝试了几乎所有能找到的方法:
$ _ apt-get purge 'bumblebee*' 'nvidia-current*' 'nvidia-settings*'
$ _ reboot
$ _ apt-get install libgl1-mesa-dri libgl1-mesa-dri:i386 libgl1-mesa-dev mesa-common-dev libgl1-mesa-glx:i386 libgl1-mesa-glx libglapi-mesa libglapi-mesa:i386 libgles2-mesa libgles1-mesa libegl1-mesa-drivers libopenvg1-mesa libegl1-mesa libosmesa6:i386 libosmesa6 libdrm-nouveau1a libdrm-nouveau1a:i386 xserver-xorg-core libdrm-dev libdrm2 libdrm2:i386 libdrm-radeon1 libdrm-radeon1:i386 libdrm-nouveau1a libdrm-nouveau1a:i386 libdrm-intel1:i386 libdrm-intel1 libkms1 libgbm1 --reinstall
$ _ reboot
$ _ rm -f /usr/lib/xorg/modules/extensions/libglx.so* /usr/lib/xorg/modules/extensions/nvidia_drv.so
$ _ reboot
$ _ rm /etc/X11/xorg.conf
$ _ reboot
$ _ apt-get install bumblebee
所以基本上,我清除了所有内容,重新安装了所有内容,但仍然什么都没有。
我听从了使用 NVIDIA Optimus/Bumblebee 实现硬件加速桌面效果:
$ ls -l /usr/lib/x86_64-linux-gnu/xorg/extra-modules
lrwxrwxrwx 1 root 根 53 十月 18 17:58 /usr/lib/x86_64-linux-gnu/xorg/extra-modules -> /etc/alternatives/x86_64-linux-gnu_xorg_extra_modules $ ls -l /etc/alternatives/x86_64-linux-gnu_xorg_extra_modules lrwxrwxrwx 1 root 根 48 十月 18 17:58 /etc/alternatives/x86_64-linux-gnu_xorg_extra_modules -> /usr/lib/x86_64-linux-gnu/xorg/x11-extra-modules $ ls -l /usr/lib/x86_64-linux-gnu/xorg/x11-extra-modules 总计 0
$ uname -a
Linux stan-inspiron 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$ $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"
$ update-alternatives --display x86_64-linux-gnu_gl_conf
x86_64-linux-gnu_gl_conf - manual mode
link currently points to /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf
/usr/lib/nvidia-current/ld.so.conf - priority 9700
slave x86_64-linux-gnu_grub_fb_blacklist: /usr/share/nvidia-current/nvidia-current.grub-gfxpayload
slave x86_64-linux-gnu_libOpenCL.so: /usr/lib/nvidia-current/libOpenCL.so
slave x86_64-linux-gnu_libOpenCL.so_lib32: /usr/lib32/nvidia-current/libOpenCL.so
slave x86_64-linux-gnu_libvdpau_nvidia.so: /usr/lib/nvidia-current/vdpau/libvdpau_nvidia.so
slave x86_64-linux-gnu_libvdpau_nvidia.so.1: /usr/lib/nvidia-current/vdpau/libvdpau_nvidia.so.1
slave x86_64-linux-gnu_libvdpau_nvidia.so.1_lib32: /usr/lib32/nvidia-current/vdpau/libvdpau_nvidia.so.1
slave x86_64-linux-gnu_libvdpau_nvidia.so_lib32: /usr/lib32/nvidia-current/vdpau/libvdpau_nvidia.so
slave x86_64-linux-gnu_man_nvidiaxconfig.gz: /usr/share/man/man1/alt-nvidia-current-xconfig.1.gz
slave x86_64-linux-gnu_nvidia-autostart.desktop: /usr/share/nvidia-current/nvidia-autostart.desktop
slave x86_64-linux-gnu_nvidia-smi.1.gz: /usr/share/man/man1/alt-nvidia-current-smi.1.gz
slave x86_64-linux-gnu_nvidia.icd: /usr/share/nvidia-current/nvidia.icd
slave x86_64-linux-gnu_nvidia_bug_report: /usr/lib/nvidia-current/bin/nvidia-bug-report.sh
slave x86_64-linux-gnu_nvidia_desktop: /usr/share/nvidia-current/ubuntu-nvidia-settings.desktop
slave x86_64-linux-gnu_nvidia_drv: /usr/lib/nvidia-current/xorg/nvidia_drv.so
slave x86_64-linux-gnu_nvidia_modconf: /lib/nvidia-current/modprobe.conf
slave x86_64-linux-gnu_nvidia_smi: /usr/lib/nvidia-current/bin/nvidia-smi
slave x86_64-linux-gnu_nvidia_xconfig: /usr/lib/nvidia-current/bin/nvidia-xconfig
slave x86_64-linux-gnu_xorg_extra_modules: /usr/lib/nvidia-current/xorg
slave x86_64-linux-gnu_xvmcconfig: /usr/lib/nvidia-current/XvMCConfig
/usr/lib/x86_64-linux-gnu/mesa/ld.so.conf - priority 500
slave x86_64-linux-gnu_xorg_extra_modules: /usr/lib/x86_64-linux-gnu/xorg/x11-extra-modules
Current 'best' version is '/usr/lib/nvidia-current/ld.so.conf'.
$ LIBGL_DEBUG=verbose /usr/lib/nux/unity_support_test -p
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/stan/.drirc: No such file or directory.
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 0x300)
OpenGL version string: 2.1 Mesa 8.0.4
Not software rendered: no
Not blacklisted: yes
GLX fbconfig: yes
GLX texture from pixmap: yes
GL npot or rect textures: yes
GL vertex program: yes
GL fragment program: yes
GL vertex buffer object: yes
GL framebuffer object: yes
GL version is 1.4+: yes
Unity 3D supported: no
$ lspci -vnn | grep '\''[030[02]\]'
00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0116] (rev 09) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108 [GeForce GT 540M] [10de:0df5] (rev ff) (prog-if ff)
$ LIBGL_DEBUG=verbose optirun /usr/lib/nux/unity_support_test -p
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GT 525M/PCIe/SSE2
OpenGL version string: 4.2.0 NVIDIA 304.51
Not software rendered: yes
Not blacklisted: yes
GLX fbconfig: yes
GLX texture from pixmap: no
GL npot or rect textures: yes
GL vertex program: yes
GL fragment program: yes
GL vertex buffer object: yes
GL framebuffer object: yes
GL version is 1.4+: yes
Unity 3D supported: no
我的想法是,Bumblebee 运行正常,但我无法使用英特尔视频,因此它会退回到 VESA。
有人可以给我一些启发并帮助我吗?
为了丰满,这是 Xorg.0.log 文件。
编辑1:我恢复了升级前的目录备份/etc
,并将所有文件与当前版本进行了比较。其中的任何文件都没有变化,/etc/X11
这让我再次想到一定是某个库卡在了某个地方,造成了混乱。
编辑2:按照建议,xserver-xorg-core
重新安装:
$ dpkg -S libglx.so
nvidia-current: /usr/lib/nvidia-current/xorg/libglx.so
nvidia-current: /usr/lib/nvidia-current/xorg/libglx.so.304.51
xserver-xorg-core: /usr/lib/xorg/modules/extensions/libglx.so
$ _ apt-get install --reinstall xserver-xorg-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/1,719 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 342599 files and directories currently installed.)
Preparing to replace xserver-xorg-core 2:1.11.4-0ubuntu10.8 (using .../xserver-xorg-core_2%3a1.11.4-0ubuntu10.8_amd64.deb) ...
Unpacking replacement xserver-xorg-core ...
Processing triggers for man-db ...
Setting up xserver-xorg-core (2:1.11.4-0ubuntu10.8) ...
localepurge: Disk space freed in /usr/share/locale: 0 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB
localepurge: Disk space freed in /usr/share/gnome/help: 0 KiB
localepurge: Disk space freed in /usr/share/omf: 0 KiB
Total disk space freed by localepurge: 0 KiB
$ _ reboot
$ LIBGL_DEBUG=verbose glxgears
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/stan/.drirc: No such file or directory.
8434 frames in 5.0 seconds = 1686.685 FPS
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
after 31148 requests (31148 known processed) with 0 events remaining.
$ _ updatedb
$ locate libglx.so
/usr/lib/nvidia-current/xorg/libglx.so
/usr/lib/nvidia-current/xorg/libglx.so.304.51
/usr/lib/xorg/modules/extensions/libglx.so
日志文件和遇到的问题保持不变。
答案1
$ apt-get install libgl1-mesa-dri libgl1-mesa-dri:i386 libgl1-mesa-dev mesa-common-dev libgl1-mesa-glx:i386 libgl1-mesa-glx libglapi-mesa libglapi-mesa:i386 libgles2-mesa libgles1-mesa libegl1-mesa-drivers libopenvg1-mesa libegl1-mesa libosmesa6:i386 libosmesa6 libdrm-nouveau1a libdrm-nouveau1a:i386 xserver-xorg-core libdrm-dev libdrm2 libdrm2:i386 libdrm-radeon1 libdrm-radeon1:i386 libdrm-nouveau1a libdrm-nouveau1a:i386 libdrm-intel1:i386 libdrm-intel1 libkms1 libgbm1 --reinstall
$ reboot
$ rm -f /usr/lib/xorg/modules/extensions/libglx.so* /usr/lib/xorg/modules/extensions/nvidia_drv.so
这个顺序是错误的,你重新安装了提供 libglx.so 的包并再次删除了该文件。使用http://packages.ubuntu.com/(或dpkg -S libglx.so
)查找哪个包提供了该文件。然后重新安装:
sudo apt-get install --reinstall xserver-xorg-core