Debian 大黄蜂问题

Debian bumblebee problems

我正在进行一个干净的最小 Debian Stretch 安装,只安装了几个图形包。我安装了这些:

sudo apt install xserver-xorg-core xinit bumblebee-nvidia primus primus-libs:i386 libgl1-nvidia-glx:i386

但我可以将专有 bumblebee-nvidia 与开源 bumblebee 交换。

我也把我的用户加入了大黄蜂群:

sudo adduser $USER bumblebee

重新启动后我的 Intel 卡工作正常:

ziga@ziga-laptop:~$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 13.0.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 13.0.6
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 13.0.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

但是我的 Nvidia 卡是 Geforce 610M 在使用 optirun:

调用时无法工作
ziga@ziga-laptop:~$ optirun glxinfo | grep OpenGL
primus: fatal: failed to load any of the libraries: /usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1:/usr/lib/i386-linux-gnu/nvidia/libGL.so.1:/usr/lib/nvidia/libGL.so.1
/usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1: cannot open shared object file: No such file or directory
/usr/lib/i386-linux-gnu/nvidia/libGL.so.1: wrong ELF class: ELFCLASS32
/usr/lib/nvidia/libGL.so.1: cannot open shared object file: No such file or directory

如果我使用 apt 搜索我的卡,我会得到:

ziga@ziga-laptop:~$ sudo apt search 610M
Sorting... Done
Full Text Search... Done
nvidia-legacy-304xx-driver/stable 304.137-5~deb9u1 amd64
  NVIDIA metapackage (304xx legacy version)

nvidia-legacy-304xx-kernel-dkms/stable 304.137-5~deb9u1 amd64
  NVIDIA binary kernel module DKMS source (304xx legacy version)

nvidia-legacy-304xx-kernel-source/stable 304.137-5~deb9u1 i386
  NVIDIA binary kernel module source (304xx legacy version)

xserver-xorg-video-nvidia-legacy-304xx/stable 304.137-5~deb9u1 amd64
  NVIDIA binary Xorg driver (304xx legacy version)

从这里我会安装 nvidia-legacy-304xx-driver 但我担心这不能很好地与我上面安装的其他软件包一起使用。有没有可能我还需要xserver-xorg-video-nvidia-legacy-304xx

任何人都可以向我解释要安装哪些软件包以及为什么?


好吧,我等不及了,我尝试安装 xserver-xorg-video-nvidia-legacy-304xx。看起来这个包确实与 bumblebee-nvidia 包冲突。安装后我得到了这个:

nvidia-legacy-304xx:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.9.0-8-amd64/updates/dkms/

depmod...

DKMS: install completed.
Setting up nvidia-legacy-304xx-driver (304.137-5~deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for glx-alternative-nvidia (0.8.3~deb9u1) ...
Processing triggers for menu (2.1.47+b1) ...
Processing triggers for update-glx (0.8.3~deb9u1) ...
Processing triggers for glx-alternative-nvidia (0.8.3~deb9u1) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/nvidia/bumblebee because link group glx is broken
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for initramfs-tools (0.130) ...
update-initramfs: Generating /boot/initrd.img-4.9.0-8-amd64
Processing triggers for bumblebee (3.2.1-14) ...

我卸载了 xserver-xorg-video-nvidia-legacy-304xx 并尝试安装 nvidia-legacy-304xx-driver 软件包,同时也安装了 xserver-xorg-video-nvidia-legacy-304xx 软件包。它没有返回任何警告和错误,但在重新启动后 optirun glxinfo | grep OpenGL 命令仍然失败...

看起来即使在应该稳定的 Debian 上也没有解决这个问题?


就像@Antonio Orizondo Leyva sugested 我安装了他建议的软件包并执行了命令 sudo update-alternatives --config glx 我必须为我的 GPU 选择不同的选项:

There are 3 choices for the alternative glx (providing /usr/lib/glx).

  Selection    Path                       Priority   Status
------------------------------------------------------------
  0            /usr/lib/nvidia/bumblebee   125       auto mode
  1            /usr/lib/mesa-diverted      5         manual mode
  2            /usr/lib/nvidia             100       manual mode
* 3            /usr/lib/nvidia/bumblebee   125       manual mode

Press <enter> to keep the current choice[*], or type selection number: 

我尝试选择其中的每一个然后重新启动,但最终结果是一样的...除了第二个选项 (nvidia),它在重新启动后说找不到 openGL.1.so 之类的……所以甚至连 Nvidia 卡都不能单独使用!?

还有其他想法吗?

我在使用 GTX 1050 时遇到了一些类似的问题。
我认为您可以绕过 nvidia-detect 命令,所以这就是我在 Debian Buster 64 位 内核 4.17:

上所做的
  1. 执行

    apt install bumblebee-nvidia linux-headers-$(uname -r)
    

    这应该安装 nvidia-driverbbswitch-dkmsblacklist,它们在 /etc/modprobe.d 中是需要的。您需要 运行 内核的 headers 来添加新模块(bbswithnvidia*,在我的例子中是 nvidia-current)。

不需要添加 i386 arch 并且一切正常,请检查您使用的 glx 提供程序

update-alternatives --config glx

将其设置为 nvidia 以外的任何选项,重新启动显示管理器并再次测试。

看完this Debian bug report I realized that I ought to install package libgl1-nvidia-glx. This fixed my problems, but I have to criticize Debian for this, because on their official Bumblebee webpage据说要用这个命令安装:

sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install bumblebee-nvidia primus primus-libs:i386 libgl1-nvidia-glx:i386

但是此命令缺少关键的 libgl1-nvidia-glx,需要将其与其 i386 组件一起安装才能使所有 ap 正常工作!

引用 Debian 的话:

While you are the best distribution on this planet and you seem to be the most stable, make sure to keep your official Wiki updated like Arch does! Only like this your users won't have negative experiances like I did and more will choose your distribution.