ubuntu: NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver.
centos: NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver.

重启服务器之后就出现连接不上NVIDIA驱动的情况。

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 驱动的版本号

ls -l /usr/src/

输出
在这里插入图片描述
输入

sudo dkms install -m nvidia -v 440.95.01

输出报错:
在这里插入图片描述
有可能是 nouveau模块没有禁用

  • 打开如下文件:vim /usr/lib/modprobe.d/dist-blacklist.conf
    新增以下两行内容:
blacklist nouveau
options nouveau modeset=0
  • 备份当前的镜像:mv /boot/initramfs- ( u n a m e − r ) . i m g / b o o t / i n i t r a m f s − (uname -r).img /boot/initramfs- (unamer).img/boot/initramfs(uname -r).img.bak
  • 建立新的镜像:dracut /boot/initramfs-$(uname -r).img $(uname -r)、
  • 然后重启 sudo reboot

再输入nvidia-smi
在这里插入图片描述
问题解决

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