有一个类似的问题,我一直在 askubuntu 上关注这个答案:https ://askubuntu.com/a/1158183/254943 。这个解决方案完全符合我的要求。可悲的是,在最近的更新之后,该解决方案停止工作,Xorg 现在再次使用 nvidia。
- | NVIDIA-SMI 450.66 驱动程序版本:450.66 CUDA 版本:11.0 |
- Linux XXX 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
- 等离子壳 5.18.5 | Qt:5.12.8 | KDE 框架:5.68.0 | kf5-配置:1.0
$ cat /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf
# DO NOT EDIT. AUTOMATICALLY GENERATED BY gpu-manager
Section "OutputClass"
Identifier "Nvidia Prime"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowEmptyInitialConfiguration"
Option "IgnoreDisplayDevices" "CRT"
# Option "PrimaryGPU" "Yes" <<< commented out
ModulePath "/x86_64-linux-gnu/nvidia/xorg"
EndSection
# added
Section "OutputClass"
Identifier "intel"
MatchDriver "i915"
Driver "modesetting"
Option "PrimaryGPU" "yes"
EndSection
我试图自己调试它,但我无法修复它。
$ nvidia-smi # shows running process /usr/lib/xorg/Xorg
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.66 Driver Version: 450.66 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 105... Off | 00000000:01:00.0 Off | N/A |
| N/A 50C P8 N/A / N/A | 6MiB / 4040MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1257 G /usr/lib/xorg/Xorg 4MiB |
+-----------------------------------------------------------------------------+
我想已经想通了。首先,我重新移动了 10-nvidia.conf 文件。相反,我添加了一个 10-intel.conf。然后我把 11-nvidia-prime.conf 的每一行都注释掉了,它基本上是一个空文件。由于此文件在 xserver 的每次启动/停止时都会创建/覆盖,因此需要使用
chattr +i