NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the lat
执行:nvidia-smi
Ubuntu16.04的系统,使用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.
重启了之后还是这样!!!
经过查找资料和实践验证,最后确定是:
是内核版本太高的问题,然后修改默认开机启动的内核版本;或者进入 grub菜单 ,选择advance option for Ubuntu查看子菜单 选择要进入的内核版;
一、问题描述:
Ubuntu16.04下已经成功搭建好了caffe环境(包括cuda、NVIDIA驱动、cudnn、opencv等都已经安装成功了),并且测试程序已经通过。而且已经使用caffe环境有一段时间了。但是突然有一天跑程序出现如下错误:
Check failed: error == cudaSuccess (30 vs. 0) unknown error
*** Check failure stack trace: ***
具体内容如下:
然后,我执行了nvidia-smi 命令,出错:
$ 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.
(注:出现这种情况之前,系统有弹出窗口询问是否更新,具体更新什么忘记了,我直接关闭了该提示窗口。然后等下一次开机后就出现了该情况。)
二、解决问题过程:
https://blog.csdn.net/weixin_42084747/article/details/84371079
本人电脑win10+ubuntu16.04双系统
开机grub界面是:
默认是启动Ubuntu
1、开机进入grub界面,选择默认选项Ubuntu,进入系统。
执行:
uname -a
nvidia-smi
结果如下:
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.
2、开机进入grub引导界面,选择Advanced options for Ubuntu:
Ubuntu
Advanced options for Ubuntu
Windows 10 (loader) (on /dev/sda1)
system setup
选择Advanced options for Ubuntu后,进入其子菜单,如下图所示:
选择 Linux 4.15.0-42-generic 的内核,进入系统。
执行如下命令:
uname -r
nvidia-smi
成功!如下图:
3、问题总结:
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驱动是在低版本的时候安装,由于系统更新,内核版本升级导致NVIDIA无法应用在高内核版本
所以,说明是内核版本的问题,选择低版本的内核即可。
本人亲测可行!!!
4、修改Ubuntu默认开机启动的内核版本
http://forum.ubuntu.org.cn/viewtopic.php?t=486436
终端执行:
sudo gedit /etc/default/grub
GRUB_DEFAULT=0
修改为:
GRUB_DEFAULT="1> 3"
(注:1 代表主菜单的第二项Advanced options for Ubuntu;3代表1项目下面对应的子菜单里面的第4项;)
修改后保存退出,执行:
sudo update-grub
重新启动,现在应该默认启动旧的内核版本。
查看内核版本
$ uname -r
4.15.0-42-generic
参考链接:
https://blog.csdn.net/weixin_42084747/article/details/84371079
http://forum.ubuntu.org.cn/viewtopic.php?t=486436
http://s1nh.org/post/littlebug/
https://www.cnblogs.com/feifanrensheng/p/9974249.html