1. Uninstall the original driver
sudo apt remove *cuda*
sudo apt remove *nvidia*
sudo /usr/bin/nvidia-uninstall
sudo dpkg -l | grep ^rc | cut -d' ' -f3 | sudo xargs dpkg --purge
sudo rm -rf ~/.cuda-license-*
sudo apt purge nvidia-cuda-toolkit
sudo apt remove nvidia-driver-*
sudo apt purge nvidia-*
2. Disable nouveau driver
Modify /etc/modprobe.d/blacklist.conf
, it is best to add the following code
blacklist nouveau
options nouveau modeset=0
Execute the command sudo update-initramfs -u
after restarting lsmod | grep nouveau
. If no display is displayed, the disablement is successful.
3. Download and install the driver
download
sudo wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run
Install
sudo sh cuda_11.7.0_515.43.04_linux.run
Enter accept
to confirm
and select Install
Install
Check
nvcc -V
nvidia-smi
other
Docker runs specified runtime=nvidia and reports an error
unknown or invalid runtime name: nvidia
Possible Causes
Not Installednvidia-container-runtime
solution
Perform installation nvidia-container-runtime
sudo apt install nvidia-container-runtime
Modify/etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://registry.docker-cn.com"
],
"runtimes": {
"nvidia": {
"args": [],
"path": "nvidia-container-runtime"
}
}
}
Restart docker
sudo systemctl daemon-reload
sudo systemctl restart docker