# VM iGPU Passthrough

### Setting Up
This guide seems to work for Strix Halo:  
https://github.com/isc30/ryzen-gpu-passthrough-proxmox

This is mostly tied to Proxmox, but should still be applicable to regular systems with QEMU installed.

### Configuration
```bash
# /etc/kernel/cmdline
... iommu=pt initcall_blacklist=sysfb_init
```

```bash
# /etc/modules
vfio
vfio_iommu_type1
vfio_pci
```

```bash
# /etc/modprobe.d/blacklist.conf
blacklist radeon
blacklist amdgpu
blacklist snd_hda_intel
```

```bash
# /etc/modprobe.d/vfio.conf
options vfio-pci ids=1002:1586,1002:1640 disable_vga=1
```

```bash
# vm.conf for QEMU
machine: pc-q35-9.2+pve1,viommu=virtio
cpu: host
# don't forget to replace the IDs if needed
hostpci0: 0000:c6:00.0,pcie=1,romfile=vbios_8060s.bin,x-vga=1
hostpci1: 0000:c6:00.1,pcie=1,romfile=AMDGopDriver.rom
```

Proxmox VM:  
![8060s GPU Passthrough in Proxmox](./proxmox-8060s-passthrough.png)

### Notes
 - hardware IDs are `1002:1586` (iGPU) and `1002:1640` (audio)
 - Windows works fine, but I haven't managed to do it with a Linux VM, amdgpu driver crashes
 - the 'reset bug' is here, I found no way to avoid it, so **you can passthrough the iGPU only once per boot of the host**
 - if your VM crashes during GPU driver install, switch the CPU type to something generic (`x86-64-v4` for example seems to work fine), install the driver, then return it back to `host`
 - if you see unknown PCI device (`1af4:1057`) in your Device Manager, install `viomem` driver manually from virtio drivers ISO
 - set the fixed VRAM amount in the BIOS and never change it on the OS level, otherwise expect major slowdowns and crashes
 - [this issue](https://github.com/isc30/ryzen-gpu-passthrough-proxmox/issues/112) might be worth looking into

### Files
(taken from [[EVO-X2|Devices/GMKtec-EVO-X2]], BIOS version 1.04)
 - [vbios_8060s.bin](./vbios_8060s.bin)
 - [AMDGopDriver.rom](./AMDGopDriver.rom)
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9