由于内核升级,我一直在努力安装 NVIDIA 驱动程序。
我将 Ubuntu 20.04 上的内核从 5.13 更新到了 5.16,因为原来的内核无法识别 wifi 和蓝牙适配器。我使用了本手册。此后,我的 NVIDIA 驱动程序消失了,从那时起我一直试图找回它,但没有成功。
没有成功
意味着安装完成,但没有设置 smi 和 nvidia-settings。
以下是我迄今为止尝试过的:
首先,我尝试清除 NVIDIA 的所有内容,重新安装了很多次,安装了不同的版本等等。最终都是这样的:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
然后我读到可能是内核头不存在或未正确安装。我检查过
dpkg-query -s linux-headers-generic
:Package: linux-headers-generic Status: install ok installed Priority:optional Section: kernel Installed-Size: 19 Maintainer: Ubuntu Kernel Team <[email protected]> Architecture: amd64 Source: linux-meta Version: 5.4.0.117.120 Depends: linux-headers-5.4.0-117-generic Description: Generic Linux kernel headers This package will always depend on the latest generic kernel headers available.
很奇怪,因为我在内核上运行:5.16.0-051600rc5-generic
然后我用这个命令检查
apt list linux-headers*
::Listing... Error! E: input:0-68: error: Expected pattern linux-headers-5.16.0-051600rc5_5.16.0-051600rc5.202112121931_all.deb
然后我尝试安装相关的标题
sudo apt-get install linux-headers-$(uname -r)
:Reading package lists... Done Building dependency tree Reading state information... Done Package linux-headers-5.16.0-051600rc5-generic is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'linux-headers-5.16.0-051600rc5-generic' has no installation candidate
此外,如果我运行这个,
sudo apt-get install linux-headers-generic
我会得到:Reading package lists... Done Building dependency tree Reading state information... Done linux-headers-generic is already the newest version (5.4.0.117.120). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
但我没有运行该内核。
dkms status
:
backport-iwlwifi, 8324: added
nvidia, 510.73.08: added
rtbth, 3.9.7, 5.13.0-48-generic, x86_64: installed
rtbth, 3.9.7, 5.4.0-117-generic, x86_64: installed
rtl8812au, 4.3.8.12175.20140902+dfsg, 5.13.0-44-generic, x86_64: installed
rtl8812au, 4.3.8.12175.20140902+dfsg, 5.13.0-48-generic, x86_64: installed
rtl8812au, 4.3.8.12175.20140902+dfsg, 5.16.0-051600rc5-generic, x86_64: installed
rtl88x2bu, 5.8.7.1, 5.13.0-44-generic, x86_64: installed
rtl88x2bu, 5.8.7.1, 5.13.0-48-generic, x86_64: installed
rtl88x2bu, 5.8.7.1, 5.4.0-117-generic, x86_64: installed
如果我sudo nvidia-settings
在安装驱动程序后运行,我会得到以下信息:
ERROR: NVIDIA driver is not loaded
(nvidia-settings:4568): GLib-GObject-CRITICAL **: 12:23:00.499: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** (nvidia-settings:4568): CRITICAL **: 12:23:00.499: ctk_powermode_new: assertion '(ctrl_target != NULL) && (ctrl_target->h != NULL)' failed
ERROR: nvidia-settings could not find the registry key file or the X server is not accessible. This file should have been installed along with this driver at
/usr/share/nvidia/nvidia-application-profiles-key-documentation. The application profiles will continue to work, but values cannot be prepopulated or validated,
and will not be listed in the help text. Please see the README for possible values and descriptions.
我也尝试过这和一堆其他的巫术,但我还是在同一个地方。我觉得我安装内核和头文件的方式有问题。我也尝试过同样的事情,但最终还是出现了同样的问题。