nv驱动安装笔记

问题:Ubuntu20.04出现Failed to initialize NVML: Driver/library version mismatch问题

原因:https://blog.csdn.net/ccsodefhy/article/details/122846921
解决方案:

(1) 笔者是这个方法解决的

  1. 删除驱动:sudo apt-get remove --purge nvidia*
  2. 自动安装:sudo ubuntu-drivers autoinstall

就这两步即可,如不行,把后面的看完,看指定的参考网站再行动。

(2) 其他方法

删除驱动:sudo apt-get remove --purge nvidia*
安装驱动:

# 列出设备,显示的model是显卡型号,driver是可选的驱动
ubuntu-drivers devices

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002504sv00001458sd00004072bc03sc00i00
vendor   : NVIDIA Corporation
model    : GA106 [GeForce RTX 3060 Lite Hash Rate]
manual_install: True
driver   : nvidia-driver-470-server - distro non-free
driver   : nvidia-driver-515-server - distro non-free
driver   : nvidia-driver-510-server - distro non-free
driver   : nvidia-driver-470 - distro non-free
driver   : nvidia-driver-510 - distro non-free
driver   : nvidia-driver-520 - distro non-free
driver   : nvidia-driver-515-open - distro non-free
driver   : nvidia-driver-520-open - distro non-free recommended
driver   : nvidia-driver-515 - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

# 安装其中 recommended 一个驱动
sudo apt install  nvidia-driver-520-open
sudo reboot

然后再锁定驱动和固件:

dpkg -l | grep -i nvidia
sudo apt-mark hold 

参考:
卸载驱动:https://blog.csdn.net/weixin_43994864/article/details/116143207
安装驱动:https://blog.51cto.com/u_4029519/5909904
锁定驱动固件:https://www.volcengine.com/theme/2267486-J-7-1

最后完全卸载,然后安装驱动链接里第一种方法可以成功。

你可能感兴趣的:(深度学习,工程技术,nvidia,驱动,ubuntu20.04)