Proxmox-GPU-Passthough: Unterschied zwischen den Versionen

Aus XccesS Wiki
Zur Navigation springen Zur Suche springen
Die Seite wurde neu angelegt: „=== Beschreibung === Die AMD MI50 ist eine professionelle Instinct-GPU mit 32GB HBM2-Speicher und Vega20-Architektur, die speziell für High-Performance Computing und AI/ML-Workloads entwickelt wurde. Bei GPU Passthrough in Proxmox wird die komplette Hardware der VM zugewiesen, was maximale Performance für LLM-Inferenz und Training ermöglicht. Die MI50 bietet mit 32GB VRAM ausreichend Kapazität für große Sprachmodelle und unterstützt ROCm für AMD-s…“
 
KKeine Bearbeitungszusammenfassung
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
=== Beschreibung ===
== Beschreibung ==
Die AMD MI50 ist eine professionelle Instinct-GPU mit 32GB HBM2-Speicher und Vega20-Architektur, die speziell für High-Performance Computing und AI/ML-Workloads entwickelt wurde. Bei GPU Passthrough in Proxmox wird die komplette Hardware der VM zugewiesen, was maximale Performance für LLM-Inferenz und Training ermöglicht. Die MI50 bietet mit 32GB VRAM ausreichend Kapazität für große Sprachmodelle und unterstützt ROCm für AMD-spezifische Optimierungen.
Die AMD MI50 ist eine professionelle Instinct-GPU mit 32GB HBM2-Speicher und Vega20-Architektur, die speziell für High-Performance Computing und AI/ML-Workloads entwickelt wurde. Bei GPU Passthrough in Proxmox wird die komplette Hardware der VM zugewiesen, was maximale Performance für LLM-Inferenz und Training ermöglicht. Die MI50 bietet mit 32GB VRAM ausreichend Kapazität für große Sprachmodelle und unterstützt ROCm für AMD-spezifische Optimierungen.


**Was dieser Guide löst:** Behebt den "atombios stuck in loop" Fehler bei AMD Vega20 GPUs (MI50, Radeon Pro VII) durch Installation des vendor-reset Kernel-Moduls auf dem Proxmox Host.
{{Info|Was dieser Guide löst: Behebt den "atombios stuck in loop" Fehler bei AMD Vega20 GPUs (MI50, Radeon Pro VII) durch Installation des vendor-reset Kernel-Moduls auf dem Proxmox Host.}}


