转载:https://askubuntu.com/questions/1248109/nvml-driver-library-mismatch-after-libnvidia-update
问题:
在某个时间,突然发现显卡不能用了,输入nvidia-smi显示:
Failed to initialize NVML: Driver/library version mismatch
原因:
dmesg |tail -4
使用此命令,会发现报错原因
NVRM: API mismatch: the client has the version 450.102.04, but
NVRM: this kernel module has the version 440.80.02. Please
NVRM: make sure that this kernel module and all NVIDIA driver
NVRM: components have the same version.
也就是libnvidia-compute-450的包已经是102版本了,但驱动还是80,导致版本不匹配
vi /var/log/apt/history.log
使用此命令,能看到更新时间和命令,发现是自动更新时导致的libnvidia-compute-450 package升级
Start-Date: 2021-01-21 06:47:07
Commandline: /usr/bin/unattended-upgrade
Upgrade: libnvidia-compute-450-server:amd64 (450.80.02-0ubuntu0.18.04.3, 450.102.04-0ubuntu0.18.04.1)
End-Date: 2021-01-21 06:47:10
解决:
网上很多人说重启就行了,然而我这里并不行,最终解决办法是:
sudo apt install nvidia-driver-450
然后再重启
sudo reboot
解决啦~~