NAME

Rex::GPU::NVIDIA::Setup::RHEL - NVIDIA driver setup for RHEL, Rocky, AlmaLinux and CentOS Stream (experimental)

VERSION

version 0.002

DESCRIPTION

Experimental, like Rex::GPU::NVIDIA::Setup. The NVIDIA driver install for the RHEL family (RHEL, Rocky Linux, AlmaLinux, CentOS Stream): EPEL and CRB/PowerTools, NVIDIA's CUDA repository, the open-kernel DKMS driver by default and the proprietary 580 kmod where the GPUs need it ("sources"), on the rpm layer Rex::GPU::NVIDIA::Setup::Rpm with dnf.

major

The major version of the raw release string: 10.1 is 10, never the dot-stripped 101 of operating_system_version.

os_release

/etc/os-release as a hashref (ID, ID_LIKE, VERSION_ID, ...; quotes removed), read on first use with cat through "run_cmd" in Rex::GPU::NVIDIA::Setup, or {} when the file cannot be read. Unless passed to new.

is_rhel

True on Red Hat Enterprise Linux itself (/etc/os-release ID=rhel), false on Rocky, Alma, CentOS Stream and a host without /etc/os-release. The OS name cannot tell: without lsb_release Rex reports Redhat for RHEL, Rocky and Alma alike.

rex_pkg_works

True when "pkg" in Rex::Commands::Pkg can work on this host: Rex::Pkg picks its provider through "is_redhat" in Rex::Commands::Gather, and dies (OS/Provider not supported) on a name it does not know, such as Rocky or AlmaLinux reported by lsb_release.

install_helpers

$self->install_helpers('python3-dnf-plugin-versionlock');

Installs inert helper packages: through "pkg_cmd" in Rex::GPU::NVIDIA::Setup where "rex_pkg_works", otherwise dnf install -y run directly and verified with rpm -q (dies if one is missing).

kernel_packages

kernel-devel-matched + kernel-headers on 9 and later, kernel-devel-$kernel + kernel-headers before.

sources

From NVIDIA's CUDA repository, in this order:

  • cuda-open-dkms -- the open kernel module, the newest branch the repository carries (at least 580). On 10 and later (no module streams there): kmod-nvidia-open-dkms + nvidia-driver + nvidia-driver-cuda. Before 10: nvidia-open from module stream nvidia-driver:open-dkms, whose enable may fail without harm.

  • cuda-580-dkms -- the proprietary kmod (kmod-nvidia-latest-dkms, nvidia-driver, nvidia-driver-cuda) held on branch 580: module stream nvidia-driver:580-dkms before 10, a dnf versionlock on *nvidia*580* on 10 and later. Both the stream and the lock must succeed ("prepare_source"), and the installed nvidia-driver must be a 580 ("verify_packages").

nvidia-driver is verified on both, plus the proprietary kmod on the second. On a host with NVSwitches both install nvidia-fabricmanager of the installed nvidia-driver's exact version (dnf install -y nvidia-fabricmanager-VERSION). So a GPU without constraints and Blackwell get cuda-open-dkms, Maxwell/Pascal/Volta cuda-580-dkms.

On an HGX B200/B300 ("nvlink_fabric_needed" in Rex::GPU::NVIDIA::Setup) Fabric Manager is installed the same way, then nvlsm from the same CUDA repository and infiniband-diags + libibumad from the distribution ("nvlink_fabric_packages").

fabric_manager_package

The base class's, except for driver branch 570 or 575 (only on an already-installed driver, "retrofit_fabric_manager" in Rex::GPU::NVIDIA::Setup): there NVIDIA's CUDA repository names it nvidia-fabric-manager.

nvlsm, infiniband-diags, libibumad, unversioned (see "nvlink_fabric_packages" in Rex::GPU::NVIDIA::Setup): nvlsm from NVIDIA's CUDA repository, the other two from BaseOS / AppStream.

A reason below RHEL 9: nvlsm was checked in the rhel9 and rhel10 repositories only.

True: NVIDIA supports HGX B200/B300 on RHEL 9.6/9.8 with its 5.14 kernel, so no kernel warning on the RHEL family.

plan

The base plan plus $plan->{major} and $plan->{rhel} ("is_rhel", which reads /etc/os-release) for the later steps. Reads no architecture: uname -m runs in "prepare_source", after EPEL and CRB are enabled, as it always did -- on RHEL itself in "prepare_host", which needs it for the CodeReady Builder repository name.

prepare_host

Enables EPEL, which dkms comes from (the NVIDIA kmod packages require it; neither the CUDA repository nor the distribution carries it), and the CodeReady Builder repository EPEL packages may depend on:

  • Rocky, Alma, CentOS Stream: epel-release through "install_helpers", then crb (9 and later) or powertools (before 9) with dnf config-manager; a failure there is ignored.

  • RHEL itself ("is_rhel"), which has no epel-release package: EPEL's release RPM, dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-MAJOR.noarch.rpm, verified with rpm -q epel-release (dies if missing); then subscription-manager repos --enable codeready-builder-for-rhel-MAJOR-ARCH-rpms (uname -m), which warns on failure but does not die -- a host without subscription-manager (RHUI) names the repository differently.

epel_release_url

my $url = $setup->epel_release_url(9);

EPEL's release RPM for a RHEL major version.

prepare_source

Adds NVIDIA's CUDA repository rhelN for the host architecture (read here, uname -m: aarch64 is the sbsa tree) with dnf config-manager --add-repo; if that exits non-zero (e.g. the .repo URL answers with an HTTP error, so nothing was written) it dies with the URL and dnf's output, before any driver package is installed. Then it expires dnf's cache and selects the driver branch the chosen source asks for:

  • module_stream: dnf module enable nvidia-driver:STREAM -y. For cuda-580-dkms a failure dies here, before any driver package is installed -- without the pin dnf would resolve the newest branch, which does not support the GPU; for cuda-open-dkms (stream_optional) it is ignored.

  • versionlock: python3-dnf-plugin-versionlock ("install_helpers"), then dnf versionlock add; a failure dies the same way.

verify_packages

The rpm layer's rpm -q check, then for a source with pin_branch (cuda-580-dkms): dies unless the installed nvidia-driver is on that branch (rpm -q --qf '%{VERSION}'), not a newer one that cannot drive the GPU.

fabric_manager_version_unavailable

Host-read-only: dnf list --showduplicates --available PKG must list a version whose upstream part (no epoch, no release) is $version. dnf refreshes expired metadata on its own, as for a fresh install; no repository is added or enabled. dnf install never removes a package without --allowerasing, so no simulation is needed before "install_versioned_package" in Rex::GPU::NVIDIA::Setup::Rpm.

SEE ALSO

Rex::GPU::NVIDIA::Setup, "install_driver" in Rex::GPU::NVIDIA

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/rex-gpu/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.