发现是显卡驱动版本装错了,驱动可以去这个网站根据自己显卡型号下载Official Drivers | NVIDIA
这个驱动是我之前就下载好放在home目录下的,文件名为NVIDIA-Linux-x86_64-535.113.01.run
按ctrl+alt+f2进入tty命令行界面,输入用户名和密码进入命令行模式。
找到下载的驱动文件(放在home目录下比较好找,tty命令行界面是显示不了中文的文件名的),使用
./NVIDIA-Linux-x86_64-535.113.01.run
进入这个驱动文件安装界面
如果出现访问权限的问题,使用如下命令授予执行权限
sudo chmod +x NVIDIA-Linux-x86_64-535.113.01.run
进入安装界面后,选项如下选择
The distribution-provided pre-install script failed! Are you sure you want to continue? 选择 yes 继续。
Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later? 选择 No 继续。
问题没记住,选项是:install without signing
问题大概是:Nvidia's 32-bit compatibility libraries? 选择 No 继续。
Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up. 选择 Yes 继续
安装完使用
nvidia-smi
查看是否成功安装驱动文件
成功之后reboot重启就可以了!