天天看点

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动

  • 前言
  • 前置内容
    • 查询已安装的系统和驱动信息
  • 在安装nvidia驱动程序之前
    • 检查是否支持您的nvidia显卡
    • 需要停用UEFI的Secure Boot 或者注册NVIDIA Kernel Module
  • Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作
    • 下载显卡驱动安装包
    • 增加执行权限
    • 切换至root用户
    • 更新系统至最新发行版内容
    • 安装依赖
    • 停用 nouveau
    • 编辑 grub引导
    • 更新 grub2 conf
    • Remove xorg-x11-drv-nouveau
    • Generate initramfs
    • 重启至命令行模式
  • 安装显卡驱动
    • 切换至root用户
    • 运行驱动安装
      • 进行安装 nvidia Installer
        • nvidia Installer Register the Kernel Source Modules with DKMS
        • nvidia Installer 32-bit Compatibility Libraries
        • nvidia Installer Installing Drivers and Building kernel module
        • nvidia Installer Automatic Xorg Config and Backup
        • nvidia Drivers Installation Complete
      • 切换图形启动模式
      • 安装支持 VDPAU / VAAPI
        • nvidia 440.82 drivers on Fedora 32 Gnome 3.36.1 with Kernel 5.6.7
  • 后记

以下内容将介绍如何在Fedora 32 /31 /30 /29 /28系统发行版上安装NVIDIA官方驱动程序并禁用nouveau驱动程序。本文适用于GeForce 6/7/8/9/200/300/400/500/600/700/800/900/10/20系列显卡。

GeForce 20系列卡适用于440.xx nvidia驱动程序

GeForce 600/700/800/900/10系列卡适用于390.xx和440.xx nvidia驱动程序

GeForce 400/500系列卡适用于390.xx nvidia驱动程序

GeForce 8/9/200/300系列卡适用于340.xx nvidia驱动程序

NVIDIA GeForce Driver Installation on Fedora Linux 64-bit

由于网上此类介绍资料奇少,资源紧缺特整理此篇,以便后续参考。安装时走过很多弯路,但是最终已经安装NVIDIA驱动成功。

前言

以下内容将介绍如何在Fedora 32 /31 /30 /29 /28系统发行版上安装NVIDIA官方驱动程序并禁用nouveau驱动程序。本文适用于GeForce 6/7/8/9/200/300/400/500/600/700/800/900/10/20系列显卡。

GeForce 20系列卡适用于440.xx nvidia驱动程序

GeForce 600/700/800/900/10系列卡适用于390.xx和440.xx nvidia驱动程序

GeForce 400/500系列卡适用于390.xx nvidia驱动程序

GeForce 8/9/200/300系列卡适用于340.xx nvidia驱动程序

由于网上此类介绍资料奇少,安装时走过很多弯路,但是最终已经安装NVIDIA驱动成功。

前置内容

查询已安装的系统和驱动信息

建议在安装新的驱动程序前,可先将系统上的重要文件预先备份,以防发生意外事件导致数据丢失。

# 已安装的nvidia驱动
nvidia-installer -v |grep version

#系统发行信息
uname -a

#显卡信息
lspci |grep -E "VGA|3D"
           

在安装nvidia驱动程序之前

检查是否支持您的nvidia显卡

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

信息在支持的NVIDIA GPU产品列表,如果您的卡在390.xx节之前找到,则使用440.xx驱动程序。如果在390.xx和340.xx段之间,则使用390.xx驱动程序。如果在340.xx和304.xx段之间,则使用340.xx驱动程序

如果运行 lspci |grep -E “VGA|3D” 输出如下信息或类似信息,则说明电脑有nvidia显卡,且已经在BIOS或UEFI中启用

OR

需要停用UEFI的Secure Boot 或者注册NVIDIA Kernel Module

Disable UEFI Secure Boot or Check How to Sign NVIDIA Kernel Module

If you have UEFI Secure Boot enabled, 
then you have to disable Secure Boot or sign your NVIDIA kernel module.
           

Signing the NVIDIA Kernel Module:

http://download.nvidia.com/XFree86/Linux-x86_64/430.40/README/installdriver.html#modulesigning

Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作

Install nVidia proprietary drivers on Fedora 32/31/30/29/28 and disable the nouveau driver

下载显卡驱动安装包

Go to http://www.nvidia.com/Download/Find.aspx?lang=en-us and find latest version of installer package.

When you use browser this is normally downloaded /home//Downloads/NVIDIA-Linux-xxxx.run location.

可支持安装的显卡版本