=== Download ===
== Download ==
*Proxmox VE:* [https://www.proxmox.com/de/downloads/proxmox-virtual-environment/iso Images]
* '''Proxmox VE:''' [https://www.proxmox.com/de/downloads/proxmox-virtual-environment/iso Images]
*vendor-reset:* [https://github.com/gnif/vendor-reset]
* '''vendor-reset:''' [https://github.com/gnif/vendor-reset]
*ROCm:* [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html]
* '''ROCm:''' [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html]


=== Installation ===
== Installation ==


==== Systemvoraussetzungen ====
=== Systemvoraussetzungen ===
* Proxmox VE 8.4.8 oder höher (getestet mit Kernel 6.8.12-13-pve)
* Proxmox VE 8.4.8 oder höher (getestet mit Kernel 6.8.12-13-pve) '''HINWEIS: Proxmox > 9 ist nicht mit Vendor-Reset Stand 20.10.25 kompatibel!'''
* AMD MI50 oder Radeon Pro VII (Vega20)
* AMD MI50 oder Radeon Pro VII (Vega20)
* IOMMU-fähiges Mainboard
* IOMMU-fähiges Mainboard
* Für ZFS-User: Spezielle Boot-Parameter beachten
* Für ZFS-User: Spezielle Boot-Parameter beachten


==== Getestete Konfiguration ====
=== Getestete Konfiguration ===
* **Server Hardware:** 56-core Intel Xeon E5-2680 v4 @ 2.40GHz (2 sockets), 110GB RAM
* '''Server Hardware:'''
* **Motherboard:** Supermicro X10DRU-i+
* **Software:** Proxmox VE 8.4.8 mit Kernel 6.8.12-13-pve (EFI Boot)
* **GPU:** AMD Radeon MI50 (Device ID: 66a3)
* **GPU Location:** PCI address 08:00.0
* **Guest VM:** Ubuntu 22.04.5 Live Server (Headless), Kernel 5.15


=== Konfiguration ===
# 56-core Intel Xeon E5-2680 v4 @ 2.40GHz (2 sockets), 110GB RAM
# AMD Epyc 7002 mit 64GB LRDIMM
* '''Motherboard:''' ASROCK RACK ROMED8-2T
* '''Software:''' Proxmox VE 8.4.8 mit Kernel 6.8.12-13-pve (EFI Boot)
* '''GPU:''' AMD Radeon MI50 32GB
* '''Guest VM:'''


==== Teil 1: Standard PCIe Passthrough Setup ====
# Ubuntu 22.04.5 Live Server (Headless), Kernel 5.15
===== IOMMU aktivieren =====
# Ubuntu 24.04.3
Für Legacy Boot Systeme:
 
```bash
== Konfiguration ==
 
=== Teil 1: Standard PCIe Passthrough Setup ===
 
==== IOMMU aktivieren ====
 
'''Für Legacy Boot Systeme:'''
<syntaxhighlight lang="bash">
nano /etc/default/grub
nano /etc/default/grub
</syntaxhighlight>
Diese Zeile hinzufügen:
Diese Zeile hinzufügen:
<syntaxhighlight lang="bash">
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"  # Oder für AMD: amd_iommu=on
</syntaxhighlight>


BASH
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on" # Oder für AMD: amd_iommu=on
Speichern und ausführen:
Speichern und ausführen:
 
<syntaxhighlight lang="bash">
BASH
update-grub
update-grub
Für EFI Boot Systeme:
</syntaxhighlight>


BASH
'''Für EFI Boot Systeme:'''
<syntaxhighlight lang="bash">
nano /etc/kernel/cmdline
nano /etc/kernel/cmdline
</syntaxhighlight>
Hinzufügen:
Hinzufügen:
<syntaxhighlight lang="bash">
intel_iommu=on  # Oder für AMD: amd_iommu=on
</syntaxhighlight>
'''Für ZFS Benutzer:'''


BASH
intel_iommu=on # Oder für AMD: amd_iommu=on
Für ZFS Benutzer:
Bei Boot-Problemen mit ZFS, kombiniere beide Parameter:
Bei Boot-Problemen mit ZFS, kombiniere beide Parameter:
<syntaxhighlight lang="bash">
intel_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfs  # Oder amd_iommu=on
</syntaxhighlight>
'''Für Consumer Motherboards:'''


BASH
intel_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfs # Oder amd_iommu=on
Für Consumer Motherboards:
Bei schlechter PCIe-Trennung:
Bei schlechter PCIe-Trennung:
<syntaxhighlight lang="bash">
intel_iommu=on pcie_acs_override=downstream,multifunction  # Oder amd_iommu=on
</syntaxhighlight>


BASH
intel_iommu=on pcie_acs_override=downstream,multifunction # Oder amd_iommu=on
Danach:
Danach:
 
<syntaxhighlight lang="bash">
BASH
proxmox-boot-tool refresh
proxmox-boot-tool refresh
===== VFIO Module laden =====
</syntaxhighlight>


BASH
==== VFIO Module laden ====
<syntaxhighlight lang="bash">
nano /etc/modules
nano /etc/modules
</syntaxhighlight>
Diese Zeilen hinzufügen:
Diese Zeilen hinzufügen:
 
<syntaxhighlight lang="bash">
BASH
vfio
vfio
vfio_iommu_type1
vfio_iommu_type1
vfio_pci
vfio_pci
vfio_virqfd
vfio_virqfd
===== GPU finden und aktuellen Treiber identifizieren =====
</syntaxhighlight>


BASH
==== GPU finden und aktuellen Treiber identifizieren ====
<syntaxhighlight lang="bash">
# AMD GPU finden
# AMD GPU finden
lspci | grep -i amd | grep -i vga
lspci | grep -i amd | grep -i VEGA


# Detaillierte Info (08:00 mit Ihrer PCI-Adresse ersetzen)
# Detaillierte Info (08:00 mit Ihrer PCI-Adresse ersetzen)
lspci -n -s 08:00 -v
lspci -n -s 08:00 -v
</syntaxhighlight>
Beispiel-Ausgabe:
Beispiel-Ausgabe:
 
<syntaxhighlight lang="text">
TEXT
08:00.0 0300: 1002:66a3 (prog-if 00 [VGA controller])
08:00.0 0300: 1002:66a3 (prog-if 00 [VGA controller])
Kernel modules: amdgpu
Kernel modules: amdgpu
===== VFIO konfigurieren und AMD-Treiber blacklisten =====
</syntaxhighlight>


BASH
==== VFIO konfigurieren und AMD-Treiber blacklisten ====
<syntaxhighlight lang="bash">
echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf
echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf
echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf
echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf
echo "blacklist amdgpu" >> /etc/modprobe.d/blacklist.conf
echo "blacklist amdgpu" >> /etc/modprobe.d/blacklist.conf
===== GPU an VFIO binden =====
</syntaxhighlight>


BASH
==== GPU an VFIO binden ====
<syntaxhighlight lang="bash">
# vendor:device ID von lspci-Ausgabe verwenden (z.B. 1002:66a3)
# vendor:device ID von lspci-Ausgabe verwenden (z.B. 1002:66a3)
echo "options vfio-pci ids=1002:66a3 disable_vga=1" > /etc/modprobe.d/vfio.conf
echo "options vfio-pci ids=1002:66a3 disable_vga=1" > /etc/modprobe.d/vfio.conf
===== Änderungen anwenden und reboot =====
</syntaxhighlight>


BASH
==== Änderungen anwenden und reboot ====
<syntaxhighlight lang="bash">
update-initramfs -u -k all
update-initramfs -u -k all
reboot
reboot
===== VFIO-Bindung überprüfen =====
</syntaxhighlight>


BASH
==== VFIO-Bindung überprüfen ====
<syntaxhighlight lang="bash">
lspci -n -s 08:00 -v
lspci -n -s 08:00 -v
Sollte zeigen: Kernel driver in use: vfio-pci
</syntaxhighlight>


==== Teil 2: Die vendor-reset Lösung ====
Sollte zeigen: <code>Kernel driver in use: vfio-pci</code>


===== System-Bereitschaft prüfen =====
=== Teil 2: Die vendor-reset Lösung ===


BASH
==== System-Bereitschaft prüfen ====
<syntaxhighlight lang="bash">
# Kernel-Version prüfen
# Kernel-Version prüfen
uname -r
uname -r
Zeile 121: Zeile 146:
# GPU Info erneut finden
# GPU Info erneut finden
lspci -nn | grep -i amd
lspci -nn | grep -i amd
===== Build-Abhängigkeiten installieren =====
</syntaxhighlight>


BASH
==== Build-Abhängigkeiten installieren ====
<syntaxhighlight lang="bash">
apt update
apt update
apt install -y git dkms build-essential
apt install -y git dkms build-essential
Zeile 132: Zeile 158:
# Überprüfen ob Headers vorhanden sind
# Überprüfen ob Headers vorhanden sind
ls -la /lib/modules/$(uname -r)/build
ls -la /lib/modules/$(uname -r)/build
===== vendor-reset bauen und installieren =====
</syntaxhighlight>


BASH
==== vendor-reset bauen und installieren ====
<syntaxhighlight lang="bash">
# Source herunterladen
# Source herunterladen
cd /tmp
cd /tmp
Zeile 147: Zeile 174:
# Modul bauen und installieren
# Modul bauen und installieren
sudo dkms install .
sudo dkms install .
===== vendor-reset für Boot konfigurieren =====
</syntaxhighlight>


BASH
==== vendor-reset für Boot konfigurieren ====
<syntaxhighlight lang="bash">
# vendor-reset beim Boot laden
# vendor-reset beim Boot laden
echo "vendor-reset" | sudo tee -a /etc/modules
echo "vendor-reset" | sudo tee -a /etc/modules
Zeile 161: Zeile 189:
# Modul-Datei prüfen
# Modul-Datei prüfen
ls -la /lib/modules/$(uname -r)/updates/dkms/vendor-reset.ko
ls -la /lib/modules/$(uname -r)/updates/dkms/vendor-reset.ko
===== Reboot und Überprüfung =====
</syntaxhighlight>


BASH
==== Reboot und Überprüfung ====
<syntaxhighlight lang="bash">
reboot
reboot
</syntaxhighlight>
Nach dem reboot:
Nach dem reboot:
 
<syntaxhighlight lang="bash">
BASH
# Prüfen ob vendor-reset geladen ist
# Prüfen ob vendor-reset geladen ist
lsmod | grep vendor_reset
lsmod | grep vendor_reset
Zeile 176: Zeile 206:
# GPU-Erkennung bestätigen
# GPU-Erkennung bestätigen
lspci -nn | grep -i amd
lspci -nn | grep -i amd
</syntaxhighlight>
Erwartete Ausgabe:
Erwartete Ausgabe:
 
<syntaxhighlight lang="text">
TEXT
vendor_reset             16384 0
vendor_reset 16384 0
device_specific
device_specific
08:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Vega 20 [Radeon Pro Vega II/Radeon Pro Vega II Duo] [1002:66a3]
08:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Vega 20 [Radeon Pro Vega II/Radeon Pro Vega II Duo] [1002:66a3]
Wichtig: Reset-Methode MUSS device_specific zeigen, nicht bus.
</syntaxhighlight>


==== Teil 3: VM Konfiguration ====
{{Warning|Reset-Methode MUSS <code>device_specific</code> zeigen, nicht <code>bus</code>.}}


===== GPU zur VM hinzufügen =====
=== Teil 3: VM Konfiguration ===
 
==== GPU zur VM hinzufügen ====
Über Proxmox Web Interface:
Über Proxmox Web Interface:
# VM → Hardware → Add → PCI Device
# GPU auswählen (z.B. 0000:08:00)
# "All Functions" aktivieren
# Änderungen übernehmen


VM → Hardware → Add → PCI Device
{{Tip|Empfehlung: Machine Type q35 verwenden}}
GPU auswählen (z.B. 0000:08:00)
"All Functions" aktivieren
Änderungen übernehmen
Empfehlung: Machine Type q35 verwenden


===== Großes VRAM handhaben =====
==== Großes VRAM handhaben ====
Für GPUs mit viel VRAM (32GB) PCI BAR Größe erhöhen:
Für GPUs mit viel VRAM (32GB) PCI BAR Größe erhöhen:
 
<syntaxhighlight lang="bash">
BASH
# VM-Konfigurationsdatei bearbeiten (/etc/pve/qemu-server/VMID.conf)
# VM-Konfigurationsdatei bearbeiten (/etc/pve/qemu-server/VMID.conf)
args: -cpu host,host-phys-bits=on -fw_cfg opt/ovmf/X-PciMmio64Mb,string=65536
args: -cpu host,host-phys-bits=on -fw_cfg opt/ovmf/X-PciMmio64Mb,string=65536
</syntaxhighlight>
Vollständige funktionierende VM-Konfiguration:
Vollständige funktionierende VM-Konfiguration:
 
<syntaxhighlight lang="bash">
BASH
args: -cpu host,host-phys-bits=on -fw_cfg opt/ovmf/X-PciMmio64Mb,string=65536
args: -cpu host,host-phys-bits=on -fw_cfg opt/ovmf/X-PciMmio64Mb,string=65536
bios: seabios
bios: seabios
Zeile 219: Zeile 252:
scsihw: virtio-scsi-single
scsihw: virtio-scsi-single
sockets: 2
sockets: 2
===== VM testen =====
</syntaxhighlight>
 
==== VM testen ====
In der Ubuntu VM die Logs prüfen:
In der Ubuntu VM die Logs prüfen:
<syntaxhighlight lang="bash">
sudo dmesg | grep -i "amdgpu" | grep -i -E "bios|initialized|firmware"
</syntaxhighlight>


BASH
sudo dmesg | grep -i "amdgpu" | grep -i -E "bios|initialized|firmware"
Erwartete Ausgabe bei korrekter Funktion:
Erwartete Ausgabe bei korrekter Funktion:
<syntaxhighlight lang="text">
[  28.319860] [drm] initializing kernel modesetting (VEGA20 0x1002:0x66A1 0x1002:0x0834 0x02).
[  28.354277] amdgpu 0000:05:00.0: amdgpu: Fetched VBIOS from ROM BAR
[  28.354283] amdgpu: ATOM BIOS: 113-D1631700-111
[  28.361352] amdgpu 0000:05:00.0: amdgpu: MEM ECC is active.
[  28.361354] amdgpu 0000:05:00.0: amdgpu: SRAM ECC is active.
[  29.376346] [drm] Initialized amdgpu 3.57.0 20150101 for 0000:05:00.0 on minor 0
</syntaxhighlight>


TEXT
=== Teil 4: ROCm Installation ===
[ 28.319860] [drm] initializing kernel modesetting (VEGA20 0x1002:0x66A1 0x1002:0x0834 0x02).
[ 28.354277] amdgpu 0000:05:00.0: amdgpu: Fetched VBIOS from ROM BAR
[ 28.354283] amdgpu: ATOM BIOS: 113-D1631700-111
[ 28.361352] amdgpu 0000:05:00.0: amdgpu: MEM ECC is active.
[ 28.361354] amdgpu 0000:05:00.0: amdgpu: SRAM ECC is active.
[ 29.376346] [drm] Initialized amdgpu 3.57.0 20150101 for 0000:05:00.0 on minor 0
==== Teil 4: ROCm Installation ====


===== ROCm installieren =====
==== ROCm installieren ====
 
<syntaxhighlight lang="bash">
BASH
# amdgpu-install Package herunterladen
# amdgpu-install Package herunterladen
wget https://repo.radeon.com/amdgpu-install/6.4.3/ubuntu/jammy/amdgpu-install_6.4.60403-1_all.deb
wget https://repo.radeon.com/amdgpu-install/6.4.3/ubuntu/jammy/amdgpu-install_6.4.60403-1_all.deb
Zeile 251: Zeile 287:
# ROCm installieren
# ROCm installieren
sudo apt install rocm
sudo apt install rocm
===== AMDGPU Kernel Modul installieren =====
</syntaxhighlight>


BASH
==== AMDGPU Kernel Modul installieren ====
<syntaxhighlight lang="bash">
# Kernel Headers und AMDGPU Treiber
# Kernel Headers und AMDGPU Treiber
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
sudo apt install amdgpu-dkms
sudo apt install amdgpu-dkms
===== Post-Installation Setup =====
</syntaxhighlight>


BASH
==== Post-Installation Setup ====
<syntaxhighlight lang="bash">
# Library Pfade einrichten
# Library Pfade einrichten
sudo tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
sudo tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
Zeile 272: Zeile 310:
# Environment Variable setzen
# Environment Variable setzen
export LD_LIBRARY_PATH=/opt/rocm-6.4.3/lib
export LD_LIBRARY_PATH=/opt/rocm-6.4.3/lib
VM nach ROCm Installation neustarten!
</syntaxhighlight>


===== ROCm Installation überprüfen =====
{{Warning|VM nach ROCm Installation neustarten!}}


BASH
==== ROCm Installation überprüfen ====
<syntaxhighlight lang="bash">
rocm-smi
rocm-smi
</syntaxhighlight>
Erwartete Ausgabe:
Erwartete Ausgabe:
 
<syntaxhighlight lang="text">
TEXT
============================================ ROCm System Management Interface ============================================
============================================ ROCm System Management Interface ============================================
====================================================== Concise Info ======================================================
====================================================== Concise Info ======================================================
Device Node IDs Temp Power Partitions SCLK MCLK Fan Perf PwrCap VRAM% GPU% (DID, GUID) (Edge) (Socket) (Mem, Compute, ID)  
Device Node IDs             Temp       Power     Partitions         SCLK     MCLK     Fan   Perf PwrCap VRAM% GPU%
              (DID,     GUID) (Edge)     (Socket) (Mem, Compute, ID)                                                
==========================================================================================================================
==========================================================================================================================
0 2 0x66a3, 18520 51.0°C 26.0W N/A, N/A, 0 1000Mhz 1000Mhz 16.08% auto 300.0W 0% 0%
0       2     0x66a3,   18520 51.0°C     26.0W     N/A, N/A, 0         1000Mhz 1000Mhz 16.08% auto 300.0W 0%     0%
==========================================================================================================================
==========================================================================================================================
================================================= End of ROCm SMI Log ===================================================
================================================= End of ROCm SMI Log ===================================================
=== Update ===
</syntaxhighlight>


=== Test ===
== Fehlerbehebung ==


=== Fehlerbehebung ===
=== vendor-reset komplett entfernen ===
 
<syntaxhighlight lang="bash">
==== vendor-reset komplett entfernen ====
 
BASH
# DKMS Modul entfernen
# DKMS Modul entfernen
sudo dkms remove vendor-reset/0.1.1 --all
sudo dkms remove vendor-reset/0.1.1 --all
Zeile 309: Zeile 347:
sudo update-initramfs -u -k all
sudo update-initramfs -u -k all
reboot
reboot
==== ZFS Boot-Konflikte ====
</syntaxhighlight>
 
=== ZFS Boot-Konflikte ===
Bei Problemen mit ZFS und amd_iommu=on, kombiniere beides:
Bei Problemen mit ZFS und amd_iommu=on, kombiniere beides:
<syntaxhighlight lang="bash">
amd_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfs
</syntaxhighlight>


BASH
=== Schlechte PCIe-Trennung auf Consumer Mainboards ===
amd_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfs
==== Schlechte PCIe-Trennung auf Consumer Mainboards ====
Fehlende IOMMU-Trennung:
Fehlende IOMMU-Trennung:
<syntaxhighlight lang="bash">
amd_iommu=on pcie_acs_override=downstream,multifunction
</syntaxhighlight>


BASH
=== Reset-Methode zeigt 'bus' statt 'device_specific' ===
amd_iommu=on pcie_acs_override=downstream,multifunction
==== Reset-Methode zeigt 'bus' statt 'device_specific' ====
Udev-Regeln überprüfen:
Udev-Regeln überprüfen:
 
<syntaxhighlight lang="bash">
BASH
sudo cp udev/99-vendor-reset.rules /etc/udev/rules.d/
sudo cp udev/99-vendor-reset.rules /etc/udev/rules.d/
sudo systemctl restart systemd-udevd
sudo systemctl restart systemd-udevd
=== Codeschnipsel ===
==== Disk in VM erweitern ====
Angenommen, wir wollten /dev/sda3 erweitern:
<syntaxhighlight lang="bash" line="1">
fdisk -l /dev/sda
d
3
n
3
Enter
Do you want to remove the signature? [Y]es/[N]o: N
w
reboot
</syntaxhighlight>
Dann weiter mit
<syntaxhighlight lang="bash" line="1">
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv
</syntaxhighlight>
</syntaxhighlight>


=== Nützliche Links ===
== Nützliche Codeschnipsel ==
 
Original vendor-reset Repository: [https://github.com/gnif/vendor-reset]
PCI BAR Größe Konfiguration: [https://www.reddit.com/r/VFIO/comments/oxsku7/vfio_amd_vega20_gpu_passthrough_issues/]
AMD GPU Passthrough Diskussion: [https://github.com/ROCm/amdgpu/issues/157]
ROCm Quick Start Installation Guide: [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html]
ROCm Post-Install Guide: [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html]
Proxmox PCIe Passthrough Video Guide: [https://www.youtube.com/watch?v=_hOBAGKLQkI]


=== Credits ===
== Nützliche Links ==
*Original solution by gnif: [https://github.com/gnif/vendor-reset]
* [https://github.com/gnif/vendor-reset Original vendor-reset Repository]
*Contributions by Danternas for ZFS and consumer motherboard fixes
* [https://www.reddit.com/r/VFIO/comments/oxsku7/vfio_amd_vega20_gpu_passthrough_issues/ PCI BAR Größe Konfiguration]
*Community feedback from r/LocalLLaMA and r/Proxmox
* [https://github.com/ROCm/amdgpu/issues/157 AMD GPU Passthrough Diskussion]
* [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html ROCm Quick Start Installation Guide]
* [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/post-install.html ROCm Post-Install Guide]
* [https://www.youtube.com/watch?v=_hOBAGKLQkI Proxmox PCIe Passthrough Video Guide]


TEXT
== Credits ==
* Original solution by gnif: [https://github.com/gnif/vendor-reset]
* Contributions by Danternas for ZFS and consumer motherboard fixes
* Community feedback from r/LocalLLaMA and r/Proxmox


Diese Doku-Wiki-Seite enthält die vollständige AMD MI50 GPU Passthrough-Anleitung basierend auf dem Reddit-Post, strukturiert nach Ihrem Template mit allen wichtigen Details für die erfolgreiche Konfiguration in Proxmox.
[[index.php?title=Kategorie:Proxmox]]
[[index.php?title=Kategorie:GPU]]
[[index.php?title=Kategorie:Passthrough]]
[[index.php?title=Kategorie:AMD]]
[[index.php?title=Kategorie:ROCm]]

Aktuelle Version vom 30. Oktober 2025, 23:57 Uhr

Beschreibung

Die AMD MI50 ist eine professionelle Instinct-GPU mit 32GB HBM2-Speicher und Vega20-Architektur, die speziell für High-Performance Computing und AI/ML-Workloads entwickelt wurde. Bei GPU Passthrough in Proxmox wird die komplette Hardware der VM zugewiesen, was maximale Performance für LLM-Inferenz und Training ermöglicht. Die MI50 bietet mit 32GB VRAM ausreichend Kapazität für große Sprachmodelle und unterstützt ROCm für AMD-spezifische Optimierungen.

Vorlage:Info

Download

Installation

Systemvoraussetzungen

  • Proxmox VE 8.4.8 oder höher (getestet mit Kernel 6.8.12-13-pve) HINWEIS: Proxmox > 9 ist nicht mit Vendor-Reset Stand 20.10.25 kompatibel!
  • AMD MI50 oder Radeon Pro VII (Vega20)
  • IOMMU-fähiges Mainboard
  • Für ZFS-User: Spezielle Boot-Parameter beachten

Getestete Konfiguration

  • Server Hardware:
  1. 56-core Intel Xeon E5-2680 v4 @ 2.40GHz (2 sockets), 110GB RAM
  2. AMD Epyc 7002 mit 64GB LRDIMM
  • Motherboard: ASROCK RACK ROMED8-2T
  • Software: Proxmox VE 8.4.8 mit Kernel 6.8.12-13-pve (EFI Boot)
  • GPU: AMD Radeon MI50 32GB
  • Guest VM:
  1. Ubuntu 22.04.5 Live Server (Headless), Kernel 5.15
  2. Ubuntu 24.04.3

Konfiguration

Teil 1: Standard PCIe Passthrough Setup

IOMMU aktivieren

Für Legacy Boot Systeme:

nano /etc/default/grub

Diese Zeile hinzufügen:

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"  # Oder für AMD: amd_iommu=on

Speichern und ausführen:

update-grub

Für EFI Boot Systeme:

nano /etc/kernel/cmdline

Hinzufügen:

intel_iommu=on  # Oder für AMD: amd_iommu=on

Für ZFS Benutzer:

Bei Boot-Problemen mit ZFS, kombiniere beide Parameter:

intel_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfs  # Oder amd_iommu=on

Für Consumer Motherboards:

Bei schlechter PCIe-Trennung:

intel_iommu=on pcie_acs_override=downstream,multifunction  # Oder amd_iommu=on

Danach:

proxmox-boot-tool refresh

VFIO Module laden

nano /etc/modules

Diese Zeilen hinzufügen:

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

GPU finden und aktuellen Treiber identifizieren

# AMD GPU finden
lspci | grep -i amd | grep -i VEGA

# Detaillierte Info (08:00 mit Ihrer PCI-Adresse ersetzen)
lspci -n -s 08:00 -v

Beispiel-Ausgabe:

08:00.0 0300: 1002:66a3 (prog-if 00 [VGA controller])
Kernel modules: amdgpu

VFIO konfigurieren und AMD-Treiber blacklisten

echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf
echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf
echo "blacklist amdgpu" >> /etc/modprobe.d/blacklist.conf

GPU an VFIO binden

# vendor:device ID von lspci-Ausgabe verwenden (z.B. 1002:66a3)
echo "options vfio-pci ids=1002:66a3 disable_vga=1" > /etc/modprobe.d/vfio.conf

Änderungen anwenden und reboot

update-initramfs -u -k all
reboot

VFIO-Bindung überprüfen

lspci -n -s 08:00 -v

Sollte zeigen: Kernel driver in use: vfio-pci

Teil 2: Die vendor-reset Lösung

System-Bereitschaft prüfen

# Kernel-Version prüfen
uname -r

# Erforderliche Features überprüfen (alle sollten 'y' zeigen)
grep -E "CONFIG_FTRACE=|CONFIG_KPROBES=|CONFIG_PCI_QUIRKS=|CONFIG_KALLSYMS=|CONFIG_KALLSYMS_ALL=|CONFIG_FUNCTION_TRACER=" /boot/config-$(uname -r)

# GPU Info erneut finden
lspci -nn | grep -i amd

Build-Abhängigkeiten installieren

apt update
apt install -y git dkms build-essential

# Proxmox Kernel Headers installieren
apt install -y pve-headers-$(uname -r)

# Überprüfen ob Headers vorhanden sind
ls -la /lib/modules/$(uname -r)/build

vendor-reset bauen und installieren

# Source herunterladen
cd /tmp
git clone https://github.com/gnif/vendor-reset.git
cd vendor-reset

# Alte Versuche aufräumen
sudo dkms remove vendor-reset/0.1.1 --all 2>/dev/null || true
sudo rm -rf /usr/src/vendor-reset-0.1.1
sudo rm -rf /var/lib/dkms/vendor-reset

# Modul bauen und installieren
sudo dkms install .

vendor-reset für Boot konfigurieren

# vendor-reset beim Boot laden
echo "vendor-reset" | sudo tee -a /etc/modules

# udev Regeln kopieren
sudo cp udev/99-vendor-reset.rules /etc/udev/rules.d/

# initramfs aktualisieren
sudo update-initramfs -u -k all

# Modul-Datei prüfen
ls -la /lib/modules/$(uname -r)/updates/dkms/vendor-reset.ko

Reboot und Überprüfung

reboot

Nach dem reboot:

# Prüfen ob vendor-reset geladen ist
lsmod | grep vendor_reset

# Reset-Methode für GPU prüfen (PCI-Adresse anpassen)
cat /sys/bus/pci/devices/0000:08:00.0/reset_method

# GPU-Erkennung bestätigen
lspci -nn | grep -i amd

Erwartete Ausgabe:

vendor_reset             16384  0
device_specific
08:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Vega 20 [Radeon Pro Vega II/Radeon Pro Vega II Duo] [1002:66a3]

Vorlage:Warning

Teil 3: VM Konfiguration

GPU zur VM hinzufügen

Über Proxmox Web Interface:

  1. VM → Hardware → Add → PCI Device
  2. GPU auswählen (z.B. 0000:08:00)
  3. "All Functions" aktivieren
  4. Änderungen übernehmen

Vorlage:Tip

Großes VRAM handhaben

Für GPUs mit viel VRAM (32GB) PCI BAR Größe erhöhen:

# VM-Konfigurationsdatei bearbeiten (/etc/pve/qemu-server/VMID.conf)
args: -cpu host,host-phys-bits=on -fw_cfg opt/ovmf/X-PciMmio64Mb,string=65536

Vollständige funktionierende VM-Konfiguration:

args: -cpu host,host-phys-bits=on -fw_cfg opt/ovmf/X-PciMmio64Mb,string=65536
bios: seabios
boot: order=scsi0;hostpci0;net0
cores: 8
cpu: host
hostpci0: 0000:08:00
machine: q35
memory: 32768
name: AI-Node
net0: virtio=XX:XX:XX:XX:XX:XX,bridge=vmbr0,tag=40
numa: 1
ostype: l26
scsi0: local-lvm:vm-106-disk-0,cache=writeback,iothread=1,size=300G,ssd=1
scsihw: virtio-scsi-single
sockets: 2

VM testen

In der Ubuntu VM die Logs prüfen:

sudo dmesg | grep -i "amdgpu" | grep -i -E "bios|initialized|firmware"

Erwartete Ausgabe bei korrekter Funktion:

[   28.319860] [drm] initializing kernel modesetting (VEGA20 0x1002:0x66A1 0x1002:0x0834 0x02).
[   28.354277] amdgpu 0000:05:00.0: amdgpu: Fetched VBIOS from ROM BAR
[   28.354283] amdgpu: ATOM BIOS: 113-D1631700-111
[   28.361352] amdgpu 0000:05:00.0: amdgpu: MEM ECC is active.
[   28.361354] amdgpu 0000:05:00.0: amdgpu: SRAM ECC is active.
[   29.376346] [drm] Initialized amdgpu 3.57.0 20150101 for 0000:05:00.0 on minor 0

Teil 4: ROCm Installation

ROCm installieren

# amdgpu-install Package herunterladen
wget https://repo.radeon.com/amdgpu-install/6.4.3/ubuntu/jammy/amdgpu-install_6.4.60403-1_all.deb
sudo apt install ./amdgpu-install_6.4.60403-1_all.deb
sudo apt update

# Erforderliche Python Packages
sudo apt install python3-setuptools python3-wheel

# Benutzer zu richtigen Gruppen hinzufügen
sudo usermod -a -G render,video $LOGNAME

# ROCm installieren
sudo apt install rocm

AMDGPU Kernel Modul installieren

# Kernel Headers und AMDGPU Treiber
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
sudo apt install amdgpu-dkms

Post-Installation Setup

# Library Pfade einrichten
sudo tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
/opt/rocm/lib
/opt/rocm/lib64
EOF
sudo ldconfig

# ROCm Installation prüfen
sudo update-alternatives --display rocm

# Environment Variable setzen
export LD_LIBRARY_PATH=/opt/rocm-6.4.3/lib

Vorlage:Warning

ROCm Installation überprüfen

rocm-smi

Erwartete Ausgabe:

============================================ ROCm System Management Interface ============================================
====================================================== Concise Info ======================================================
Device  Node  IDs              Temp        Power     Partitions          SCLK     MCLK     Fan    Perf  PwrCap  VRAM%  GPU%
              (DID,     GUID)  (Edge)      (Socket)  (Mem, Compute, ID)                                                  
==========================================================================================================================
0       2     0x66a3,   18520  51.0°C      26.0W     N/A, N/A, 0         1000Mhz  1000Mhz  16.08% auto  300.0W  0%     0%
==========================================================================================================================
================================================= End of ROCm SMI Log ===================================================

Fehlerbehebung

vendor-reset komplett entfernen

# DKMS Modul entfernen
sudo dkms remove vendor-reset/0.1.1 --all
sudo rm -rf /usr/src/vendor-reset-0.1.1
sudo rm -rf /var/lib/dkms/vendor-reset

# Konfigurationsdateien entfernen
sudo sed -i '/vendor-reset/d' /etc/modules
sudo rm -f /etc/udev/rules.d/99-vendor-reset.rules

# initramfs aktualisieren und reboot
sudo update-initramfs -u -k all
reboot

ZFS Boot-Konflikte

Bei Problemen mit ZFS und amd_iommu=on, kombiniere beides:

amd_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfs

Schlechte PCIe-Trennung auf Consumer Mainboards

Fehlende IOMMU-Trennung:

amd_iommu=on pcie_acs_override=downstream,multifunction

Reset-Methode zeigt 'bus' statt 'device_specific'

Udev-Regeln überprüfen:

sudo cp udev/99-vendor-reset.rules /etc/udev/rules.d/
sudo systemctl restart systemd-udevd

Nützliche Codeschnipsel

Nützliche Links

Credits

  • Original solution by gnif: [3]
  • Contributions by Danternas for ZFS and consumer motherboard fixes
  • Community feedback from r/LocalLLaMA and r/Proxmox

index.php?title=Kategorie:Proxmox index.php?title=Kategorie:GPU index.php?title=Kategorie:Passthrough index.php?title=Kategorie:AMD index.php?title=Kategorie:ROCm