解决NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver

环境

- 笔记本型号:Dell precision 5520
- 显卡型号:M1200
- 系统:Ubuntu 20.04

问题

安装好N卡驱动后,执行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.

解决方案

方案1

原因:系统内核升级,导致新版本内核和原来显卡驱动不匹配
解决方案:使用dkms生成对应的内核文件

  • 查看驱动版本
ls /usr/src | grep nvidia

例如我得到的结果是nvidia-470.103.01

  • 匹配
sudo apt-get install dkms
sudo dkms install -m nvidia -v 470.103.01

方案2

原因:与方案1相同
解决方案:使用就内核登录,参考这里。然后设置默认使用就内核启动。

方案3(work for me)

原因:bios的secure boot处于enable状态
解决方案:进入bios(一般是开机按F2),关闭secure boot
强烈建议:即使你的secure boot已经处于disable,建议执行一次:enable,重启,disable,再重启。(我就是这种情况,好迷惑!!)

猜你喜欢

转载自blog.csdn.net/lyh458/article/details/123851358