nvidia-smi 可以工作,但 glxinfo 显示 OpenGL 使用英特尔显卡;Ubuntu 18.04

nvidia-smi 可以工作,但 glxinfo 显示 OpenGL 使用英特尔显卡;Ubuntu 18.04

我想使用笔记本上的独立显卡玩游戏。我不关心英特尔显卡 - 我只想使用 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

我曾经在这台机器上配置了大黄蜂,但它不再正常运行(并且删除它不会影响渲染)。

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-smixorg 可以看到显卡,却不使用它?首先,这种情况是可能的,这很有趣,但是如何将系统恢复到所有图形都由 nvidia 渲染的状态(或者更好的是,让 bumblebee 正常工作)?

答案1

glxinfo 是一个 mesa 实用程序,mesa 是 Intel、Amd、VMware 和 Raspbery PI 的 GPU 驱动程序。因此它仅提供有关这些 GPU 的信息。

答案2

这可能与Nvidia 按需配置文件(尤其是当您使用外接显示器时)。将配置文件切换为Nvidia(性能模式)nvidia-settings我解决了同样的问题。

从我所学到的NVIDIA On-Demand 选项在 NVIDIA X 服务器设置中如何工作?,该On-Demand配置文件允许动态切换Nvidia,但它仅限于笔记本电脑屏幕,而使用Performance ModeNvidia来渲染所有内容并在外接显示器上工作。

相关内容