我在带有 GM107M (GeForce GTX 960M) 的 Ubuntu/20.04 上:
$ sudo lshw -class video
*-display
description: 3D controller
product: GM107M [GeForce GTX 960M]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:02:00.0
version: a2
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list rom
configuration: driver=nouveau latency=0
resources: irq:136 memory:de000000-deffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:df000000-df07ffff
*-display
description: VGA compatible controller
product: HD Graphics 530
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 06
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:135 memory:dd000000-ddffffff memory:b0000000-bfffffff ioport:f000(size=64) memory:c0000-dffff
我已经安装了 nouveau 驱动程序,没有问题:
$ lspci -k | grep -A 2 -E "(VGA|3D)"
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
DeviceName: Onboard IGD
Subsystem: Dell HD Graphics 530
--
02:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)
Subsystem: Dell GM107M [GeForce GTX 960M]
Kernel driver in use: nouveau
然而,我感到困惑的是,似乎根本没有任何东西使用 nouveau 驱动程序:
$ glxinfo | grep OpenGL
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 530 (SKL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.1.7 - kisak-mesa PPA
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.1.7 - kisak-mesa PPA
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.1.7 - kisak-mesa PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
我如何强制使用 nvidia 卡而不是 Intel 卡来渲染 3D?
提前致谢
附言:哦,相信我,我试过使用专有的 nvidia 驱动程序……挣扎了好几天,甚至将我的内核升级到 5.8.5 也没有取得多大成功。至少 x 在安装 nouveau 时启动了,因此我现在会坚持使用 nouveau。