ubuntu重启后nvidia消失-NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver.
程序员文章站
2022-03-23 16:46:26
...
之前能正常运行,重启后,机器开始矫情,运行程序报错说cuda出问题;那就nvidia-smi,发现链接失败
nvidia-smi
报错:(NVIDIA-SMI失败因为它没法链接NVIDIA设备。请确保最新版本的NVIDIA已经安装和运行)- 翻译过来也是屁话
解决方案
1.检查NVIDIA是否存在
nvcc -V
输出
说明NVIDIA还在,(不在的亲(づ ̄3 ̄)づ╭❤~,请重新安装)
2. 安装dkms
sudo apt-get install dkms
3 使用dkms重新配置驱动-自己输入版本号(这里是440.31)
sudo dkms install -m nvidia -v 440.31
输出
看到completed,嗯,成功了。
4.再次检测NVIDIA
nvidia-smi
输出
完成。
拓展理解
什么是nvcc,什么事DKMS
NVCC介绍
nvcc是编译cuda程序的编译器,CDUA C是在C语言上的扩展,所以它依赖C编译器(C编译器在window下是cl.exe,在Linux下是gcc)。因此我们编译CUDA程序必须依靠编译器nvcc。也就是没装cuda的是没法使用nvcc的。
DKMS介绍
DKMS全称是Dynamic Kernel Module Support,它可以帮我们维护内核外的这些驱动程序,在内核版本变动之后可以自动重新生成新的模块。
推荐阅读
-
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver ...
-
Ubuntu:NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver. 解决方法总结
-
【Ubuntu 18.04 LTS】NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver.
-
Ubuntu16安装nvidia驱动成功出现NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver
-
NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver.
-
解决 NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver.
-
显卡驱动安装教程 NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver
-
Ubuntu切换显卡,NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver
-
NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver
-
ubuntu18:报错NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver.解决