Ubuntu18.04 显卡驱动安装(解决各种疑难杂症)

步骤

  • 下载驱动
  • 准备工作
  • 进行安装
  • 检查安装

下载驱动

首先,我们需要从官网下载显卡驱动。

[En]

First of all, we need to download the video card driver from the official website.

  1. 打开浏览器,在百度搜索框中搜索:显卡驱动 下载
  2. 手动搜索驱动程序一栏,根据自己的显卡进行选择
  3. 产品系列中,Notebooks代表笔记本使用的显卡驱动,30系的选择 GeForce RTX30 Series操作系统选择 Linux 64-bit,选择好之后点击 开始搜索
  4. 在下方驱动程序搜索结果中,选择适合自己的版本进行下载,本文选择的是 510.39

具体流程如下图所示:

[En]

The specific process is shown in the following two figures:

Ubuntu18.04 显卡驱动安装(解决各种疑难杂症)

Ubuntu18.04 显卡驱动安装(解决各种疑难杂症)

准备工作

这部分就不放图了,直接输入命令即可

在安装显卡驱动程序之前,我们需要做一些准备工作。

[En]

We need to do some preparatory work before installing the video card driver.

  • 将Ubuntu自带的显卡驱动禁掉
  • 修改驱动安装文件的权限
  • 安装好所需要的的依赖

首先 打开终端

输入命令:

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

在打开的 blacklist.conf文件的最后一行,我们加入以下内容:

blacklist nouveau

保存并退出该文件,这样可以将Ubuntu自带的显卡驱动禁止

接下来,我们需要使更改生效。

[En]

Next, we need to make the changes take effect.

sudo update-initramfs -u

为了便于以后的安装步骤,我们需要将下载的驱动程序修改为可执行文件

[En]

To facilitate the installation steps later, we need to modify the downloaded driver to an executable file

首先进入驱动所在的目录,我放在了 Downloads目录

cd Downloads

然后我们修改驱动的权限

sudo chmod +x ./NVIDIA-Linux-x86_64-510.39.01.run

安装显卡驱动程序需要一些依赖项

[En]

Some * dependencies needed to install the video card driver*

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

重启电脑

reboot

重启之后,我们进入到输入用户名密码界面,此时我们按住 Ctrl + ALT + F2,会进入 命令行界面

如果此时出现◇乱码
解决办法:sudo gedit /etc/default/locate
将里面的LANG与LANGUAGE修改为:

LANG="en_US.UTF-8"
LANGUAGE="en_US:en"

在命令行界面中,我们需要输入用户名、密码,然后自己输入。

[En]

In the command line interface, we need to enter the user name, password and enter it ourselves.

成功登录以后,如果事先已经安装过Ubuntu自带的驱动,需要将图形化桌面关掉(若没有安装过,可省略此步骤)

sudo service lightdm stop

找到驱动程序安装文件所在的目录

[En]

Find the directory where our driver installation files are located

cd Downloads

输入命令进行安装

sudo ./NVIDIA-Linux-x86_64-510.39.01.run

安装过程

可能遇到的问题

由于显卡驱动在使用过程中也会挂机,笔者已经安装了很多次,遇到了很多情况,在这里先总结一下可能会遇到的问题,希望能给大家带来一些帮助,遇到这样问题的朋友也可以直接想办法解决!

[En]

As the graphics card driver will also hang up in the use process, the author has installed many times, encountered a lot of situations, here first summarize the problems that may be encountered, hope to bring some help to everyone, friends who encounter such problems can also directly find a way to solve them!

如果有没有提到的错误,希望大家能在评论区指出,一起交流。

[En]

If there are any mistakes that have not been mentioned, I hope you can point them out in the comments section and communicate together.

成功进入安装程序并不意味着一帆风顺,你会遇到各种各样的错误

[En]

