我已经发布这几天前我遇到了一个问题。
我尝试通过从 NVIDIA 官方网站下载驱动程序以及通过附加驱动程序应用程序或ubuntu-driver autoinstall
命令重新安装驱动程序来重新安装它,但都没有解决问题。我可以毫无错误地安装它们,但重启后我遇到了一些问题(当 PRIME 配置文件是按需时)。现在nvidia-smi
不起作用:
┌──(root
答案1
我遇到了类似的症状,/dev/nvidia
但不存在,lsmod | grep nvidia
什么也没有返回。而且 nvidia-persistenced 无法启动。
Failed to query NVIDIA devices. Please ensure that the NVIDIA device files (/dev/nvidia*) exist, and that user 119 has read and write permissions for those files.
我尝试使用--reinstall
选项重新安装我的 nvidia-driver 包。系统要求我重新配置 dpkg。然后发生了以下情况:
$ sudo apt-get install --reinstall nvidia-driver
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
$ sudo dpkg --configure -a
Setting up nvidia-driver-bin (470.182.03-1) ...
Setting up libcuda1:amd64 (470.182.03-1) ...
Setting up libnvidia-cfg1:amd64 (470.182.03-1) ...
Setting up nvidia-egl-icd:amd64 (470.182.03-1) ...
Setting up libglx-nvidia0:amd64 (470.182.03-1) ...
Setting up nvidia-kernel-support (470.182.03-1) ...
Setting up xserver-xorg-video-nvidia (470.182.03-1) ...
Setting up nvidia-vulkan-icd:amd64 (470.182.03-1) ...
Setting up nvidia-vdpau-driver:amd64 (470.182.03-1) ...
Setting up libgl1-nvidia-glvnd-glx:amd64 (470.182.03-1) ...
Setting up nvidia-kernel-dkms (470.182.03-1) ...
Loading new nvidia-current-470.182.03 DKMS files...
Building for 5.10.0-22-amd64
Building initial module for 5.10.0-22-amd64
Done.
nvidia-current.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.10.0-22-amd64/updates/dkms/
nvidia-current-modeset.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.10.0-22-amd64/updates/dkms/
nvidia-current-drm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.10.0-22-amd64/updates/dkms/
nvidia-current-uvm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.10.0-22-amd64/updates/dkms/
nvidia-current-peermem.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.10.0-22-amd64/updates/dkms/
depmod...
DKMS: install completed.
Setting up nvidia-smi (470.182.03-1) ...
Setting up nvidia-driver-libs:amd64 (470.182.03-1) ...
Setting up libnvcuvid1:amd64 (470.182.03-1) ...
Setting up nvidia-driver (470.182.03-1) ...
Setting up libnvidia-encode1:amd64 (470.182.03-1) ...
Processing triggers for glx-alternative-mesa (1.2.1~deb11u1) ...
Processing triggers for glx-alternative-nvidia (1.2.1~deb11u1) ...
Processing triggers for libc-bin (2.31-13+deb11u6) ...
Processing triggers for update-glx (1.2.1~deb11u1) ...
Processing triggers for glx-alternative-nvidia (1.2.1~deb11u1) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/nvidia because link group glx is broken
Processing triggers for libc-bin (2.31-13+deb11u6) ...
Processing triggers for initramfs-tools (0.140) ...
update-initramfs: Generating /boot/initrd.img-5.10.0-22-amd64
重启后,nvidia 工作正常。不过要注意:我是在 Debian 上做的,但该解决方案的性质预计也适用于 Ubuntu 系统。
我个人不建议按照建议手动安装驱动程序 *.run 文件这里因为您会错过驱动程序更新。