After the server updates the NVIDIA driver version, it often appears
Failed to initialize NVML: Driver/library version mismatch
The reason for this problem is that the nvidiadriver version of kernel mod has not been updated
1. Generally, restarting the machine can solve the problem
2. If it can’t be restarted for some reasons, there is also a way to reload kernel mod
In short, there are only two steps
unload nvidiakernel mod
reload nvidia kernel mod
It’s all about execution
sudo rmmod nvidia
sudo nvidia-smi
NVIDIA SMI found that no kernel mod would load it automatically
But things are far from that simple, generally will encounter uninstall failure
$ sudo rmmod nvidia
rmmod: ERROR: Module nvidia is in use by: nvidia_modeset nvidia_uvm
At this time, we need to unload the whole driver bit by bit. First, we need to know the dependency of kernel mod. First, we know from the error message that NVIDIA_ modeset nvidia_ UVM these two mods depend on NVIDIA, so you need to uninstall them first
$lsmod | grep nvidia
nvidia_uvm 647168 0
nvidia_drm 53248 0
nvidia_modeset 790528 1 nvidia_drm
nvidia 12144640 152 nvidia_modeset,nvidia_uvm 12144640 152 nvidia_modeset,nvidia_uvm
As you can see, NVIDIA has 152 words. We can unload NVIDIA first_ UVM and NVIDIA_ modeset
Let’s see which processes use NVIDIA first*
sudo lsof -n -w /dev/nvidia*
I have an understanding of these processes. If the uninstall fails later, remember to close the related processes
Uninstall NVIDIA_ uvm , nvidia_ modeset
sudo rmmod nvidia_uvm
sudo rmmod nvidia_modeset
Then in losf, if NVIDIA’s use by has not dropped to 0, kill the related process. Then perform the relevant unload operation
Finally
sudo rmmod nvidia
nvidia-smi
Similar Posts:
- [Solved] NVIDIA SMI instruction error: failed to initialize nvml: Driver
- [Solved] nvidia-smi Error: Failed to initialize NVML: Driver/library version mismatch
- Solution to NVIDIA driver problem: failed to initialize nvml: Driver / library version mismatch
- Solutions to the phenomena of / dev / sda2 clean and / dev / sda2 recovering journal when starting Ubuntu
- [Solved] docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]].
- [Solved] Ubuntu gnome 17.04 error: kernel BUG at /build/linux-7LGLH_/linux-4.10.0/include/linux/swapops.h:129
- [Solved] dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
- [Solved] Ubuntu Warning: The system is running in low-graphics mode
- InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runti…
- [Solved] after installing Ubuntu 16.04, you cannot enter the graphical interface after restarting (error/dev/sda2: clean…)