我正在使用 Ubuntu Studio 20.04 LTS,并试图为视频游戏(FlightGear)获得更高的性能。根据lspci
,我的 Acer TravelMate 5360 上有两个 GPU:
~$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF119M [GeForce GT 520M] (rev a1)
但nvidia
驱动程序似乎不起作用:
~$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
~$ nvidia-settings
ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system
(nvidia-settings:10198): GLib-GObject-CRITICAL **: 15:41:24.368: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 15:41:24.374: PRIME: Requires offloading
** Message: 15:41:24.374: PRIME: is it supported? yes
** Message: 15:41:24.467: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 15:41:24.467: PRIME: on-demand mode: "1"
** Message: 15:41:24.467: PRIME: is "on-demand" mode supported? yes
我尝试手动激活 nvidia 驱动程序:
~$ sudo modprobe nvidia
modprobe: ERROR: could not insert 'nvidia': No such device
~$ sudo modprobe nvidia_drm
~$ dmesg
[...]
[ 266.952607] nvidia-nvlink: Nvlink Core is being initialized, major device number 235
[ 266.955482] NVRM: The NVIDIA GeForce GT 520M GPU installed in this system is
NVRM: supported through the NVIDIA 390.xx Legacy drivers. Please
NVRM: visit http://www.nvidia.com/object/unix.html for more
NVRM: information. The 470.57.02 NVIDIA driver will ignore
NVRM: this GPU. Continuing probe...
[ 266.955489] NVRM: No NVIDIA GPU found.
[ 266.955719] nvidia-nvlink: Unregistered the Nvlink Core, major device number 235
根据消息中指定的网站dmesg
,我的 GPU 仅支持到 390 版本。但安装该版本会使我的屏幕变黑,而启动时应该会出现登录屏幕。现在,我安装了最新版本 (470)。我该怎么办?
编辑:我尝试了答案中的所有解决方案这个问题, 但没有一个有帮助。我还尝试重新安装 390 nvidia 驱动程序 - 我再次看到黑色登录屏幕。有趣的是,当我nomodeset
在 Grub 中添加内核启动参数时,我得到了登录屏幕,之后也得到了桌面。nvidia-smi
然后显示预期的输出:
~$ nvidia-smi
Mon Jul 26 20:04:29 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.144 Driver Version: 390.144 |
|-------------------------------+----------------------+----------------------+
| 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 GT 520M Off | 00000000:01:00.0 N/A | N/A |
| N/A 56C P8 N/A / N/A | 4MiB / 964MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+
但 nvidia-settings 仍然显示:
ERROR: Unable to load info from any available system
(nvidia-settings:10198): GLib-GObject-CRITICAL **: 15:41:24.368: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 15:41:24.374: PRIME: Requires offloading
** Message: 15:41:24.374: PRIME: is it supported? yes
** Message: 15:41:24.467: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 15:41:24.467: PRIME: on-demand mode: "1"
** Message: 15:41:24.467: PRIME: is "on-demand" mode supported? yes
并且只有一个页面PRIME profile
可用。另外,我根本无法调整屏幕亮度(xrandr
,xbacklight
backlightctl
)——一切都无济于事。