Fedora 32 Fedora 31 Fedora 30 Fedora 29/28
440.82 (April 7, 2020) 440.82 (April 7, 2020) 440.82 (April 7, 2020) 440.82 (April 7, 2020)
390.132 (November 8, 2019) 390.132 (November 8, 2019) 390.132 (November 8, 2019) 390.132 (November 8, 2019)
340.108 (December 23, 2019) 340.108 (December 23, 2019) 340.108 (December 23, 2019) 340.108 (December 23, 2019)
Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

[[email protected] ~]$ uname -a

[[email protected] ~]$ uname -a
Linux localhost 5.6.14-300.fc32.x86_64 #1 SMP Wed May 20 20:47:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
           

驱动下载

  1. 根据自己的版本选择对应的驱动下载

    http://download.nvidia.com/XFree86/Linux-x86_64/

  2. 在官网根据提示下载对应版本

    http://www.nvidia.com

增加执行权限

chmod +x NVIDIA-Linux-*.run
           

切换至root用户

su -

# OR 
sudo -i

# OR 
sudo su

           

# OR

su -u root

更新系统至最新发行版内容

Make sure that you system is up-to-date and you are running latest kernel

# Fedora 32/31/30/29/28 

dnf update

           

After update reboot your system and boot using latest kernel:

安装依赖

# Fedora 32/31/30/29/28 

dnf install -y kernel-devel kernel-headers gcc make dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig

           

停用 nouveau

创建或编辑文件 /etc/modprobe.d/blacklist.conf

追加内容 ‘blacklist nouveau’

echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
           

编辑 grub引导

编辑 /etc/sysconfig/grub

在文件的‘GRUB_CMDLINE_LINUX=”…”‘末尾追加内容 ‘rd.driver.blacklist=nouveau’

# Example row 
GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/swap rd.lvm.lv=fedora/root rhgb quiet rd.driver.blacklist=nouveau"
           
Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

更新 grub2 conf

# BIOS 
grub2-mkconfig -o /boot/grub2/grub.cfg

# UEFI 
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
           

Remove xorg-x11-drv-nouveau

# Fedora 32/31/30/29/28 

dnf remove xorg-x11-drv-nouveau
           

Generate initramfs

# Backup old initramfs nouveau image 

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
           
# Create new initramfs image 

dracut /boot/initramfs-$(uname -r).img $(uname -r)
           

重启至命令行模式

Reboot to runlevel 3

Note: You don’t have Desktop/GUI on runlevel 3. Make sure that you have some access to end of guide. (Print it, use lynx/links/w3m, save it to text file).

# 切换启动模式
systemctl set-default multi-user.target

# 重启
reboot
           

安装显卡驱动

Install nVidia proprietary drivers for GeForce 6/7 & GeForce

8/9/200/300 & GeForce 400/500/600/700/800/900/10/20 series cards

切换至root用户

su -

# OR 
sudo -i

# OR 
sudo su

           

# OR

su -u root

运行驱动安装

Following command executes driver install routine. Use full file name command if you have multiple binaries on same directory.

# 方式1
./NVIDIA-Linux-*.run

# OR full path / full file name 

# 方式2
/home/kjw.localhost/Downloads/NVIDIA-Linux-x86_64-440.82.run

# 方式3
cd /home/kjw.localhost/Downloads/ #即切换到驱动保存目录
./NVIDIA-Linux-x86_64-390.132-patched-kernel-5.6.run

# 方式4
/驱动保存的路径/NVIDIA-Linux-x86_64-340.108-patched-kernel-5.6.run

           

进行安装 nvidia Installer

nvidia Installer Register the Kernel Source Modules with DKMS

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

nvidia Installer 32-bit Compatibility Libraries

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

nvidia Installer Installing Drivers and Building kernel module

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

nvidia Installer Automatic Xorg Config and Backup

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

nvidia Drivers Installation Complete

安装完成

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

切换图形启动模式

All Is Done and Then Reboot Back to Runlevel 5

#All Is Done and Then Reboot Back to Runlevel 5

systemctl set-default graphical.target

reboot

           

安装支持 VDPAU / VAAPI

VDPAU/VAAPI support

To enable video acceleration support for your player (Note: you need Geforce 8 or later).

# Fedora 32/31/30/29/28 

dnf install vdpauinfo libva-vdpau-driver libva-utils

           

nvidia 440.82 drivers on Fedora 32 Gnome 3.36.1 with Kernel 5.6.7

Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记
Fedora 32 /31 /30 /29 /28 系统在GNOME桌面下安装NVIDIA显卡驱动 NVIDIA GeForce Driver Installation on Fedora Linux前言前置内容在安装nvidia驱动程序之前Fedora 32 /31 /30 /29 /28 系统下安装NVIDIA显卡驱动准备工作安装显卡驱动后记

后记

成功安装之后,可运行以下命令查看已安装信息

nvidia-installer -v |grep version
           
uname -a
           

继续阅读