1 安装完显卡后,输入测试命令nvidia-smi
,出现下图表明安装成功:
nvidia-smi
2 如果出现下面的信息表示未能成功安装:
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.1 检查是否插有显卡:
lspci | grep 'VGA'
出现类似下图的信息,说明显卡就位:
2.2 检查security boot是否为disable的状态:
确保改成disabled状态,重启电脑。
如果还是不行,那就只能更新驱动,或者更新内核了。
2.3 查看当前内核版本:
uname -a
结果如下图所示:
2.4 查看详细的内核版本:
grep menuentry /boot/grub/grub.cfg
从下图可以看出,确实存在两个内核版本:(图片来自互联网,为了说明用,我的包括:Linux 5.3.0-46-generic和Linux 5.0.0-42-generic)
因为LZ就是突然不能使用的,推测应该上一个内核版本应该work的,所以就进行如下的操作,通过grub设置,进入高级选项,然后选择前一个版本的内核。
2.5 更换内核版本:(选版本时务必慎重!!!)
首先要修改grub配置文件:
sudo gedit /etc/default/grub
grub文件完整内容:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
#GRUB_DEFAULT=0
GRUB_DEFAULT="1> 3"
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
#GRUB_CMDLINE_LINUX="nomodeset"
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
修改默认版本为自己想要的那个版本,修改内容如下:
#GRUB_DEFAULT=0
GRUB_DEFAULT=3 #这一步务必慎重,一着不慎,可能导致开机自检,一直进不了系统,最后无奈只好重装系统
#GRUB_HIDDEN_TIMEOUT=0#
紧接着对grub进行更新:
sudo update-grub
更新完成后,输入reboot
重启电脑,
reboot
进去之后,重新查询内核版本:
uname -r