zoukankan      html  css  js  c++  java
  • Ubuntu18.04显卡检查和驱动安装

    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
    
  • 相关阅读:
    Delphi中的接口和抽象类
    设计模式之六大原则
    C 标准库
    linux 管道和重定向
    linux c创建静态库(.a)
    一个C语言程序
    C#动态创建lambda表达式
    linq中order by 和group by (含lambda表达式实现)以及综合案例
    微信扫码登陆原理
    二维码扫码支付原理
  • 原文地址:https://www.cnblogs.com/dindin1995/p/13059095.html
Copyright © 2011-2022 走看看