Successful entry into the installation program does not mean plain sailing, you will encounter all kinds of errors

  1. Error: the distribution-provided pre-install script failed.

  2. Error: Unable to find the development tool ‘cc’ in your path.

  3. Error: Unable to find the development tool ‘make’ in your path.

  4. Error: The kernel module failed to load. Secure boot is enabled on this system.

  5. The signed kernel module failed to load.

  6. Error: Unable to load the kernel module ‘nvidia.ko’.

  7. Error: An NVIDIA kernel ‘nvidia-drm’ appears to already be loaded in your kernel.

  8. Error: An NVIDIA kernel module ‘nvidia-modeset’ appears to already be loaded in your kernel.

  9. WARNING: Unable to find a suitable destination to install 32-bit compatibility libraries.

  10. WARNING: Unable to determine the path to install the libglvnd EGL vendor library config files.

如果您报告错误,请不要担心。在正常情况下,让我们逐一解决。

[En]

Don’t worry if you report a mistake. Under normal circumstances, let’s solve it one by one.

解决方法

第一个错误,继续安装即可,这个错误只是确认你是否要安装这个驱动

第二个、第三个错误产生的原因是Ubuntu环境缺少所需要的依赖

解决:

sudo apt-get install gcc
sudo apt-get install make

第四个错误第五个错误产生的原因是BIOS没有关闭 Secure boot

解决:

  1. 重启电脑在主板信息界面,按 F2Del进入BIOS界面
  2. F7进入 高级设置菜单
  3. 在菜单栏中点击进入 启动分页
  4. 快速启动设置为 Disabled
  5. 点击 安全启动菜单
  6. 操作系统类型如果是双系统依旧保持UEFI模式,如果不是双系统,设置为 其他操作系统
  7. 点击 密钥管理
  8. 点击 清除安全启动密钥,再点击确认清除
  9. 保存设置并退出

第六个错误,证明准备工作没有做好

  1. 输入命令 reboot重启电脑
  2. 在用户登录界面,按 Alt + Ctrl + F2 进入命令行
  3. 输入命令: sudo systemctl isolate multi-user.target进入无窗口界面
  4. 输入用户名与密码进行登录
  5. 输入命令: sudo modprobe -r nvidia_drmsudo modprobe -r nvidia_modeset
  6. 重新进入驱动安装
  7. 退出无窗口界面: sudo systemctl start graphical.target

第七个错误第八个错误,首先要确保关闭了Secure Boot,然后删除已经安装的显卡驱动:

sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo reboot

然后转到第六个错误部分,解决准备问题。

[En]

Then go to the sixth wrong part to solve the problem of preparation.

最后两个警告,不影响安装,如果有需要,可以自己安装需要的依赖

安装时的选项

不展示图片,选择基本如下,坐好自己的座位:

[En]

Do not show the picture, the choice is basically as follows, take your own seat:

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

>>> yes
Q: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
Q:Would you like to sign the NVIDIA kernel module?

>>> Install without signing
Q:Nvidia's 32-bit compatibility libraries?

>>> No
Q: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

检查安装情况

重启电脑之后, 打开终端,输入命令:

sudo nvidia-smi

检查显卡信息、显存使用信息、驱动版本信息是否输出成功。

[En]

Check whether the video card information, video memory usage information and driver version information have been successfully output.

如下所示:

Ubuntu18.04 显卡驱动安装(解决各种疑难杂症)

自此,显卡驱动就算 安装完成

