[SOLVED] iGPU passthrough with amd 7950x

PXMX1001

New Member
Nov 23, 2024
19
1
3
Hi,

I am trying to passthrough my igpu on my amd 7950x. The igpu will not passthrough and I keep getting the error in the picture below. The VM starts however I do not see the output on the monitor. Please let me know how I can fix this to passthrough my iGPU. Intel was so much easier. I also tried following this guide below:

Guide:
https://github.com/isc30/ryzen-7000-series-proxmox

Grub:
Code:
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
GRUB_CMDLINE_LINUX=""

/etc/modprobe.d/vfio.conf
Code:
options vfio-pci ids=1002:164e,1002:1640
softdep radeon pre: vfio-pci
softdep amdgpu pre: vfio-pci
softdep snd_hda_intel pre: vfio-pci

Config:

Code:
args: -cpu 'host,-hypervisor,kvm=off'
balloon: 1024
bios: ovmf
boot: order=scsi0
cores: 5
cpu: x86-64-v2-AES
efidisk0: local-lvm:vm-101-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
hostpci0: 0000:6c:00.0,pcie=1,rombar=0,romfile=vbios_7950x.bin,x-vga=1
hostpci1: 0000:6c:00.1,pcie=1,rombar=0
machine: q35
memory: 14336
meta: creation-qemu=8.1.2,ctime=1705698968
name: alienware-server
net0: virtio=BC:24:11:27:CB:77,bridge=vmbr0,firewall=1
net1: virtio=BC:24:11:05:50:72,bridge=vmbr0,firewall=1,tag=30
numa: 0
onboot: 0
ostype: l26
scsi0: local-lvm:vm-101-disk-1,iothread=1,size=300G
scsi1: /dev/disk/by-id/ata-ST2000DM001-1ER164_Z4Z8GSSY,serial=Z4Z8GSSY,size=195>
scsi2: /dev/disk/by-id/ata-ST2000DM008-2FR102_ZFL4FDTZ,serial=DD5641988389A,siz>
scsihw: virtio-scsi-single
smbios1: uuid=c3ee898a-b875-41d1-9bd7-d10a96c65272
sockets: 1
usb0: host=5-5
usb1: host=5-4
vga: none

1732476182157.png
 
Last edited:
Adding this command to initramfs is what allowed me to passthrough my iGPU. If anyone knows why let me know lol. I will post my full configuration below to help someone in the future.


options vfio_iommu_type1 allow_unsafe_interrupts=1
 
Grub:

Code:
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
GRUB_CMDLINE_LINUX=""


/etc/modprobe.d/vfio.conf
***Adding the allow unsafe interrupts allowed me to passthrough the iGPU***

Code:
options vfio-pci ids=1002:164e,1002:1640
options vfio_iommu_type1 allow_unsafe_interrupts=1
softdep radeon pre: vfio-pci
softdep amdgpu pre: vfio-pci
softdep snd_hda_intel pre: vfio-pci

Config:

Code:
balloon: 2048
bios: ovmf
boot: order=virtio0
cores: 8
cpu: host,hidden=1
efidisk0: local-lvm:vm-201-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
hostpci0: 0000:6c:00.0,pcie=1,romfile=vbios_7950x_2.bin
hostpci1: 0000:6c:00.1,pcie=1,romfile=AMDGopDriver.rom
machine: pc-q35-8.1
memory: 25600
meta: creation-qemu=8.1.2,ctime=1705801403
name: alienware-wingame
net0: e1000=BC:24:11:98:82:59,bridge=vmbr0,firewall=1,tag=40
numa: 0
ostype: win11
scsihw: virtio-scsi-single
smbios1: uuid=f305ddf0-7ffd-4217-a4e7-2f4b6e19bebc
sockets: 1
usb0: host=5-5
usb1: host=5-4
vga: none
virtio0: local-lvm:vm-201-disk-3,iothread=1,size=399480M

1732586654207.pngiGPU primary gpu, rom bar, and pcie express

1732586685919.png
Audio: Just pcie express
 
