|
|
| 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.
| | Proxmox VE ist eine kostenlose Open-Source-Virtualisierungsplattform auf Debian-Basis, die sowohl KVM für vollständige Hardware-Virtualisierung als auch LXC für leichtgewichtige Linux-Container unterstützt. Über das webbasierte Management-Interface können Administratoren VMs und Container zentral verwalten, Live-Migrationen durchführen und verschiedene Storage-Lösungen integrieren, was es zu einer kostengünstigen Alternative zu kommerziellen Hypervisoren wie VMware macht. Besonders populär ist Proxmox in kleinen und mittleren Unternehmen sowie Home-Lab-Umgebungen, da es enterprise-fähige Funktionen wie Clustering, High Availability und automatisierte Backups ohne Lizenzkosten bietet. |
| | |
| **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]
| | [https://www.proxmox.com/de/downloads/proxmox-virtual-environment/iso Images] |
| *vendor-reset:* [https://github.com/gnif/vendor-reset]
| |
| *ROCm:* [https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html]
| |
| | |
| === Installation === | | === Installation === |
|
| |
| ==== Systemvoraussetzungen ====
| |
| * Proxmox VE 8.4.8 oder höher (getestet mit Kernel 6.8.12-13-pve)
| |
| * 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
| |
| * **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 === | | === Konfiguration === |
| | ==== GPU Passthrough ==== |
| | lspci |
| | root@proxmox:~# lspci -n -s 83:00 -v |
| | 83:00.0 0380: 1002:66a1 (rev 02) |
| | Subsystem: 1002:0834 |
| | Flags: fast devsel, IRQ 49, IOMMU group 13 |
| | Memory at 47000000000 (64-bit, prefetchable) [size=32G] |
| | Memory at 47800000000 (64-bit, prefetchable) [size=2M] |
| | Memory at c2000000 (32-bit, non-prefetchable) [size=512K] |
| | Expansion ROM at c2080000 [disabled] [size=128K] |
| | Capabilities: [48] Vendor Specific Information: Len=08 <?> |
| | Capabilities: [50] Power Management version 3 |
| | Capabilities: [64] Express Legacy Endpoint, IntMsgNum 0 |
| | Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+ |
| | Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?> |
| | Capabilities: [150] Advanced Error Reporting |
| | Capabilities: [270] Secondary PCI Express |
| | Capabilities: [2a0] Access Control Services |
| | Capabilities: [2b0] Address Translation Service (ATS) |
| | Capabilities: [2c0] Page Request Interface (PRI) |
| | Capabilities: [2d0] Process Address Space ID (PASID) |
| | Capabilities: [320] Latency Tolerance Reporting |
| | Capabilities: [400] Data Link Feature <?> |
| | Capabilities: [410] Physical Layer 16.0 GT/s <?> |
| | Capabilities: [440] Lane Margining at the Receiver |
| | Kernel driver in use: vfio-pci |
| | Kernel modules: amdgpu |
|
| |
|
| ==== Teil 1: Standard PCIe Passthrough Setup ====
| | root@proxmox:~# echo "options vfio-pci ids=1002:66a1 disable_vga=1" > /etc/modprobe.d/vfio.conf #PCI Gerät für den Host blacklisten |
| ===== IOMMU aktivieren =====
| | root@proxmox:~# echo "blacklist amdgpu" >> /etc/modprobe.d/blacklist.conf #alle aufgelisteten Kernel-modules blacklisten für den Host |
| Für Legacy Boot Systeme:
| | root@proxmox:~# update-initramfs -u -k all |
| ```bash
| |
| nano /etc/default/grub
| |
| Diese Zeile hinzufügen:
| |
| | |
| BASH
| |
| GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on" # Oder für AMD: amd_iommu=on
| |
| Speichern und ausführen:
| |
| | |
| BASH
| |
| update-grub
| |
| Für EFI Boot Systeme:
| |
| | |
| BASH
| |
| nano /etc/kernel/cmdline
| |
| Hinzufügen:
| |
| | |
| BASH
| |
| intel_iommu=on # Oder für AMD: amd_iommu=on
| |
| Für ZFS Benutzer:
| |
| Bei Boot-Problemen mit ZFS, kombiniere beide Parameter:
| |
| | |
| BASH
| |
| intel_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfs # Oder amd_iommu=on
| |
| Für Consumer Motherboards:
| |
| Bei schlechter PCIe-Trennung:
| |
| | |
| BASH
| |
| intel_iommu=on pcie_acs_override=downstream,multifunction # Oder amd_iommu=on
| |
| Danach:
| |
| | |
| BASH
| |
| proxmox-boot-tool refresh | |
| ===== VFIO Module laden =====
| |
| | |
| BASH
| |
| nano /etc/modules
| |
| Diese Zeilen hinzufügen:
| |
| | |
| BASH
| |
| vfio
| |
| vfio_iommu_type1
| |
| vfio_pci
| |
| vfio_virqfd
| |
| ===== GPU finden und aktuellen Treiber identifizieren =====
| |
| | |
| BASH
| |
| # AMD GPU finden | |
| lspci | grep -i amd | grep -i vga
| |
| | |
| # Detaillierte Info (08:00 mit Ihrer PCI-Adresse ersetzen)
| |
| lspci -n -s 08:00 -v
| |
| Beispiel-Ausgabe:
| |
| | |
| TEXT
| |
| 08:00.0 0300: 1002:66a3 (prog-if 00 [VGA controller])
| |
| Kernel modules: amdgpu
| |
| ===== VFIO konfigurieren und AMD-Treiber blacklisten =====
| |
| | |
| BASH
| |
| 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 =====
| |
| | |
| BASH
| |
| # 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 =====
| |
| | |
| BASH
| |
| update-initramfs -u -k all
| |
| reboot
| |
| ===== VFIO-Bindung überprüfen =====
| |
| | |
| BASH
| |
| 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 =====
| |
| | |
| BASH
| |
| # 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 =====
| |
| | |
| BASH
| |
| 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 =====
| |
| | |
| BASH
| |
| # 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 =====
| |
| | |
| BASH
| |
| # 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 =====
| |
| | |
| BASH
| |
| reboot
| |
| Nach dem reboot:
| |
| | |
| BASH
| |
| # 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:
| |
| | |
| TEXT
| |
| 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]
| |
| Wichtig: Reset-Methode MUSS device_specific zeigen, nicht bus.
| |
| | |
| ==== 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
| |
| Empfehlung: Machine Type q35 verwenden
| |
| | |
| ===== Großes VRAM handhaben =====
| |
| Für GPUs mit viel VRAM (32GB) PCI BAR Größe erhöhen:
| |
| | |
| BASH
| |
| # 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:
| |
| | |
| BASH
| |
| 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:
| |
| | |
| BASH
| |
| sudo dmesg | grep -i "amdgpu" | grep -i -E "bios|initialized|firmware"
| |
| Erwartete Ausgabe bei korrekter Funktion:
| |
| | |
| 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
| |
| ==== Teil 4: ROCm Installation ====
| |
| | |
| ===== ROCm installieren =====
| |
| | |
| BASH
| |
| # 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 =====
| |
| | |
| BASH
| |
| # 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 =====
| |
| | |
| BASH
| |
| # 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
| |
| VM nach ROCm Installation neustarten!
| |
| | |
| ===== ROCm Installation überprüfen =====
| |
| | |
| BASH
| |
| rocm-smi
| |
| Erwartete Ausgabe:
| |
| | |
| TEXT
| |
| ============================================ 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 ===================================================
| |
| === Update ===
| |
| | |
| === Test ===
| |
| | |
| === Fehlerbehebung ===
| |
| | |
| ==== vendor-reset komplett entfernen ====
| |
| | |
| BASH
| |
| # 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:
| |
| | |
| BASH
| |
| amd_iommu=on root=ZFS=rpool/ROOT/pve-1 boot=zfs
| |
| ==== Schlechte PCIe-Trennung auf Consumer Mainboards ====
| |
| Fehlende IOMMU-Trennung:
| |
| | |
| BASH
| |
| amd_iommu=on pcie_acs_override=downstream,multifunction
| |
| ==== Reset-Methode zeigt 'bus' statt 'device_specific' ====
| |
| Udev-Regeln überprüfen:
| |
| | |
| BASH
| |
| sudo cp udev/99-vendor-reset.rules /etc/udev/rules.d/
| |
| sudo systemctl restart systemd-udevd
| |
| === Codeschnipsel ===
| |
|
| |
|
| ==== Disk in VM erweitern ==== | | ==== Disk in VM erweitern ==== |
| Angenommen, wir wollten /dev/sda3 erweitern: | | Angenommen, wir wollden /dev/sda3 erweitern: |
| <syntaxhighlight lang="bash" line="1"> | | <syntaxhighlight lang="bash" line="1"> |
| fdisk -l /dev/sda | | fdisk -l /dev/sda |
| Zeile 346: |
Zeile 57: |
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
|
| === Nützliche Links === | | === Update === |
| | |
| | === Test === |
| | |
| | === Fehlerbehebung=== |
| | ====Starten/Stoppen funktioniert nicht==== |
| | =====Lösung 1===== |
| | <syntaxhighlight lang="bash" line="1"> |
| | auszufüllen |
| | </syntaxhighlight> |
|
| |
|
| Original vendor-reset Repository: [https://github.com/gnif/vendor-reset]
| | === Codeschnipsel === |
| 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]
| |
| *Contributions by Danternas for ZFS and consumer motherboard fixes
| |
| *Community feedback from r/LocalLLaMA and r/Proxmox
| |
|
| |
|
| TEXT
| | === Codeschnipsel === |
|
| |
|
| 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.
| | === Nützliche Links === |
Beschreibung
Proxmox VE ist eine kostenlose Open-Source-Virtualisierungsplattform auf Debian-Basis, die sowohl KVM für vollständige Hardware-Virtualisierung als auch LXC für leichtgewichtige Linux-Container unterstützt. Über das webbasierte Management-Interface können Administratoren VMs und Container zentral verwalten, Live-Migrationen durchführen und verschiedene Storage-Lösungen integrieren, was es zu einer kostengünstigen Alternative zu kommerziellen Hypervisoren wie VMware macht. Besonders populär ist Proxmox in kleinen und mittleren Unternehmen sowie Home-Lab-Umgebungen, da es enterprise-fähige Funktionen wie Clustering, High Availability und automatisierte Backups ohne Lizenzkosten bietet.
Download
Images
Installation
Konfiguration
GPU Passthrough
lspci
root@proxmox:~# lspci -n -s 83:00 -v
83:00.0 0380: 1002:66a1 (rev 02)
Subsystem: 1002:0834
Flags: fast devsel, IRQ 49, IOMMU group 13
Memory at 47000000000 (64-bit, prefetchable) [size=32G]
Memory at 47800000000 (64-bit, prefetchable) [size=2M]
Memory at c2000000 (32-bit, non-prefetchable) [size=512K]
Expansion ROM at c2080000 [disabled] [size=128K]
Capabilities: [48] Vendor Specific Information: Len=08 <?>
Capabilities: [50] Power Management version 3
Capabilities: [64] Express Legacy Endpoint, IntMsgNum 0
Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
Capabilities: [150] Advanced Error Reporting
Capabilities: [270] Secondary PCI Express
Capabilities: [2a0] Access Control Services
Capabilities: [2b0] Address Translation Service (ATS)
Capabilities: [2c0] Page Request Interface (PRI)
Capabilities: [2d0] Process Address Space ID (PASID)
Capabilities: [320] Latency Tolerance Reporting
Capabilities: [400] Data Link Feature <?>
Capabilities: [410] Physical Layer 16.0 GT/s <?>
Capabilities: [440] Lane Margining at the Receiver
Kernel driver in use: vfio-pci
Kernel modules: amdgpu
root@proxmox:~# echo "options vfio-pci ids=1002:66a1 disable_vga=1" > /etc/modprobe.d/vfio.conf #PCI Gerät für den Host blacklisten
root@proxmox:~# echo "blacklist amdgpu" >> /etc/modprobe.d/blacklist.conf #alle aufgelisteten Kernel-modules blacklisten für den Host
root@proxmox:~# update-initramfs -u -k all
Disk in VM erweitern
Angenommen, wir wollden /dev/sda3 erweitern:
fdisk -l /dev/sda
d
3
n
3
Enter
Do you want to remove the signature? [Y]es/[N]o: N
w
reboot
Dann weiter mit
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv
Update
Test
Fehlerbehebung
Starten/Stoppen funktioniert nicht
Lösung 1
Codeschnipsel
Nützliche Links
Codeschnipsel
Nützliche Links