NAME

Rex::GPU::AMD::Setup::RHEL - AMD driver setup for RHEL, Rocky Linux and AlmaLinux 8, 9 and 10 (experimental)

VERSION

version 0.006

DESCRIPTION

Experimental. The AMD driver on RHEL, Rocky Linux and AlmaLinux:

  • amdgpu-dkms on 8, 9 and 10, per "release_data": from repo.radeon.com/amdgpu/31.60/el/MAJOR with the running kernel's kernel-headers, kernel-devel and (9, 10) kernel-devel-matched, on the kernel builds of AMD's matrix only. The repository's signing key is checked against its pinned fingerprint and imported into rpm. After the repository is written each of these packages must be installed or offered by an enabled repository ("has_candidate"), else it dies before any package is installed -- for a header package with the advice to upgrade the kernel and reboot (Rocky and Alma move a superseded minor release's builds to their vault); the re-run checks the new kernel against AMD's matrix again.

  • inbox, which checks neither the release nor the kernel but for the Radeon GPUs (below); "release_data" only names the firmware package: the kernel's own amdgpu, plus the firmware package (amd-gpu-firmware on 10, linux-firmware on 9 and 8) when it is not installed (it dies, before installing anything, if no enabled repository offers it) -- on another major release none is checked or installed. No package is known that adds a missing amdgpu.ko: it dies then, before any change. The GPUs AMD supports only with the inbox driver (the Ryzen APUs) are not supported on RHEL: "install_driver" in Rex::GPU::AMD dies before any change for them, unless their driver already works, which it answers with present (method => 'dkms' dies then too).

  • Radeon GPUs (gfx target rows with matrix => 'radeon', "targets" in Rex::GPU::AMD::Hardware), with either driver, only on the two releases AMD's matrix lists them for, each with its kernel build: 10.2 with 6.12.0-211, 9.8 with 5.14.0-687 ("radeon_unsupported"; Rocky Linux and AlmaLinux of the same VERSION_ID count as RHEL, as for amdgpu-dkms). On 10.0, 9.6, 9.4, 8.10, another release or kernel "install_driver" in Rex::GPU::AMD dies before any change for them; a working driver is answered with present, as everywhere. The matrix's Radeon list names the releases only; the kernel build and that it binds inbox too are this distribution's reading.

"install_rocm" in Rex::GPU::AMD is not supported here (apt only).

major

The major release, from VERSION_ID (9.6 is 9), undef without.

release_data

The row of this major release (10, 9, 8), undef for another one: the kernels AMD supports amdgpu-dkms on (the matrix's RHEL kernel builds, 6.12.0-211/-55, 5.14.0-687/-570/-427, 4.18.0-553), whether kernel-devel-matched exists, the firmware package.

radeon_unsupported

undef on the two releases AMD's matrix lists the Radeon GPUs for -- VERSION_ID 10.2 with kernel 6.12.0-211.* and 9.8 with 5.14.0-687.*, RHEL, Rocky Linux or AlmaLinux --, else the reason (another kernel: naming the one of the release; another release: the one of "radeon_unsupported" in Rex::GPU::AMD::Setup). Host-read-only.

has_candidate

True when the package is installed ("package_installed"), else when dnf -q repoquery --available PKG lists it from an enabled repository -- the same answer apt-cache policy gives on apt, where an installed package is its own candidate. refresh_index does nothing here: dnf fetches the metadata it lacks (the just written amdgpu.repo) or that has expired itself, as dnf install would; repoquery applies the excludes of dnf.conf as dnf install does. A package spec with version (kernel-devel-$(uname -r)) is matched as rpm -q and dnf install match it. Dies, with dnf's last line, when repoquery fails (a repository whose metadata cannot be downloaded): no package was installed by then. Read-only. Written for the dnf 4 of RHEL 8, 9 and 10; dnf 5's repoquery has the same options and also exits 0 on no match.

package_installed

rpm -q PKG. Read-only.

install_helpers

curl and gpg, only if command -v does not find them: dnf install -y curl gnupg2, verified.

install_packages

dnf install -y of the plan's packages, directly: never Rex::Commands::Pkg.

package_held

True when dnf -q versionlock list has an entry for the package's name (a kernel package spec NAME-KERNEL of the running kernel counts as NAME): dnf 4's NAME-EPOCH:VERSION-RELEASE.*, also as an exclude (!...) or as a bare NAME, or dnf 5's Package name: NAME. Whatever version the entry names. Without the versionlock plugin (dnf 4: python3-dnf-plugin-versionlock, not installed by default), or when the command fails for another reason (exit status not 0), nothing is held: it never dies and installs nothing. Read-only.

blocking_holds

my @held = $setup->blocking_holds($plan);

The names among the plan's packages and "dkms_dependencies" in Rex::GPU::AMD::Setup that a lock is on (as "package_held" counts it) and that it can have kept out of the install: amdgpu-dkms as the plan asks for it (no version: the lock may keep it below the newest), installed or not; every other one -- the running kernel's kernel-headers, kernel-devel, kernel-devel-matched, a dependency required without a version -- only while rpm -q does not find it. One dnf -q versionlock list (none of it when that lists no lock or fails), then rpm -q only for such a locked package. Read-only.

hold_advice

... is version-locked (dnf versionlock), and dnf install leaves a locked package at its locked version (where the install needs another one, it fails). Run dnf versionlock delete ... and install_driver again.

verify_packages

Each of the plan's packages must be installed for rpm -q; dies otherwise. For amdgpu-dkms that is not enough (a failed %post build leaves it installed): "post_install" in Rex::GPU::AMD::Setup checks dkms status. For a dkms plan the message names the locks "blocking_holds" finds ("hold_note" in Rex::GPU::AMD::Setup) as the cause, with dnf versionlock delete of them as the way out; asked only once a package is missing.

place_key

The checked armored key to path (mode 0644), then rpm --import of it; the repository's gpgkey points at that file.

SEE ALSO

Rex::GPU::AMD::Setup

SUPPORT

Issues

Please report bugs and feature requests 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.