输入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
解决办法(最简单):
sudo apt install dkms
sudo dkms install -m nvidia -v 418.87.00
reboot重启系统,nvidia-smi查看
其中,418.87.00 是之前成功安装的nvidia 驱动的版本号,你需要换成自己的。
可通过下面方法查到:
ls /usr/src | grep nvidia
遇到类似错误解决思路:
- 可能是不经意间执行了sudo apt-get upgrade 升级了内核,导致内核和驱动不匹配,可以更换初始内核尝试,或者重装显卡驱动
- Linux自动更新升级内核,可通过下面命令关闭:
sudo gedit etc/apt/apt.conf.d/10periodic
将所有值改为0