首先,ctrl+alt+F1,进入tty,使用命令行登录,根据提示,先输入用户名,然后输入密码。
输入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。
这是因为NVIDIA驱动与Ubuntu的内核版本不符造成的。
接着输入 nvcc -V, 如果没有报错,说明cuda还在,可以使用如下的命令进行修复:
1、whereis nvidia 查看NVIDIA驱动版本
2、输入 sudo apt-get install dkms
3、输入 sudo dkms install -m nvidia -v 418.56
4、再次输入 nvidia-smi, 可以正常使用。
5、ctrl + alt + F7 ,进入登录界面,可以正常登陆了。