Ubuntu16.04 安装 NVIDIA 显卡驱动(亲测可用)

Python3.8

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

环境:Ubuntu 16.04,GeForce RTX 3080

安装NVIDIA 显卡驱动

  1. 如何检查系统的显卡型号
    • lspci -vnn | grep VGA -A 12
    • 得到结果中 NVIDIA Corporation Device 后的 ‘[]’ 里的十六进制码。
    • 在 http://pci-ids.ucw.cz/mods/PC/10de?action=help?help=pci 中输入,点击 Jump。
    • 网站会返回查询结果。
  2. 如何判断系统是否安装有 NVIDIA 版本的显卡驱动
    • nvidia-smi
    • 如果没有输出,则未安装显卡驱动。

下载驱动安装包

在 https://www.nvidia.com/Download/index.aspx?lang=en-us 中根据自己的显卡下载对应的安装文件
在这里插入图片描述在这里插入图片描述

对 Production Branch 与 New Feature Branch 两者任选其一应该均可。

  • Production Branch 侧重于长期稳定与可靠性。
  • New Feature Branch 是最新的优化与增强版本。

安装驱动

禁用 nouveau

  1. 打开终端,输入
sudo gedit /etc/modprobe.d/blacklist.conf
  1. 在 blacklist.conf 文件末尾添加下述代码,并保存:
blacklist nouveau
options nouveau modeset=0
  1. 执行命令
sudo update-initramfs -u  //应用更改
  1. 重启系统
sudo reboot
  1. 验证是否禁用 nouveau 成功
lsmod | grep nouveau

若没有输出,则禁用成功。

安装

  1. Alt+Ctrl+F1 进入命令行界面
  2. 关闭图形界面 sudo service lightdm stop
  3. 卸载旧版本的 NVIDIA 驱动(如果有的话):sudo apt-get remove --purge nvidia*
  4. 给驱动 .run 文件赋予执行权限:
sudo chmod  a+x NVIDIA-Linux-x86_64-xxx.xxx.run //对应自己下载的驱动名称
  1. 运行 .run 文件
sudo ./NVIDIA-Linux-x86_64-xxx.xxx.run -no-x-check -no-nouveau-check -no-opengl-files 
  • -no-x-check:安装驱动时关闭 X 服务。
  • -no-nouveau-check:安装驱动时禁用 nouveau。
  • -no-opengl-files:只安装驱动文件,不安装 OpenGL 文件。避免安装后出现循环登陆的问题。
  1. 安装过程中遇到的问题及回答
The distribution-provided pre-install script failed!  Are you sure you want to continue?                                                                 
        Continue installation      Abort installation       
----> Continue installation

Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later.
        Yes                       No  
---->No

The CC version check failed:
  The kernel was built with gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1), but the current compiler version is cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.  
  This may lead to subtle problems; if you are not certain whether the mismatched compiler will be compatible with your kernel, you may wish to abort installation, set the CC environment variable to the name of the compiler used to compile your kernel, and restart installation.
        Ignore CC version check     Abort installation         
----> select ignore

WARNING: Ignoring CC version mismatch:
  The kernel was built with gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1), but the current compiler version is cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.
        OK  
----> OK

Install NVIDIA's 32-bit compatibility libraries?
        Yes                       No   
----> No

An incomplete installation of libglvnd was found. All of the essential libglvnd libraries are present, but one or more optional components are missing. Do you want to install a full copy of libglvnd? This will overwrite any existing libglvnd libraries.
        Don't install  Install and overw          Abort installation.       
---->Install and overw

Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X?  Any pre-existing X configuration file will be backed up.         
        Yes                       No                 
---->Yes

Your X configuration file has been successfully updated. Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 440.100) is now complete.
        OK  
----> OK
  1. 打开图形界面:sudo service lightdm start
  2. nvidia-smi 有显示则安装成功
    在这里插入图片描述

您可能感兴趣的与本文相关的镜像

Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值