Ubuntu18.0.4 出现NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver,需要切换内核

2020/12/11 10:55:26

1. 查看已安装内核:

grep menuentry /boot/grub/grub.cfg


2. 需要更改grub启动

vim /etc/default/grub

Warning: Please don't use old title `Ubuntu,Linux 5.4.0-52-generic' for GRUB_DEFAULT, use `Advanced options for Ubuntu>Ubuntu,Linux 5.4.0-52-generic' (for versions before 2.00) or `gnulinux-advanced-f3c44984-5b39-4939-b7f8-d8b90b2eab8d>gnulinux-5.4.0-52-generic-advanced-f3c44984-5b39-4939-b7f8-d8b90b2eab8d' (for 2.00 or later)

找到:GRUB_DEFAULT=0,

如果你要的版本大于2.0.0的话:

GRUB_DEFAULT="gnulinux-advanced-9ce1b297-0f01-4513-b3f1-4b98dbe4a66f>gnulinux-4.8.0-040800-generic-advanced-9ce1b297-0f01-4513-b3f1-4b98dbe4a66f"

如果小于2.0,则GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu,Linux 5.4.0-52-generic"

谨记:一定按照自己Linux系统的设置,我的设置如下:

然后使用update-grub更新。可能出现以下错误情况,无需理会!!!执行3.


3.reboot进行重启

内核已经发生变化