NAME

Rex::GPU::NVIDIA::Setup::UbuntuDrivers - NVIDIA driver setup for Ubuntu, package named by ubuntu-drivers (experimental)

VERSION

version 0.004

SYNOPSIS

use Rex::GPU;

# per call
gpu_setup(setup => 'Rex::GPU::NVIDIA::Setup::UbuntuDrivers');

# or for the whole Rexfile -- also reaches Rex::Rancher's gpu => 1
set gpu_nvidia_setup => 'Rex::GPU::NVIDIA::Setup::UbuntuDrivers';

DESCRIPTION

Experimental, like Rex::GPU::NVIDIA::Setup. Opt-in: the Ubuntu default ("setup_class_for_os" in Rex::GPU::NVIDIA) stays Rex::GPU::NVIDIA::Setup::Ubuntu; this class is used only when chosen with the setup option or set gpu_nvidia_setup. For Ubuntu hosts only.

The driver package is named by Ubuntu's own ubuntu-drivers list --gpgpu instead of apt-cache search for the newest -server package ("resolve_source"). Everything else is inherited from Rex::GPU::NVIDIA::Setup::Ubuntu: which source fits the GPUs (-server, -server-open, the pinned 580 for Maxwell/Pascal/Volta), the requirement check of the named package, the running kernel's headers only, the dpkg lock timeout, the apt timer stop, and the driver install itself -- apt-get install directly, verified with dpkg -l. ubuntu-drivers install is never run: its package choice and exit code could not be verified.

prepare_source

The inherited step (apt-get update), then -- only when the chosen source is resolved by "resolve_source", i.e. carries a search pattern -- ubuntu-drivers-common unless ubuntu-drivers is already on the PATH. An inert helper: apt-get install -y --no-upgrade with the dpkg lock timeout and auto_die => 0, not verified here; if the command is still missing, "resolve_source" says so and the install dies before any driver package.

resolve_source

For a source with a search pattern (ubuntu-server, ubuntu-server-open, see "sources" in Rex::GPU::NVIDIA::Setup::Ubuntu): ubuntu-drivers list --gpgpu, read-only (it reads the GPU modaliases in sysfs and the apt index, it installs nothing), names the package. Of the lines it prints -- nvidia-driver-NNN-server or nvidia-driver-NNN-server-open, optionally followed by , (kernel modules provided by ...) -- the one with the highest NNN of the source's kernel module flavour is taken; returns the source with that one package (installed and verified) and its branch.

Makes the source unavailable, so that "resolve_plan" in Rex::GPU::NVIDIA::Setup dies before any driver package is installed, when:

  • ubuntu-drivers is not on the PATH (the ubuntu-drivers-common install of "prepare_source" failed);

  • ubuntu-drivers list --gpgpu exits non-zero;

  • it names no package of the source's flavour.

There is no fallback to apt-cache search and no other source is tried. The package it names is checked against the GPUs' requirement like any other (a Blackwell still refuses a proprietary package). Any other source (the pinned ubuntu-server-580) resolves as in "resolve_source" in Rex::GPU::NVIDIA::Setup::Ubuntu, with its candidate check.

SEE ALSO

Rex::GPU::NVIDIA::Setup::Ubuntu, 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.