当前位置:   article > 正文

Ubunut20.04/22.04安装NVIDIA驱动_ubuntu 22.04 安装 rtx 4070 laptop显卡驱动

ubuntu 22.04 安装 rtx 4070 laptop显卡驱动

1. NVIDIA驱动下载

根据自己的显卡选择所需下载的NVIDIA驱动,例如作者显卡为RTX A2000,在产品列表中选择对应显卡,然后操作系统选择Linux 64-bit,点击搜索后进行下载
可以通过以下命令查看自己的显卡型号

lspci | grep -i nvidia
  • 1

点击此处下载NVIDIA驱动
在这里插入图片描述

2. 准备工作

2.1. 安装所需依赖

安装驱动前一定要更新软件列表和安装必要软件、依赖(必须),需要安装g++,gcc,make

sudo apt-get update   #更新软件列表
sudo apt-get install g++
sudo apt-get install gcc
sudo apt-get install make
  • 1
  • 2
  • 3
  • 4

2.2. 卸载原有NVIDIA驱动

sudo apt-get remove --purge nvidia*
  • 1

2.3. 禁用nouveau

打开blacklist.conf文件

sudo gedit /etc/modprobe.d/blacklist.conf
  • 1

在blacklist.conf末尾添加以下两行,保存后关闭文本

blacklist nouveau
options nouveau modeset=0
  • 1
  • 2

在这里插入图片描述在终端输入如下更新,更新结束后重启电脑

sudo update-initramfs -u
  • 1

在这里插入图片描述重启后输入如下指令,如无输出则已关闭nouveau

lsmod | grep nouveau
  • 1

2.4. 关闭Secure Boot

重新启动按F2或F10进入自己电脑的BIOS设置(不同电脑进入方式不同,具体方式自行查找)

关闭Secure Boot,并且清除安全启动密钥,保存后退出重启

3. 安装过程

安装过程需要在非图形化界面中进行,输入以下命令进入非图形化界面

sudo telinit 3  #进入文本界面
  • 1

进入文本操作界面后输入用户名密码登陆系统
关闭显示服务

sudo service gdm3 stop   #停止显示服务
  • 1

给安装文件赋予权限,然后运行安装

cd {你的NVIDIA安装文件路径}
sudo chmod 777 NVIDIA-Linux-x86_64-430.26.run   #给你下载的驱动赋予可执行权限,才可以安装
sudo ./NVIDIA-Linux-x86_64-430.26.run  --no-opengl-files  #安装
  • 1
  • 2
  • 3

安装过程中选项

        1.The distribution-provided pre-install script failed! Are you sure you want to continue?

        选择continue installation

        2.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 继续。

        3.问题大概是:Nvidia's 32-bit compatibility libraries? 选择 No 继续。

        4.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.  

        ​​​​​​​选择 No  继续
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

安装完成后重新开启显示服务

sudo service gdm3 start   #重启显示服务,完成
  • 1

进入系统后输入,看到相关信息后安装完成

nvidia-smi
  • 1

在这里插入图片描述
有问题欢迎在下方评论区讨论

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/803787
推荐阅读
相关标签
  

闽ICP备14008679号