Original: https://www.cnblogs.com/seansheep/p/15860648.html
Author: 在青青草原上抓羊
Title: Ubuntu18.04 显卡驱动安装(解决各种疑难杂症)

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/524124/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • 正则表达

    常用表达式 单字符:. : 除换行以外所有字符[] :[aoe] [a-w] 匹配集合中任意一个字符\d :数字 [0-9]\D : 非数字\w :数字、字母、下划线、中文\W :…

    Linux 2023年6月13日
    083
  • ELK收集日志之logstash使用

    一、logstash使用 1.logstah收集文件日志 不难理解,我们的日志通常都是在日志文件中存储的,所以,当我们在使用INPUT插件时,收集日志,需要使用file模块,从文件…

    Linux 2023年5月27日
    092
  • 三款优秀的替代Xshell的SSH软件

    在之前的文章介绍个, 由于公司禁止使用xshell, 让我很是难受了一阵, 因为一直无法找到好的工具来替代xshell, 前面文章中提到的那些对我来时功能还是太单一了, 界面也不够…

    Linux 2023年5月28日
    0843
  • 实验一 密码引擎-4-国䀄算法交叉测试

    任务详情 0 2人一组,创建一个文件,文件名为小组成员学号,内容为小组成员学号和姓名1 在Ubuntu中使用OpenSSL用SM4算法加密上述文件,然后用龙脉eKey解密,提交代码…

    Linux 2023年6月8日
    093
  • 【原创】Linux虚拟化KVM-Qemu分析(三)之KVM源码(1)

    背景 Read the fucking source code! –By 鲁迅 A picture is worth a thousand words. –…

    Linux 2023年6月8日
    086
  • 一步一图带你深入剖析 JDK NIO ByteBuffer 在不同字节序下的设计与实现

    让我们来到微观世界重新认识 Netty 在前面 Netty 源码解析系列 《聊聊 Netty 那些事儿》中,笔者带领大家从宏观世界详细剖析了 Netty 的整个运转流程。从一个网络…

    Linux 2023年6月6日
    0106
  • 研发过程中的文档管理与工具

    写文档也是技术活 01:实践 对于多数开发同学来说,很多时候即讨厌没有研发文档,但是自己又不愿意常写文档,痛且倔强着; 程序员该不该写文档,与争论哪种编程语言最好一样,想撕的嘴不留…

    Linux 2023年6月14日
    098
  • Ubuntu系统中MySQL安装后基本配置

    mysql8.0安装好后并不会让你输入root密码,而是采用默认账户+默认密码的方式保护数据库安全,但开发环境并不需要这样做。那么怎么找到这个默认账户和密码,又如何修改数据库使它可…

    Linux 2023年6月14日
    078
  • 抓到 Netty 一个隐藏很深的内存泄露 Bug | 详解 Recycler 对象池的精妙设计与实现

    欢迎关注公众号:bin的技术小屋,如果大家在看文章的时候发现图片加载不了,可以到公众号查看原文 本系列Netty源码解析文章基于 4.1.56.Final版本 最近在 Review…

    Linux 2023年6月6日
    0107
  • 011 Linux 打包与解压 tar

    01 压缩、打包命令有哪些? Linux上有着各种压缩、打包的工具:tar、gzip、zip、7z,而 tar 应该算是 Linux 官宣的压缩工具了。tar 的核心压缩工具其实是…

    Linux 2023年5月27日
    076
  • linux学习记录

    查看所有系统服务 systemctl list-unit-files –type service -all 查看服务状态 sudo systemctl status servic…

    Linux 2023年6月7日
    079
  • Linux下TIME_WAIT连接优化内核参数tcp_tw_reuse与tcp_tw_recycle区别与联系浅析

    概述 最近学习网络相关知识点,很多文章提到针对TCP time wait(后续简称TW)状态连接进行优化的参数tcp_tw_reuse和tcp_tw_recycle,并且不少文章提…

    Linux 2023年6月6日
    0113
  • 生成随机数的若干种方法

    背景: 创建账户时我们需要配置初始随机密码,使用手机号注册时需要随机验证码,抽奖活动需要随机点名,俄罗斯方块游戏需要随机出形状。这些案例都在说明一个问题,随机数据很重要!而在 Sh…

    Linux 2023年6月6日
    087
  • 项目经验示例

    一,期中项目经验示例 1,根据现有结构部署工具(PXE+kickstart)2,结合应用系统需求定制部署模版3,制作系统优化等一键执行脚本4,自动化部署实施5,根据定制的优化内容对…

    Linux 2023年6月7日
    084
  • linux(Ubuntu)安装python

    提前安装一个依赖环境 (1)ubuntu/Debian: sudo apt-get install -y gcc make cmake build-essential libssl…

    Linux 2023年6月7日
    098
  • Docker 搭建 Nexus3 私服 | 基本操作

    1 Docker 安装 Nexus3 1.1 创建目录 在硬盘上创建 Nexus3 的主目录: mkdir -p /Users/yygnb/dockerMe/nexus3 为该目录…

    Linux 2023年6月7日
    075
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球