一
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.
step1:sudo apt-get install dkms
step2: sudo dkms install -m nvidia -v 440.44
再次输入nvidia-smi时,你熟悉的界面就会回来啦。
其中step2 中的440.44是NVIDIA的版本号,当你不知道的时候,进入/usr/src目录中,可以看到里面有nvidia文件夹,后缀就是其版本号
原文链接:https://blog.csdn.net/Mr_Lowbee/article/details/106027037
注意:
sudo apt install linux-headers-generic可能行不通
先使用uname -r查看版本,
sudo apt install --reinstall linux-headers-5.13.0-39-generic(不同电脑版本号不同)
这样就可以强制安装成功了
二
查看内核版本,第一次也是这样退回原来的内核版本,但是第二次旧的版本没有了就只能用上面的方法了,万幸成功了。
sudo vim 、etc/default/grub
grep menuentry /boot/grub/grub.cfg
GRUB_DEFAULT=0
修改为:
GRUB_DEFAULT=“1> 3”