| 1 | # ABSTRACT: AMD driver setup for Debian 12 and 13 (experimental) | ||||||||||
| 2 | |||||||||||
| 3 | package Rex::GPU::AMD::Setup::Debian; | ||||||||||
| 4 | 40 | our $VERSION = '0.006'; | |||||||||
| 5 | 40 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 40 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 40 | extends 'Rex::GPU::AMD::Setup::Apt'; | |||||||||
| 9 | |||||||||||
| 10 | # Sources, checked 2026-10-30: | ||||||||||
| 11 | # ROCm 10.1 compatibility matrix (Instinct): Debian 13 kernel 6.12, Debian | ||||||||||
| 12 | # 12 kernel 6.1.0; no Radeon and no Ryzen APU support on Debian. Both | ||||||||||
| 13 | # die here, with either driver: radeon_unsupported and | ||||||||||
| 14 | # inbox_only_unsupported are inherited from Rex::GPU::AMD::Setup (k82); | ||||||||||
| 15 | # install_rocm refuses their gfx targets with them too (k91). | ||||||||||
| 16 | # amdgpu 31.60 install guide, Debian: the Ubuntu repository of | ||||||||||
| 17 | # repo.radeon.com, suite noble for Debian 13 and jammy for Debian 12; | ||||||||||
| 18 | # linux-headers-$K. | ||||||||||
| 19 | # Debian's firmware for amdgpu: firmware-amd-graphics (component | ||||||||||
| 20 | # non-free-firmware). | ||||||||||
| 21 | # Proxmox VE 9.2 (read-only on a live host, 2026-11-04, k81): os-release | ||||||||||
| 22 | # ID=debian VERSION_ID=13, kernel 7.0.14-20-pve with amdgpu.ko under | ||||||||||
| 23 | # kernel/; pve-firmware Conflicts and Replaces firmware-amd-graphics, and | ||||||||||
| 24 | # apt-get -s install firmware-amd-graphics removes proxmox-ve, | ||||||||||
| 25 | # proxmox-default-kernel, proxmox-kernel-7.0 and pve-firmware. | ||||||||||
| 26 | # install_rocm on the same host (read-only, 2026-11-05, k88): apt-get -s | ||||||||||
| 27 | # install libatomic1 libquadmath0 amdrocm10.1-gfx1151 -gfx1100 -gfx942 | ||||||||||
| 28 | # from the debian13 ROCm repository: 111 new, none removed, no firmware-* | ||||||||||
| 29 | # package. AMD's debian13 and debian12 indexes (2026-11-05): no package | ||||||||||
| 30 | # depends on or recommends a firmware package, and the Debian 13 closure | ||||||||||
| 31 | # (with recommends) of what they need from Debian holds none either. So | ||||||||||
| 32 | # install_rocm asks no host_unsupported. | ||||||||||
| 33 | 40 | my %RELEASE = ( | |||||||||
| 34 | '13' => { suite => 'noble', kernel => qr/\A6\.12\.\d+\+deb13(?:u\d+)?-amd64\z/, | ||||||||||
| 35 | kernel_text => '6.12 (6.12.N+deb13-amd64)', rocm => 'debian13' }, | ||||||||||
| 36 | '12' => { suite => 'jammy', kernel => qr/\A6\.1\.0-\d+-amd64\z/, | ||||||||||
| 37 | kernel_text => '6.1 (6.1.0-N-amd64)', rocm => 'debian12' }, | ||||||||||
| 38 | ); | ||||||||||
| 39 | |||||||||||
| 40 | |||||||||||
| 41 | 111 | ▶ | sub release_data { $RELEASE{ $_[0]->os_version } } | ||||||||
|
Subroutine
release_data: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 42 | |||||||||||
| 43 | 71 | ▶ | sub host_unsupported { | ||||||||
|
Subroutine
host_unsupported: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 44 | 71 | my ( $self ) = @_; | |||||||||
| 45 | 71 | ▶ | return unless $self->package_on_disk('pve-firmware'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 15 | return 'this is a Proxmox VE host (pve-firmware is installed): pve-firmware brings the amdgpu ' | |||||||||
| 47 | .'firmware itself and conflicts with firmware-amd-graphics, which apt would install only by ' | ||||||||||
| 48 | .'removing proxmox-ve and the Proxmox kernel, so install_driver installs no AMD driver on ' | ||||||||||
| 49 | .'Proxmox VE (a working amdgpu of the Proxmox kernel is answered with present)'; | ||||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 14 | ▶ | sub inbox_unsupported { | ||||||||
|
Subroutine
inbox_unsupported: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 53 | 14 | my ( $self ) = @_; | |||||||||
| 54 | 14 | ▶ | my $row = $self->release_data | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | or return 'the inbox amdgpu is supported on Debian 12 and 13 only, not '.$self->os_label; | ||||||||||
| 56 | 12 | ▶ | return if $self->kernel =~ $row->{kernel}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | return 'the inbox amdgpu is supported on '.$self->os_label." with Debian's own kernel " | ||||||||||
| 58 | 2 | .$row->{kernel_text}.' only; this host runs '.$self->kernel; | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | 35 | ▶ | sub dkms_suite { | ||||||||
|
Subroutine
dkms_suite: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 62 | 35 | my ( $self ) = @_; | |||||||||
| 63 | 35 | ▶ | my $row = $self->release_data or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 64 | 35 | return $row->{suite}; | |||||||||
| 65 | } | ||||||||||
| 66 | |||||||||||
| 67 | 36 | ▶ | sub dkms_unsupported { | ||||||||
|
Subroutine
dkms_unsupported: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 68 | 36 | my ( $self ) = @_; | |||||||||
| 69 | 36 | ▶ | my $row = $self->release_data | ||||||||
|
Branch: 1 branch
| |||||||||||
| 70 | or return 'amdgpu-dkms '.$self->amdgpu_release.' supports Debian 12 and 13, not '.$self->os_label; | ||||||||||
| 71 | 36 | ▶ | return if $self->kernel =~ $row->{kernel}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 72 | return 'amdgpu-dkms '.$self->amdgpu_release.' supports '.$self->os_label.' with kernel ' | ||||||||||
| 73 | 1 | .$row->{kernel_text}.'; this host runs '.$self->kernel; | |||||||||
| 74 | } | ||||||||||
| 75 | |||||||||||
| 76 | 35 | ▶ | sub kernel_header_packages { 'linux-headers-'.$_[0]->kernel } | ||||||||
|
Subroutine
kernel_header_packages: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 77 | |||||||||||
| 78 | 9 | ▶ | sub firmware_packages { 'firmware-amd-graphics' } | ||||||||
|
Subroutine
firmware_packages: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 79 | |||||||||||
| 80 | 26 | ▶ | sub rocm_repo_dir { | ||||||||
|
Subroutine
rocm_repo_dir: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 81 | 26 | my ( $self ) = @_; | |||||||||
| 82 | 26 | ▶ | my $row = $self->release_data or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 83 | 26 | return $row->{rocm}; | |||||||||
| 84 | } | ||||||||||
| 85 | |||||||||||
| 86 | 40 | 1; | |||||||||
| 87 | |||||||||||
| 88 | __END__ | ||||||||||