
我想使用筆記型電腦上的獨立顯示卡玩遊戲。我不關心英特爾顯示卡 - 我只想只使用 NVidia。
$ nvidia-smi
Mon Mar 23 20:40:58 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00 Driver Version: 440.64.00 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 860M On | 00000000:01:00.0 Off | N/A |
| N/A 47C P8 N/A / N/A | 0MiB / 4046MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
$ glxinfo |grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.2.8
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 19.2.8
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 19.2.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
$ lspci | grep NVIDIA
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev a2)
出於絕望,我安裝了 bbswitch,即使我將其關閉,它也顯示為 ON。
root@eevee-G551JM:/home/adam # cat /proc/acpi/bbswitch
0000:01:00.0 ON
root@eevee-G551JM:/home/adam # tee /proc/acpi/bbswitch <<<OFF
OFF
root@eevee-G551JM:/home/adam # cat /proc/acpi/bbswitch
0000:01:00.0 ON
root@eevee-G551JM:/home/adam # prime-select query
nvidia
我曾經在這台機器上配置過 bumblebee,但它不再正常工作(刪除它不會影響渲染)。
root@eevee-G551JM:/home/adam # service bumblebeed stop
root@eevee-G551JM:/home/adam # bumblebeed
[ 821.692186] [INFO]bumblebeed 3.2.1 started
[ 821.692614] [ERROR]Failed to unload module 'nvidia' (ref count: 15).
^C[ 882.413474] [WARN]Received Interrupt signal.
root@eevee-G551JM:/home/adam 5 # service bumblebeed start
root@eevee-G551JM:/home/adam # service bumblebeed status
● bumblebeed.service - Bumblebee C Daemon
Loaded: loaded (/lib/systemd/system/bumblebeed.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-03-23 20:52:34 CET; 1s ago
Main PID: 10898 (bumblebeed)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/bumblebeed.service
└─10898 /usr/sbin/bumblebeed
Mar 23 20:52:34 eevee-G551JM systemd[1]: Started Bumblebee C Daemon.
Mar 23 20:52:34 eevee-G551JM bumblebeed[10898]: [ 903.313579] [INFO]/usr/sbin/bumblebeed 3.2.1 started
Mar 23 20:52:34 eevee-G551JM bumblebeed[10898]: [ 903.314010] [ERROR]Failed to unload module 'nvidia' (ref count: 15).
root@eevee-G551JM:/home/adam # apt install xserver-xorg-video-nvidia-440
Reading package lists... Done
Building dependency tree
Reading state information... Done
xserver-xorg-video-nvidia-440 is already the newest version (440.64.00-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ cd /etc/modprobe.d/
$ ag nvidia
blacklist-framebuffer.conf
19:blacklist nvidiafb
bumblebee.conf
5:# do not automatically load nouveau as it may prevent nvidia from loading
7:# do not automatically load nvidia as it's unloaded anyway when bumblebeed
10:blacklist nvidia
11:blacklist nvidia-current
12:blacklist nvidia-legacy-304xx
13:blacklist nvidia-legacy-340xx
15:blacklist nvidia
16:blacklist nvidia-current
17:blacklist nvidia-current-updates
...
root@eevee-G551JM:/etc/modprobe.d # cat /etc/modules
i915
bbswitch
$ cat /etc/bumblebee/bumblebee.conf
[bumblebeed]
VirtualDisplay=:8
KeepUnusedXServer=false
ServerGroup=bumblebee
TurnCardOffAtExit=false
NoEcoModeOverride=false
Driver=
XorgConfDir=/etc/bumblebee/xorg.conf.d
XorgBinary=/usr/lib/xorg/Xorg
[optirun]
Bridge=auto
VGLTransport=proxy
PrimusLibraryPath=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
AllowFallbackToIGC=false
[driver-nvidia]
KernelDriver=nvidia
PMMethod=auto
LibraryPath=/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu
XorgModulePath=/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/xorg/modules/input
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia
[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.nouveau
有人可以解釋一下,怎麼會nvidia-smi
看到顯示卡,但 xorg 不使用它?非常有趣的是,這首先是可能的,但是如何將系統恢復到所有圖形均由 nvidia 渲染時的狀態(或者更好的是,bumblebee 工作)?
答案1
glxinfo 是一個 mesa 實用程序,mesa 是 Intel、Amd、VMware 和 Raspbery PI 的 GPU 驅動程式。因此,它僅提供有關這些 GPU 的資訊。
答案2
這可能與Nvidia 點播設定檔(特別是如果您使用的是外部顯示器)。將設定檔切換到Nvidia(效能模式)為nvidia-settings
我解決了同樣的問題。
從我拿走的NVIDIA X 伺服器設定中的 NVIDIA 按需選項如何運作?,該On-Demand
設定檔允許 Nvidia 動態切換,但僅限於筆記型電腦螢幕,而使用Performance Mode
Nvidia 渲染所有內容並在外部顯示器上工作。