Last edited:
Next I have to figure out to keep the iGPU from turning off when the screen goes to sleep. It wont resume. Also it only allows me to send to one vm for each reboot of the server. It is also only working with a windows 11 virtual machine. It will freeze when booting ubuntu.

Fixes: (Not completed and requesting help)
1) keep the iGPU from turning off when the screen goes to sleep
2) It is also only working with a windows 11 virtual machine. It will freeze when booting ubuntu.
 
Next I have to figure out to keep the iGPU from turning off when the screen goes to sleep. It wont resume. Also it only allows me to send to one vm for each reboot of the server. It is also only working with a windows 11 virtual machine. It will freeze when booting ubuntu.

Fixes: (Not completed and requesting help)
1) keep the iGPU from turning off when the screen goes to sleep
2) It is also only working with a windows 11 virtual machine. It will freeze when booting ubuntu.
1--> I just disabled option to "sleep" on proxmox host so I prevent turning off igpu or make some weird behavior.
2--> I am still figuring out how... :(
 
@PXMX1001 Trying to follow your footsteps here. I also have 7950x. When passthrough was working do you still get the error in the start logs?

Code:
error writing '1' to '/sys/bus/pci/devices/0000:11:00.0/reset': Inappropriate ioctl for device
failed to reset PCI device '0000:11:00.0', but trying to continue as not all devices need a reset
swtpm_setup: Not overwriting existing state file.
TASK OK

A lot of my settings happen to be very similar to yours, but I keep getting code 43.

grub
Code:
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"
GRUB_CMDLINE_LINUX=""


/etc/modprobe.d/vfio.conf
Code:
options vfio-pci ids=1002:164e,1002:1640
options vfio_iommu_type1 allow_unsafe_interrupts=1
softdep radeon pre: vfio-pci
softdep amdgpu pre: vfio-pci
softdep snd_hda_intel pre: vfio-pci

conf
Code:
agent: 1
args: -cpu 'host,-hypervisor,kvm=off'
audio0: device=ich9-intel-hda,driver=none
bios: ovmf
boot: order=virtio0;
cores: 8
cpu: host
efidisk0: local-lvm:vm-201-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
hostpci0: 0000:11:00.0,pcie=1,romfile=vbios_7xxx.bin,x-vga=1
hostpci1: 0000:11:00.1,pcie=1,romfile=AMDGopDriver.efi
hotplug: disk,network,usb
machine: pc-q35-9.0,viommu=virtio
memory: 16428
meta: creation-qemu=9.0.2,ctime=1737992765
name: OfficeAdmin
net0: rtl8139=BC:24:11:DF:AD:4D,bridge=vmbr0,firewall=1,tag=10
numa: 0
onboot: 0
ostype: win11
scsihw: virtio-scsi-pci
smbios1: uuid=a91aef18-07ef-4ef1-8dc9-461e540475f4
sockets: 1
startup: order=1
tpmstate0: local-lvm:vm-201-disk-1,size=4M,version=v2.0
vga: none
virtio0: local-lvm:vm-201-disk-2,iothread=1,size=512G
vmgenid: 06dbf391-c7f2-4a4b-afb4-5d8869234f44
 
Last edited:
I still cannot get this to work for ubuntu. Ubuntu recovery mode works however when I boot without the screen continues flickering at the login screen
 
I still cannot get this to work for ubuntu. Ubuntu recovery mode works however when I boot without the screen continues flickering at the login screen
do you mean GPU passthrough to Ubuntu Guest? If you can passthough to a Windows VM without issue that’s mean NVIDIA driver on your Ubuntu VM has driver issue.
 
@Galen Chi yes, I do mean igpu passthrough of 7950x to Ubuntu host. It’s an amd cpu so it’s the amd driver that isn’t working. If I disable rom-bar then it doesn’t work. I have tried so many options. It just simply flickers on the Ubuntu 24.04 host.
 
Since I use NVIDIA GPU , Not sure if this can help:
I broke the NVIDIA driver on my Ubuntu guest because I was testing the drivers, So I detached the GPU from VM config, boot into VM , Clean the drivers, Then attach the GPU again, Boot into VM install the driver fix the issue.
 
Last edited: