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 中的 “Secure Boot ”选项已禁用。这是因为此安装选项使用 DKMS 从任何当前正在运行的内核的源代码编译 NVIDIA 驱动程序。编译的驱动程序没有供应商签名。如果启用 了安全启动,则自编译驱动程序将无法加载,并显示错误 Required key not available。通过命令验证当前状态 mokutil --sb-state Red Hat Enterprise Linux,并在服务器开机自检期间按 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的。Red Hat Enterprise Linux 中没有 DKMS。它在 Extra Packages for 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-driver
[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
如果存在任何问题,请收集以下日志并联系 戴尔支持:
sosreport- 如果驱动程序构建失败,则在构建或制作中上述提到的日志文件
- 任意
/var/log/nvidia-installer.log或安装时输出中提到的任何日志
其他须知信息:
- 如果 Red Hat Enterprise Linux 已安装并使用 graphical.target 进行引导,则在重新引导后您可能会看到黑屏。解决方案是将 /etc/X11/xorg.conf.d/10-nvidia.conf 移出 X11 文件夹并重新启动服务器。
- 如果要使用 graphical.target 将 GPU 传递到 KVM 中的虚拟机,则会失败。解决方案是将虚拟机管理程序 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.