NAME

Rex::GPU::NVIDIA::Setup::Apt - apt/dpkg packaging layer of the NVIDIA driver setups (experimental)

VERSION

version 0.002

DESCRIPTION

Experimental, like Rex::GPU::NVIDIA::Setup. The apt/dpkg half shared by Rex::GPU::NVIDIA::Setup::Debian and Rex::GPU::NVIDIA::Setup::Ubuntu: the lock timeout on every apt-get, stopping the apt timers, apt-get update, apt-get install run directly and dpkg -l ... ^ii as the only evidence of an install.

apt_lock_timeout

Seconds apt-get waits for the dpkg lock (-o DPkg::Lock::Timeout=). Default 120: on a fresh Hetzner boot cloud-init and unattended-upgrades still hold it.

apt_get

$self->apt_get           # "apt-get -o DPkg::Lock::Timeout=120"

The apt-get invocation every command of this layer starts with.

kernel_packages

The running kernel's headers, linux-headers-$kernel: enough for DKMS. Never the linux-headers-$arch metapackage, which pulls a new kernel whose grub/initramfs post-install can exit non-zero. Reads the architecture first, so dpkg --print-architecture runs before any source is looked at, whether or not the distro class needs it.

prepare_host

Stops unattended-upgrades, apt-daily and apt-daily-upgrade: on a fresh boot they hold /var/lib/dpkg/lock-frontend and apt-get fails at once even with a lock timeout.

prepare_source

apt-get update, with auto_die => 0: it exits non-zero on snap/PPA repository warnings that are no real failure. Whether it actually refreshed the index shows in the next step, "resolve_plan" in Rex::GPU::NVIDIA::Setup: a driver source that reads the index finds nothing and dies there.

refresh_package_index

apt-get update -q with the lock timeout and auto_die => 0, as in "prepare_source". "retrofit_fabric_manager" in Rex::GPU::NVIDIA::Setup runs it before apt-cache madison: on a host provisioned long ago the index may list a Fabric Manager version the archive no longer serves (Ubuntu keeps only the newest in -updates), or miss one published since.

installed_fabric_managers

dpkg-query -W of nvidia-fabric*manager*: every Fabric Manager package dpkg knows in a state other than not-installed or config-files-only (half-installed counts: it is not touched either), with its upstream version.

fabric_manager_version_unavailable

Host-read-only: apt-cache madison PKG must list a version whose upstream part is $version ("install_versioned_package" installs that one), and a simulated apt-get -s install PKG=VERSION must succeed without removing any package -- Ubuntu's nvidia-fabricmanager-NNN depends on the -server driver's kernel-common package, so next to another driver flavour the real install could replace the running driver's packages.

install_packages

Logs the package list, then apt-get install -y of $plan->{packages} through "run_cmd" in Rex::GPU::NVIDIA::Setup with auto_die => 0 -- never "pkg" in Rex::Commands::Pkg. Rex::Pkg::Apt dies on any non-zero exit, and a DKMS module build, grub update or initramfs regeneration routinely exits non-zero on success. Whether the install worked is decided by "verify_packages", not by this exit code.

verify_packages

Dies unless every package in $plan->{verify} is ii in dpkg -l. A DKMS build that fails in postinst leaves the package half-configured (not ii), so a partial install dies here.

fabric_manager_unavailable

After apt-get update, before the driver install: a reason unless apt-cache policy shows an installation candidate for the Fabric Manager package.

installed_driver_version

The upstream part (no epoch, no Debian revision) of dpkg-query -W -f='${Version}' for the source's fabric_manager_match package: 580.178.04-0ubuntu0.24.04.1 is 580.178.04.

install_versioned_package

Looks the package's versions up with apt-cache madison, takes the first (newest) whose upstream version is $version -- the Debian revision may differ from the driver's, e.g. NVIDIA's Ubuntu repository has driver 580.95.05-0ubuntu1 next to Fabric Manager 580.95.05-1 -- and runs apt-get install -y PKG=VERSION with auto_die => 0. Dies before installing anything when no version matches: a Fabric Manager of another version aborts on the driver check.

verify_versioned_package

dpkg -l ... ^ii, then the installed upstream version (dpkg-query) must be $version.

nvlsm, infiniband-diags, libibumad3 (see "nvlink_fabric_packages" in Rex::GPU::NVIDIA::Setup): the Debian package names nvlsm's own dependencies and NVIDIA's gpu-driver-container use.

initramfs_command

update-initramfs -u 2>/dev/null.

SEE ALSO

Rex::GPU::NVIDIA::Setup

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.