Revision history for Rex-GPU
0.006 2026-11-26 18:33:58Z
- New Rex::GPU::AMD (experimental): install_driver(gpus =>, method =>
auto|inbox|dkms, reboot =>) makes the distribution kernel's amdgpu
usable (plus firmware or linux-modules-extra where missing) or installs
amdgpu-dkms 31.60 from repo.radeon.com with a pinned key fingerprint, on
Ubuntu 22.04/24.04/26.04, Debian 12/13 (inbox and dkms, only on the
release's own amd64 kernel) and RHEL-family 8/9/10. A working driver is
left alone ('present'); every refusal of install_driver itself dies
before any change ("Nothing was changed on the host"), among them a
Proxmox VE host (pve-firmware installed), where firmware-amd-graphics
would remove proxmox-ve and its kernel. Under gpu_setup, gpu_detect
(which installs pciutils where lspci is missing) and, on a host with a
CUDA-capable NVIDIA GPU, all NVIDIA steps run before it and are not
undone; there such a refusal ends "Nothing was changed for the AMD GPU"
("GPUs" for several); so do the dies after apt-get update, which end
"Nothing was installed for the AMD GPU" or say "No driver package was
installed for the AMD GPU". Radeon GPUs (the Radeon table of AMD's ROCm 10.1
matrix, new field matrix in the Hardware rows) get either driver only
where that table lists them: Ubuntu 26.04 GA kernel 7.0, 24.04 HWE 7.0,
22.04 HWE 6.8, RHEL-family 10.2 and 9.8 with their kernel build, never
Debian; elsewhere install_driver dies before any change (a working
driver is still 'present'). For dkms the running kernel's headers and
amdgpu-dkms need an installation candidate (installed or offered by the
sources; on RHEL checked with dnf repoquery), else it dies with no
driver package installed, for headers gone from the mirror with the
advice to upgrade the kernel and reboot. By then the apt timers are
stopped and apt-get update ran (apt) and, for dkms, curl and gpg are
installed where missing and AMD's signing key and repository file are in
place (a re-run accepts them). With an APU next to a dGPU, method =>
'auto' names method => 'inbox' only where the inbox driver is supported
for the APU, else the reason and gpus => with the dGPUs; under gpu_setup
with amd_integrated => 1 it names gpu_setup's own ways out instead
(leave amd_integrated out, or call install_driver directly with method
=> or gpus =>). verify_amd(gpus =>) reports per GPU from sysfs/KFD.
install_rocm(release =>, gpus =>) installs the ROCm Core SDK from
stable.repo.amd.com (apt only) and dies before any change when rocm-core
of an older ROCm line is on the host, also held (apt-mark hold) or half
installed. install_rocm follows AMD's ROCm 10.1 matrix for Radeon GPUs
and Ryzen APUs as install_driver does (Ryzen APUs on Ubuntu 26.04 GA 7.0
and 24.04 HWE 7.0, Radeon also 22.04 HWE 6.8, never Debian; a ROCm
already installed stays 'present'); Instinct targets are unchanged. On
apt hosts a held package counts as installed for the driver, firmware
and ROCm checks; a half installed one does not. gpus => [] is refused.
- gpu_setup installs the AMD driver for ROCm-capable discrete AMD GPUs;
an APU only with the new option amd_integrated => 1; amd => or
set gpu_amd_class picks a custom class. Rex::GPU->can('amd_class') is
the feature flag for Rex::Rancher's gpu => 1.
- gpu_detect lists AMD GPUs at PCI class 1200 (MI300/MI350) too, and every
AMD entry carries slot, device_id, gfx_target, compute and integrated.
compute is no longer always 0: it comes from the new
Rex::GPU::AMD::Hardware tables (gfx targets, PCI IDs) or, when the
running amdgpu reports one, from the KFD topology. An unknown GPU stays
compute undef and gets no driver. A placeholder name "Device" becomes
"AMD GPU [1002:XXXX]". The lspci read command string changed.
- AMD support is experimental: only detection, verify_amd, the no-op
paths and the refusals ran, read-only, on one Ryzen AI Max+ PRO 495 host.
No AMD install, modprobe, reboot or install_rocm has run on hardware.
- On Debian and Ubuntu a held (apt-mark hold) driver, Fabric Manager,
NVLink fabric, container toolkit or helper package and a held
cuda-keyring count as installed, as on the AMD apt layer; a half
installed or half configured one does not. A Fabric Manager held at
another version than the driver still dies at the version check.
- install_driver (dkms) names a package manager hold or lock in the way of
the install as the cause when no amdgpu module is built or a package is
still missing afterwards, with the way out. Debian and Ubuntu (apt-mark
hold; apt-get install -y leaves a held package alone and aborts the
install where it would have to change it): a held package of the
install that is missing or not at its candidate version, or a held
amdgpu-dkms-firmware that is missing; unhold is the way out. RHEL
family (dnf versionlock): a lock on amdgpu-dkms, or on a kernel header
package or amdgpu-dkms-firmware that is missing; versionlock delete is
the way out, and without the versionlock plugin no lock is named. The
hold is looked up only on that failure path; new methods blocking_holds,
hold_note and hold_advice in the AMD setup package layer.
- Ada and Hopper GPUs (GH200 aside) need driver branch 520 or newer, and
88 single Turing, Ampere, Ada and Hopper device IDs the branch whose
NVIDIA supportedchips list first names them (510 to 580; among them
A800, RTX A1000/A400, late RTX 3050/3060 variants, L40S, L20, RTX 40xx
SUPER, H20, H200, H200 NVL, H20 NVL16). On Debian 11 (non-free 470) and
on a Debian release without a known non-free branch (sid; override
nonfree_branch) such a GPU now dies before any driver package is
installed, instead of getting a non-free driver that does not list it.
On Debian 12, and on 13 for 10de:2689, H200 NVL and H20 NVL16, one
floored above the non-free branch now gets NVIDIA's CUDA repository
with the open kernel module. Ubuntu, RHEL and openSUSE choose as before.
- gpu_setup and install_driver check the installed driver branch after the
install where the package name does not carry it: Debian (11 non-free
nvidia-driver; 12 and 13 also nvidia-kernel-open-dkms from the CUDA
repository) and the RHEL family's cuda-open-dkms. A branch that does not
fit the GPUs (a held, pinned or locked package, an older module stream)
dies with the driver packages installed, before Fabric Manager, the
nouveau blacklist, the initramfs and the reboot; an older branch that
still fits passes. New experimental Setup step verify_driver_branch and
source key driver_version_from.
- Recommends Rex::LibSSH 0.006.
0.005 2026-10-21 20:21:08Z
- detect (lspci and sysfs) now lists AMD Instinct accelerators, which
enumerate as PCI class 0380, under "amd" (compute 0, still no driver
install); gpu_setup logs its "AMD GPU detected" warning for them.
Class 0380 is accepted for vendor 1002 only; NVIDIA detection is
unchanged. The lspci read command string changed to match.
- generate_cdi_specs no longer logs "[ok] CDI specs written" when
nvidia-ctk cdi generate for nvidia.com/gpu=all fails; it warns and
carries on, like the management spec.
- _reboot_and_wait now compares /proc/sys/kernel/random/boot_id before
and after the reboot and reports the host back only on a different
boot; a host that cannot read it falls back to the old answer-only
check.
- verify_nvidia (the last gpu_setup step) warns when `crun --version`
reports a crun older than 1.15 (1.14.1 is known broken: with the GPU
Operator's NVIDIA toolkit making crun the first runtime, sandboxes fail
with "unknown version specified"). Warning only, nothing is changed; a
host without crun is silent. It adds one `can_run: crun` probe.
0.004 2026-10-01 16:14:46Z
- Not run on GPU hardware yet; checked against the commands sent to the
host.
[CDI]
- generate_cdi_specs checks with `nvidia-ctk cdi list` that
nvidia.com/gpu=all and management.nvidia.com/gpu=all resolve, and
writes only what is missing under /etc/cdi: nvidia.yaml, and
management.nvidia.yaml via --mode=management
--vendor=management.nvidia.com --class=gpu. Fixes hosts without
nvidia-cdi-refresh (DGX OS / GB10, toolkit 1.19), where /run/cdi is
empty after a reboot and the GPU Operator validator failed on
"unresolvable CDI devices management.nvidia.com/gpu=all". Also in the
"toolkit already present" case. Specs that resolve are left alone
(also nvidia-cdi-refresh's under /run/cdi); next to nvidia-cdi-refresh
no static nvidia.yaml is written. A CLI without the management mode,
or without `cdi list`, is a warning, not a die. An existing
/etc/cdi/nvidia.yaml is no longer rewritten on every run (k76).
0.003 2026-10-01 04:00:20Z
- None of the changes below has run on GPU hardware yet; they are
checked against the commands they send to the host.
[Driver]
- Grace Hopper GH200 (10de:2342, 10de:2348) gets the open kernel module
only, as Blackwell: Ubuntu -server-open, Debian 12/13 NVIDIA's CUDA
repository, RHEL cuda-open-dkms, openSUSE its open driver.
- Ubuntu: only the running kernel's linux-headers-$(uname -r) are
installed, no longer linux-headers-generic, which brought headers for
another kernel on HWE and vendor kernels (DGX Spark). A kernel
installed later needs its own headers for DKMS.
- Ubuntu: new opt-in setup Rex::GPU::NVIDIA::Setup::UbuntuDrivers
(experimental): `ubuntu-drivers list --gpgpu` names the driver
package, installed by apt-get and verified with dpkg; nothing named
dies before any driver install. The default stays apt-cache search.
[Detection]
- An AMD GPU's name is read from lspci as for NVIDIA, e.g.
"Navi 31 [Radeon RX 7900 XTX]", instead of "Unknown AMD GPU" for
every card. Detect-only as before: AMD stays compute => 0.
- New opt-in Rex::GPU::Detect::Sysfs (experimental): detection from
/sys/bus/pci/devices, without lspci and without installing pciutils;
same result shape including vgpu and nvswitch. No product names, so a
GPU the generation table does not cover is compute => undef, not 0.
Dies where sysfs cannot be read. Chosen with detect => or set
gpu_detect_class; lspci stays the default.
[API]
- Every function of Rex::GPU, Rex::GPU::Detect and Rex::GPU::NVIDIA
also works as a class method, and a subclass of Rex::GPU::NVIDIA or
Rex::GPU::Detect can replace any step (experimental): chosen with
gpu_setup(nvidia => ..., detect => ...) or set gpu_nvidia_class /
set gpu_detect_class; one that cannot be loaded dies before the host
is touched. Function calls, their arguments and the defaults are
unchanged.
[Container toolkit]
- install_container_toolkit(binaries_suffice => 1) counts the toolkit as
present when nvidia-container-runtime and nvidia-ctk are on the PATH and
nvidia-ctk runs, without asking the package manager (vendor images
such as DGX Spark); gpu_setup and the default are unchanged
0.002 2026-09-24 21:34:32Z
- None of the changes below has run on GPU hardware yet; they are
checked against the commands they send to the host.
[Detection]
- A GPU counts as compute by its PCI device ID generation, not its name:
every Maxwell or newer NVIDIA GPU (GeForce included) now gets a driver.
Kepler and older are compute => 0 with a warning.
- A virtual display (virtio, QXL, VMware, VirtualBox) no longer hides a
real GPU on passthrough hosts and cloud GPU VMs.
- New keys: nvswitch (HGX NVSwitch bridges) and per GPU vgpu, vgpu_type,
subsystem_vendor_id, subsystem_id (NVIDIA vGPU guests).
- pciutils is installed only when lspci is missing, also on Rocky, Alma
and CentOS Stream; detection dies if lspci is still missing.
[Driver]
- gpu_setup installs one driver that fits all compute GPUs (new option
gpus => [...]). It dies before any driver package is installed when
they cannot share one, for a Kepler GPU, or for a vGPU guest without a
working driver.
- The driver fits the GPU generation: Blackwell (B200/B300, RTX 50xx,
RTX PRO, GB10) gets the open kernel module, on Debian 12/13 from
NVIDIA's CUDA repository; Maxwell/Pascal/Volta stay on the proprietary
580 branch. GB10 (DGX Spark) needs 580 or newer.
- A host with a working driver (nvidia-smi lists a GPU, libcuda is
present) is left alone: no reinstall, no reboot.
- HGX hosts with NVSwitch get NVIDIA Fabric Manager; HGX B200/B300 also
get the NVLink fabric (nvlsm, ib_umad). An existing driver gets a
missing Fabric Manager from the host's own package sources.
- Ubuntu: the newest nvidia-driver-NNN-server package is picked after
apt-get update; no silent fallback to 570.
- Debian: contrib/non-free are enabled on every Debian archive entry,
deb822 .sources included. An own mirror counts when it is signed-by the
Debian archive keyring.
- RHEL family: Rocky, Alma and CentOS Stream work under their lsb_release
names; RHEL gets EPEL and CodeReady Builder; aarch64 uses NVIDIA's sbsa
repository; a CUDA repository that cannot be added dies early.
- reboot => 1 waits until the host answers a command again.
- Own driver setup: setup => 'My::Setup' or set gpu_nvidia_setup, plus
requirement => { kernel_module, min_branch, max_branch }. Setup classes
and Rex::GPU::NVIDIA::Requirement are experimental API; examples in
eg/custom-setup/ and eg/ubuntu-drivers/.
[Container toolkit, CDI, containerd]
- install_container_toolkit skips an installed toolkit, survives the
dpkg lock after a reboot, and dies on a failed key or repository
download instead of installing from a broken source.
- generate_cdi_specs leaves CDI to nvidia-cdi-refresh when the toolkit
ships it, so nvidia.com/gpu is no longer defined twice.
- configure_containerd adds the nvidia runtime to RKE2/K3s's own config
instead of replacing it (SystemdCgroup, sandbox image and registry
config were lost). A template written by 0.001 is removed with a
warning; restart rke2/k3s to regenerate the config.
- An unknown containerd_config dies before anything runs on the host.
[openSUSE (unverified, unsupported)]
- Leap 15.x gets the Leap 15 repository and G06 driver again (it got
Leap 16's). zypper waits for the zypp lock, repository failures die,
and every install is verified.
[Examples]
- eg/ keeps SSH host-key verification on and scans the new host into
known_hosts first.
0.001 2026-03-29 04:20:30Z
- Initial release
- GPU hardware detection via PCI class codes (NVIDIA, AMD)
- NVIDIA driver installation (Debian 12/13, Ubuntu 22.04/24.04, RHEL/Rocky 8/9/10, openSUSE Leap 15.6/16.0)
- NVIDIA Container Toolkit installation with automatic repo setup
- CDI spec generation via nvidia-ctk cdi generate
- Containerd runtime configuration (RKE2, K3s, standalone)
- Support for Ubuntu 24.04: auto-detect nvidia-driver-NNN-server, handle virtual nvidia-smi package
- DPkg::Lock::Timeout=120 on all apt-get calls for resilience on fresh-boot systems
- All package installs use apt-get/dnf directly with dpkg/rpm verification
(Rex::Pkg dies on non-zero from DKMS/grub/initramfs post-install scripts)
- Reboot support with reconnect polling via Rex::LibSSH
- Tested on Hetzner dedicated servers with NVIDIA RTX 4000 SFF Ada Generation
(Debian 13, Rocky Linux 10.1, Ubuntu 24.04 LTS)
- eg/Rexfile example for GPU detection and cluster deployment
- Requires Rex::LibSSH for deployment to SFTP-less hosts
Keyboard Shortcuts
Global
s
Focus search bar
?
Bring up this help dialog
GitHub
gp
Go to pull requests
gi
Go to GitHub issues (only if GitHub is preferred repository)