NAME
Rex::GPU::NVIDIA::Setup::Debian - NVIDIA driver setup for Debian (experimental)
VERSION
version 0.006
DESCRIPTION
Experimental, like Rex::GPU::NVIDIA::Setup. The NVIDIA driver install for Debian (and every is_debian host that is not Ubuntu): nvidia-driver from Debian non-free, or where that cannot drive the GPUs (Blackwell, or a GPU that needs a newer branch than the release's non-free one) the open-module set from NVIDIA's CUDA repository ("sources"), on the apt layer Rex::GPU::NVIDIA::Setup::Apt.
Proxmox VE (pve-firmware installed), which reports itself as Debian, is not refused here, unlike the AMD driver ("host_unsupported" in Rex::GPU::AMD::Setup::Debian). On Proxmox VE 9.2 (Debian 13) neither source conflicts with pve-firmware: the only firmware they pull in, firmware-nvidia-gsp, is not among its conflicts, and they share no file; Proxmox VE 8 (Debian 12) was not checked. The linux-headers-$(uname -r) of "kernel_packages" in Rex::GPU::NVIDIA::Setup::Apt is no package for a Proxmox kernel; apt installs proxmox-headers-$(uname -r), which provides it, and the DKMS module is then built against the Proxmox kernel. Whether it builds there is not tested.
sources
In this order:
debian-nonfree--nvidia-driver+nvidia-smi+libcuda1from Debiannon-free, proprietary kernel module, verified bynvidia-driverandlibcuda1.libcuda1is named becausenvidia-driverpulls it only through recommends (libnvidia-encode1->libnvcuvid1), so a host withAPT::Install-Recommends "false"would get no CUDA library -- and without it "already_installed" in Rex::GPU::NVIDIA::Setup never counts the driver as installed. Its branch comes from "nonfree_branch"; on a release that table does not know it is unknown, which fits only a GPU without constraints.nvidia-cuda-repo-- NVIDIA's CUDA apt repository fordebian12ordebian13(x86_64for amd64,sbsafor arm64, keycuda_repo): the compute-only open-module setnvidia-driver-cuda+nvidia-kernel-open-dkms, both verified, the newest branch the repository carries, at least 590. Unavailable on any other release or architecture.
So a Blackwell or GH200 GPU (open module only: no Debian-packaged driver fits) gets the CUDA repository on Debian 12/13 and dies before the host is changed anywhere else. So does a GPU whose branch floor is above the release's non-free branch (see "generations" in Rex::GPU::NVIDIA::Requirement): on 12 (535) and 13 (550) a Turing to Hopper ID that NVIDIA listed first in a later branch gets the CUDA repository (on 12 e.g. the RTX 4070 SUPER or the H200), and on 11 (470) and a release "nonfree_branch" does not know every Ada and Hopper (520 or newer) and every such ID dies before the host is changed. Every other GPU gets non-free.
Neither package name carries the branch, so both sources name the package whose version is the driver's in driver_version_from: nvidia-driver (it depends on the kernel module of exactly its own version) and nvidia-kernel-open-dkms. Where the GPUs need a branch bound (a min_branch/max_branch -- e.g. Ada, Hopper, Blackwell, Maxwell/Pascal/Volta -- or a requirement with one), "verify_driver_branch" in Rex::GPU::NVIDIA::Setup reads its installed version with dpkg-query after the install and dies, the packages installed, before Fabric Manager, the nouveau blacklist and the initramfs when the branch does not fit -- e.g. a nvidia-kernel-open-dkms held at 550 for a Blackwell, or a nvidia-driver 590 from a configured CUDA repository for a V100. A nvidia-driver held at an older branch that still fits (535 for a V100) passes.
A host with NVSwitches ("nvswitches" in Rex::GPU::NVIDIA::Setup) needs NVIDIA Fabric Manager, which Debian does not package: non-free is rejected for it, and the CUDA repository installs nvidia-fabricmanager at the version of the installed nvidia-kernel-open-dkms. On Debian 11 such a host dies before it is changed.
An HGX B200/B300 ("nvlink_fabric_needed" in Rex::GPU::NVIDIA::Setup) is such a host too, and its NVLink fabric packages ("nvlink_fabric_packages" in Rex::GPU::NVIDIA::Setup::Apt: nvlsm from the same CUDA repository, infiniband-diags and libibumad3 from Debian) are installed after Fabric Manager; see "install_nvlink_fabric" in Rex::GPU::NVIDIA::Setup.
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-fabricmanager-NNN.
nvlink_fabric_unavailable
A reason unless the chosen driver source is NVIDIA's CUDA repository (nvlsm is in no Debian archive).
nonfree_branch
my $branch = $self->nonfree_branch($major); # 12 => 535
The driver branch of Debian's own nvidia-driver in a release: 11 (470), 12 (535), 13 (550); undef for any other. A fixed table (maintainer decision): looking it up with apt-cache would need non-free enabled first, a host change before the plan can fail. Override it for a release this table does not know.
plan
The base plan, plus $plan->{cuda_repo}: the chosen source's CUDA repository, or undef on the non-free path.
prepare_host
Enables contrib non-free non-free-firmware in Debian's own archive entries ("enable_nonfree") when the chosen source is non-free -- not on the CUDA-repo path, whose packages resolve from NVIDIA's repo plus Debian main, and must not mix with Debian's nvidia packages -- then the apt layer's step.
prepare_source
On the CUDA-repo path registers NVIDIA's repository ("add_nvidia_cuda_apt_repo") before the apt layer's apt-get update.
add_nvidia_cuda_apt_repo
$self->add_nvidia_cuda_apt_repo($repo);
Installs the cuda-keyring package of $repo (signing key plus the sources.list.d entry) with apt-get, and dies unless it is ii or hi (held) afterwards, not half configured -- without it the driver install could only fail with a misleading "unable to locate package".
enable_nonfree
Adds whichever of contrib, non-free, non-free-firmware is missing to every recognised Debian archive entry, in /etc/apt/sources.list first and then in the deb822 /etc/apt/sources.list.d/*.sources (both may be present). Third-party entries and unknown mirrors are left alone; a file with nothing to add is not rewritten. Warns if no Debian archive entry is recognised.
An entry is a Debian archive entry if it is an enabled deb entry (not deb-src) whose components include main, and
it has a
signed-byoption (Signed-By:in deb822) that names only keyrings "is_debian_archive_keyring" accepts -- whatever its URI: a repository signed with Debian's archive key is Debian's archive or a mirror of it. Any othersigned-by(a foreign keyring, an inline key) makes it a third-party entry, even on a Debian URI;or it has no
signed-by, and "is_debian_archive_uri" accepts every one of its URIs.
is_debian_archive_uri
return 1 if $self->is_debian_archive_uri($uri);
True if $uri is one of Debian's archives: a host debian.org or *.debian.org (deb, security, ftp.de, ...; any http, https, ftp, optionally with an apt transport prefix such as tor+), Hetzner's Debian mirror (mirror.hetzner.com or mirror.hetzner.de under /debian/), or the mirror+file:/etc/apt/mirrors/debian.list / debian-security.list indirection of Debian's cloud images. Any other URI is not.
"enable_nonfree" asks it only for entries without signed-by. A mirror of your own -- a company mirror, apt-cacher-ng, a national ftp.* host outside debian.org -- whose entries carry no signed-by=/usr/share/keyrings/debian-archive-keyring.gpg is not recognised, so non-free is not enabled and nvidia-driver has no installation candidate. Recognise it in a subclass (see "WRITING YOUR OWN SETUP" in Rex::GPU::NVIDIA::Setup, and eg/custom-setup/lib/My/GPU/DebianMirror.pm in the distribution):
package My::GPU::DebianMirror;
use Moo;
extends 'Rex::GPU::NVIDIA::Setup::Debian';
sub is_debian_archive_uri {
my ( $self, $uri ) = @_;
return 1 if $uri =~ m{^http://apt-cache\.corp\.example:3142/debian/?$};
return $self->SUPER::is_debian_archive_uri($uri);
}
# set gpu_nvidia_setup => 'My::GPU::DebianMirror';
Match only URIs that serve Debian's own archive: every entry with main that it accepts gets contrib non-free non-free-firmware added.
is_debian_archive_keyring
return 1 if $self->is_debian_archive_keyring($path);
True if the keyring file $path holds Debian's archive keys: by default a debian-archive-*.gpg, .pgp or .asc file directly under /usr/share/keyrings (what the debian-archive-keyring package ships). Override it for a mirror that is re-signed with a key of your own, whose entries name that keyring in signed-by -- for such an entry "is_debian_archive_uri" is not asked.
SEE ALSO
Rex::GPU::NVIDIA::Setup, "install_driver" in Rex::GPU::NVIDIA
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.