NVML: Driver/library version mismatch
Need to unload the the Nvidia driver kernel module (kmod) and then load it again as the current version is wrong.
lsmod | grep nvidia
nvidia_uvm 634880 8
nvidia_drm 53248 0
nvidia_modeset 790528 1 nvidia_drm
nvidia 12312576 86 nvidia_modeset,nvidia_uvm
We need to unload nvidia
mod, so first unload everything
that it depends on:
sudo rmmod nvidia_drm
sudo rmmod nvidia_modeset
sudo rmmod nvidia_uvm
then, unload nvidia
sudo rmmod nvidia
The previous steps will most likely result in
ERROR: Module nvidia is in use
,
which indicates that the kernel module is in use, you should kill the process that using the kmod:
sudo lsof /dev/nvidia*
Kill the processes:
sudo kill <PID>
Confirm you can successfully unload those kmods:
lsmod | grep nvidia
The output of the above command should be empty.
Then run (should work):
nvidia-smi
To make sure there is only one version of nvidia-drivers installed:
Remove everything that is not required (all libraries with 440, 390 etc):
Let ubuntu pick the best driver: