Last Updated on 2021-06-07 by Clay
Problem
I have had the same problem twice when I installing the Nvidia driver. The first time only me in server so the environment is purely, but the next time I have more partner in server, environment is much more complicated than the first time.
I spend more time than the first time, so I think I need to note how to solve it prevent I have this problem again.
Today, I use the following command to check my GPU state:
nvidia-smi
But the return information tell me the GPU driver is disappear (Occasionally this happens), I want to install it again.
So I use the command to do it:
sudo sh NVIDIA-Linux-x86_64-440.64.run
But I got a bad news:
An NVIDIA kernel module 'nvidia-drm' appears to already be loaded in your kernel...
It seems I want to install a CUDA driver when I use GPU to startup the X-Window. If I want to solved it, I need to stop my GPU.
Solution 1: Remove Nvidia driver
We can use the following instructions to remove the Nvidia driver:
sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo reboot
After rebooting, we can install the driver again.
Solution 2: Stop all processes use GPU
First, we need Super User authority.
sudo -i
And close all the processes use GPU, and disable nvidia driver:
systemctl isolate multi-user.target
modprobe -r nvidia-drm
And then we can reinstall the GPU driver.