天天看點

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
           

繼續閱讀