Proxmox-GPU-Passthough: Unterschied zwischen den Versionen
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 == | |||
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. | ||
{{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 == | |||
*Proxmox VE: | * '''Proxmox VE:''' [https://www.proxmox.com/de/downloads/proxmox-virtual-environment/iso Images] | ||
*vendor-reset: | * '''vendor-reset:''' [https://github.com/gnif/vendor-reset] | ||
*ROCm: | * '''ROCm:''' [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html] | ||
== Installation == | |||
=== 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 === | |||
* | * '''Server Hardware:''' | ||
# 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 | ||
# Ubuntu 24.04.3 | |||
Für Legacy Boot Systeme: | |||
== 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> | |||
Speichern und ausführen: | Speichern und ausführen: | ||
<syntaxhighlight lang="bash"> | |||
update-grub | update-grub | ||
</syntaxhighlight> | |||
'''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:''' | |||
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:''' | |||
Bei schlechter PCIe-Trennung: | Bei schlechter PCIe-Trennung: | ||
<syntaxhighlight lang="bash"> | |||
intel_iommu=on pcie_acs_override=downstream,multifunction # Oder amd_iommu=on | |||
</syntaxhighlight> | |||
Danach: | Danach: | ||
<syntaxhighlight lang="bash"> | |||
proxmox-boot-tool refresh | proxmox-boot-tool refresh | ||
</syntaxhighlight> | |||
==== VFIO Module laden ==== | |||
<syntaxhighlight lang="bash"> | |||
nano /etc/modules | nano /etc/modules | ||
</syntaxhighlight> | |||
Diese Zeilen hinzufügen: | Diese Zeilen hinzufügen: | ||
<syntaxhighlight lang="bash"> | |||
vfio | vfio | ||
vfio_iommu_type1 | vfio_iommu_type1 | ||
vfio_pci | vfio_pci | ||
vfio_virqfd | vfio_virqfd | ||
</syntaxhighlight> | |||
==== GPU finden und aktuellen Treiber identifizieren ==== | |||
<syntaxhighlight lang="bash"> | |||
# AMD GPU finden | # AMD GPU finden | ||
lspci | grep -i amd | grep -i | 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"> | |||
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 | ||
</syntaxhighlight> | |||
==== 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 | ||
</syntaxhighlight> | |||
==== 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 | ||
</syntaxhighlight> | |||
==== Änderungen anwenden und reboot ==== | |||
<syntaxhighlight lang="bash"> | |||
update-initramfs -u -k all | update-initramfs -u -k all | ||
reboot | reboot | ||
</syntaxhighlight> | |||
==== VFIO-Bindung überprüfen ==== | |||
<syntaxhighlight lang="bash"> | |||
lspci -n -s 08:00 -v | lspci -n -s 08:00 -v | ||
</syntaxhighlight> | |||
Sollte zeigen: <code>Kernel driver in use: vfio-pci</code> | |||
=== | === Teil 2: Die vendor-reset Lösung === | ||
==== 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 | ||
</syntaxhighlight> | |||
==== 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 | ||
</syntaxhighlight> | |||
==== 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 . | ||
</syntaxhighlight> | |||
==== 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 | ||
</syntaxhighlight> | |||
==== Reboot und Überprüfung ==== | |||
<syntaxhighlight lang="bash"> | |||
reboot | reboot | ||
</syntaxhighlight> | |||
Nach dem reboot: | Nach dem reboot: | ||
<syntaxhighlight lang="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"> | |||
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] | ||
</syntaxhighlight> | |||
{{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 | |||
{{Tip|Empfehlung: Machine Type q35 verwenden}} | |||
Empfehlung: Machine Type q35 verwenden | |||
==== 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"> | |||
# 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"> | |||
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 | ||
</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> | |||
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> | |||
=== Teil 4: ROCm Installation === | |||
==== ROCm installieren ==== | |||
<syntaxhighlight lang="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 | ||
</syntaxhighlight> | |||
==== 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 | ||
</syntaxhighlight> | |||
==== 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 | ||
</syntaxhighlight> | |||
{{Warning|VM nach ROCm Installation neustarten!}} | |||
==== ROCm Installation überprüfen ==== | |||
<syntaxhighlight lang="bash"> | |||
rocm-smi | rocm-smi | ||
</syntaxhighlight> | |||
Erwartete Ausgabe: | Erwartete Ausgabe: | ||
<syntaxhighlight lang="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 =================================================== | ||
</syntaxhighlight> | |||
== | == Fehlerbehebung == | ||
=== vendor-reset komplett entfernen === | |||
<syntaxhighlight lang="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 | ||
</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> | |||
=== Schlechte PCIe-Trennung auf Consumer Mainboards === | |||
Fehlende IOMMU-Trennung: | Fehlende IOMMU-Trennung: | ||
<syntaxhighlight lang="bash"> | |||
amd_iommu=on pcie_acs_override=downstream,multifunction | |||
</syntaxhighlight> | |||
=== Reset-Methode zeigt 'bus' statt 'device_specific' === | |||
Udev-Regeln überprüfen: | Udev-Regeln überprüfen: | ||
<syntaxhighlight lang="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 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Nützliche Codeschnipsel == | |||
== | == Nützliche Links == | ||
* | * [https://github.com/gnif/vendor-reset Original vendor-reset Repository] | ||
* | * [https://www.reddit.com/r/VFIO/comments/oxsku7/vfio_amd_vega20_gpu_passthrough_issues/ PCI BAR Größe Konfiguration] | ||
* | * [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] | |||
== 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 | |||
[[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.
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:
- 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:
- Ubuntu 22.04.5 Live Server (Headless), Kernel 5.15
- Ubuntu 24.04.3
Konfiguration
Teil 1: Standard PCIe Passthrough Setup
IOMMU aktivieren
Für Legacy Boot Systeme:
nano /etc/default/grubDiese Zeile hinzufügen:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on" # Oder für AMD: amd_iommu=onSpeichern und ausführen:
update-grubFür EFI Boot Systeme:
nano /etc/kernel/cmdlineHinzufügen:
intel_iommu=on # Oder für AMD: amd_iommu=onFü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=onFür Consumer Motherboards:
Bei schlechter PCIe-Trennung:
intel_iommu=on pcie_acs_override=downstream,multifunction # Oder amd_iommu=onDanach:
proxmox-boot-tool refreshVFIO Module laden
nano /etc/modulesDiese Zeilen hinzufügen:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfdGPU 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 -vBeispiel-Ausgabe:
08:00.0 0300: 1002:66a3 (prog-if 00 [VGA controller])
Kernel modules: amdgpuVFIO 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.confGPU 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
rebootVFIO-Bindung überprüfen
lspci -n -s 08:00 -vSollte 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 amdBuild-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)/buildvendor-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.koReboot und Überprüfung
rebootNach 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 amdErwartete 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]Teil 3: VM Konfiguration
GPU zur VM hinzufügen
Über Proxmox Web Interface:
- VM → Hardware → Add → PCI Device
- GPU auswählen (z.B. 0000:08:00)
- "All Functions" aktivieren
- Änderungen übernehmen
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=65536Vollstä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: 2VM 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 0Teil 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 rocmAMDGPU Kernel Modul installieren
# Kernel Headers und AMDGPU Treiber
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
sudo apt install amdgpu-dkmsPost-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/libROCm Installation überprüfen
rocm-smiErwartete 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
rebootZFS Boot-Konflikte
Bei Problemen mit ZFS und amd_iommu=on, kombiniere beides:
amd_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfsSchlechte PCIe-Trennung auf Consumer Mainboards
Fehlende IOMMU-Trennung:
amd_iommu=on pcie_acs_override=downstream,multifunctionReset-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-udevdNützliche Codeschnipsel
Nützliche Links
- Original vendor-reset Repository
- PCI BAR Größe Konfiguration
- AMD GPU Passthrough Diskussion
- ROCm Quick Start Installation Guide
- ROCm Post-Install Guide
- Proxmox PCIe Passthrough Video Guide
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