PowerEdge:如何在 Red Hat Enterprise Linux 上安裝 NVIDIA 驅動程式
Summary: 本文討論如何在已停用「安全開機」的 Red Hat Enterprise Linux 中,編譯和安裝含動態核心模組支援 (DKMS) 的 NVIDIA 驅動程式。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
本文探討如何在已停用「安全開機」的 Red Hat Enterprise Linux 中,使用 DKMS 編譯和安裝 NVIDIA 驅動程式。
開始使用之前,請確認 BIOS 中的安全開機 選項已停用。這是因為此安裝選項使用 DKMS 從原始程式碼編譯 NVIDIA 驅動程式,適用於任何目前執行中的內核。編譯的驅動程式沒有供應商簽名。如果 已啟用安全開機,則自我編譯的驅動程式將無法載入,並顯示錯誤 Required key not available。透過命令驗證目前狀態 mokutil --sb-state ,並在伺服器 POST 期間按下 F2 鍵,在 BIOS 中進行變更。
如果需要 安全啟動 ,或者如果您更喜歡預編譯的驅動程式,請參閱以下文章進行安裝。如何在 啟用安全開機的 Red Hat Enterprise Linux 中安裝 NVIDIA 驅動程式。
- 從 NVIDIA 站台下載所需的驅動程式。
- 選取正確版本的 Red Hat Enterprise Linux,例如 Red Hat Enterprise Linux 8。
- 選取您要安裝的 CUDA 工具組所需的正確運算統一裝置架構 (CUDA) 版本,例如 12.2。
- 下載套件為 RPM,例如 nvidia-driver-local-repo-rhel8-535.54.03-1.0-1.x86_64.rpm
- 安裝 RPM。這將創建一個本地存儲庫。
[root@rhel87 ~]# ls anaconda-ks.cfg nvidia-driver-local-repo-rhel8-535.54.03-1.0-1.x86_64.rpm [root@rhel87 ~]# yum localinstall ./nvidia-driver-local-repo-rhel8-535.54.03-1.0-1.x86_64.rpm ...output skipped... [root@rhel87 ~]# yum repolist Updating Subscription Management repositories. Unable to read consumer identity This system is not registered with an entitlement server. You can use subscription-manager to register. repo id repo name my-rhel-87-AppStream-iso my RHEL 87 AppStream iso my-rhel-87-BaseOS-iso my RHEL 87 BaseOS iso my-rhel-extra-rpms my RHEL extra rpms nvidia-driver-local-rhel8-535.54.03 nvidia-driver-local-rhel8-535.54.03 [root@rhel87 ~]#
- 裝 DKMS。DKMS 不在 Red Hat Enterprise Linux 中。它包含在 Enterprise Linux (EPEL)
的額外套件中。如需更多關於 DKMS 的詳細資料,請參閱 Red Hat 文章 Red Hat Enterprise Linux 是否提供 DKMS
[root@rhel87 ~]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm [root@rhel87 ~]# yum install dkms
- 如果需要,您可以 禁用 或刪除 EPEL。
# to disable epel, edit the following configuration and change to "enabled=0" [root@rhel87 ~]# vi /etc/yum.repos.d/epel.repo # to remove the epel [root@rhel87 ~]# yum remove epel-release
- 安裝 編譯工具和內核標頭。確定已附加 Red Hat 訂用方案。
[root@rhel87 ~]# yum groupinstall "Development Tools" [root@rhel87 ~]# yum install kernel-devel-$(uname -r)
- 安裝 cuda 驅動程式
[root@rhel87 ~]# yum install cuda-driver
- 確認驅動程式已成功安裝。
[root@rhel87 ~]# dkms status
nvidia/535.54.03, 4.18.0-425.3.1.el8.x86_64, x86_64: installed
[root@rhel87 ~]#
- 如果上面指定的狀態未 安裝,而是“ 已添加”,則可以構建它。
[root@rhel87 ~]# dkms build nvidia/535.54.03
- 如果指定狀態為 已構建,則可以安裝它。
[root@rhel87 ~]# dkms install nvidia/535.54.03
- 如果在組建或安裝過程中狀態失敗,請檢閱下列路徑中的記錄:
[root@rhel87 ~]# ls /var/lib/dkms/nvidia/535.54.03/4.18.0-425.3.1.el8.x86_64/x86_64/log/make.log [root@rhel87 ~]#
- 安裝 NVIDIA 驅動程式後,請將伺服器重新開機。
[root@rhel87 ~]# systemctl reboot
- 確認 驅動程式已啟動並執行中。
[root@rhel87 ~]# lsmod | grep nvidia nvidia_drm 73728 0 nvidia_modeset 1306624 1 nvidia_drm nvidia_uvm 1523712 0 nvidia 56426496 2 nvidia_uvm,nvidia_modeset drm_kms_helper 176128 4 qxl,nvidia_drm drm 565248 7 drm_kms_helper,qxl,nvidia,drm_ttm_helper,nvidia_drm,ttm [root@rhel87 ~]# nvidia-smi Tue Jul 25 12:00:29 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.54.03 Driver Version: 535.54.03 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 Tesla P100-PCIE-12GB Off | 00000000:07:00.0 Off | 0 | | N/A 33C P0 29W / 250W | 0MiB / 12288MiB | 2% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | No running processes found | +---------------------------------------------------------------------------------------+ [root@rhel87 ~]# modinfo nvidia filename: /lib/modules/4.18.0-425.3.1.el8.x86_64/extra/nvidia.ko.xz firmware: nvidia/535.54.03/gsp_tu10x.bin firmware: nvidia/535.54.03/gsp_ga10x.bin alias: char-major-195-* version: 535.54.03 supported: external license: NVIDIA rhelversion: 8.7 srcversion: EA9C7EF32617E104C8240C4
如果出現任何問題,請收集至下列記錄,並聯絡 Dell 支援:
sosreport- 驅動程式產生失敗時,會在產生或製作上述記錄檔
- 任何
/var/log/nvidia-installer.log,或安裝時輸出中提及的任何紀錄
其他須知資訊:
- 如果使用 graphical.target 安裝並開機的 Red Hat Enterprise Linux,則在重新開機後可能會看到黑色畫面。解決方案是將 /etc/X11/xorg.conf.d/10-nvidia.conf 移出 X11 資料夾,然後重新開機伺服器。
- 若要使用 graphical.target 將 GPU 傳遞至 KVM 中的虛擬機器,便會失敗。解決方案是將 Hypervisor Red Hat Enterprise Linux 開機至 multi-user.target,因為 graphical.target 會阻止 NVIDIA 驅動程式在傳遞至 VM 之前卸載。
Affected Products
Red Hat Enterprise Linux Version 7, Red Hat Enterprise Linux Version 9, Red Hat Enterprise Linux Version 8Products
DSS 8440, Poweredge C4140, PowerEdge C6525, PowerEdge R640, PowerEdge R650, PowerEdge R6515, PowerEdge R6525, PowerEdge R740, PowerEdge R740XD, PowerEdge R7425, PowerEdge R750, PowerEdge R750XA, PowerEdge R7515, PowerEdge R7525, PowerEdge R840
, PowerEdge R940xa, PowerEdge T550, PowerEdge T640, PowerEdge XE2420, PowerEdge XE7420, PowerEdge XE9680
...
Article Properties
Article Number: 000216077
Article Type: How To
Last Modified: 06 Dec 2024
Version: 5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.