sudo apt-get --purge remove nvidia*
sudo apt autoremove
sudo apt-get remove --purge nvidia-\*
安装
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo apt-cache search nvidia
查看推荐版本
ubuntu-drivers devices
sudo apt-get install nvidia-415 nvidia-settings nvidia-prime
或者采用官网下载run文件的方式
https://www.nvidia.cn/Download/index.aspx?lang=cn
# 给安装文件赋予执行权限
sudo chmod a+x NVIDIA-Linux-x86_64-410.129-diagnostic.run
# 安装
sudo ./NVIDIA-Linux-x86_64-410.129-diagnostic.run -no-x-check -no-nouveau-check -no-opengl-files
# 挂载Nvidia 驱动
modprobe nvidia
# 检查是否安装成功
nvidia-smi
# 重启
reboot
安装完
输入
nvidia-smi
可能会报这个错误:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
一般来说,重启就ok了,因为安装过程没有报错的话,就基本没有问题了