nvidia驱动安装之后,nvidia-smi 报错 Driver/library version mismatch 不重启系统的解决方法
查看系统日志,确定具体报错信息:
# dmesg | tail
[8598493.408944] NVRM: API mismatch: the client has the version 525.125.06, but
NVRM: this kernel module has the version 525.105.17. Please
NVRM: make sure that this kernel module and all NVIDIA driver
NVRM: components have the same version.
nvidia驱动安装的版本出现冲突,一般就是没有卸载干净之前的驱动导致的,系统已加载的驱动模块和安装的驱动版本不一致导致运行出错,如果可以重启系统,直接reboot基本就可以解决问题
如诺不想重启电脑,就需要查看当前系统已加载module的版本,先卸载,再重新安装驱动
ray@ubt20: /home/ray$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 525.105.17 Tue Mar 28 18:02:59 UTC 2023
GCC version: gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
ray@ubt20: /home/ray$ cat /sys/module/nvidia/version
525.105.17
ray@ubt20: /home/ray$ dkms status | more
nvidia, 525.125.06, 5.4.0-139-generic, x86_64: installed
ray@ubt20: /home/ray$ dkms status nvidia
nvidia, 525.125.06, 5.4.0-139-generic, x86_64: installed
我要安装的版本是525.105.17但是系统已加载的驱动模块版本是525.125.06
卸载移除系统模块
sudo dkms remove nvidia/525.125.06 --all
卸载成功后,重新再安装一边nvidia驱动
sudo bash ./NVIDIA-Linux-x86_64-525.105.17.run