欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

buntu18.04 NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure t

程序员文章站 2022-03-23 16:45:50
...

Ubuntu18.04 NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

问题描述

某一天使用nvidia-smi查看GPU,突然报错:
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
可是之前跑程序没有问题。检查以后发现是generic发生了更改。检查的命令:

sudo dpkg --get-selections |grep linux-image

可以看到新出现三个install
buntu18.04 NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure t

解决方法:重新装driver

最好装与之前相同版本的driver。
之前的版本我放在了Downloads/文件夹下。
首先禁用图形界面:

sudo systemctl set-default multi-user.target

buntu18.04 NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure t
然后转到Downloads/下

cd Downloads/

我的driver版本是430.14

sudo bash NVIDIA-Linux-x86_64-430.14.run -no-opengl-files -no-x-check -no-nouveau-check

然后后面的选项一般都选no。
安装完后再输入nvidia-smi就发现可以连接了。
最后重启图像界面

sudo systemctl set-default graphical.target

搞定!