VGA Passthrough never worked !

abayoumy

New Member
Nov 18, 2022
12
1
3
Hello ,
I have proxmox latest installed on amd Ryzen 4650g with built in Readon VGA

I try VGA Passthrough with : https://www.reddit.com/r/homelab/comments/b5xpua/the_ultimate_beginners_guide_to_gpu_passthrough/
but allows vm not start with error :

kvm: -device vfio-pci,host=0000:06:00.0,id=hostpci0.0,bus=ich9-pcie-port-1,addr=0x0.0,x-vga=on,multifunction=on: vfio 0000:06:00.0: failed getting region info for VGA region index 8: Invalid argument device does not support requested feature x-vga TASK ERROR: start failed: QEMU exited with code 1

my configuration :

grub
`GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"`

------------------------

cat /etc/modules
```
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
```

------------

- cat /etc/modprobe.d/kvm.conf
`options kvm ignore_msrs=1`
--------------------------------
- cat /etc/modprobe.d/iommu_unsafe_interrupts.conf
`options vfio_iommu_type1 allow_unsafe_interrupts=1`
----------------------------
- /etc/modprobe.d/blacklist.conf
```
blacklist radeon
blacklist nouveau
blacklist nvidia
```
--------------------------------------
- lspci -v
```
06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev ff) (prog-if ff)
!!! Unknown header type 7f
Kernel driver in use: vfio-pci
Kernel modules: amdgpu

06:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device 1637 (rev ff) (prog-if ff)
!!! Unknown header type 7f
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel

06:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor (rev ff) (prog-if ff)
!!! Unknown header type 7f
Kernel driver in use: vfio-pci
Kernel modules: ccp

06:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 (rev ff) (prog-if ff)
!!! Unknown header type 7f
Kernel driver in use: vfio-pci
Kernel modules: xhci_pci

06:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 (rev ff) (prog-if ff)
!!! Unknown header type 7f
Kernel driver in use: vfio-pci
Kernel modules: xhci_pci

06:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller (rev ff) (prog-if ff)
DeviceName: Realtek ALC1220
!!! Unknown header type 7f
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
```
--------------
- lspci -n -s 06:00
```
06:00.0 0300: 1002:1636 (rev ff)
06:00.1 0403: 1002:1637 (rev ff)
06:00.2 1080: 1022:15df (rev ff)
06:00.3 0c03: 1022:1639 (rev ff)
06:00.4 0c03: 1022:1639 (rev ff)
06:00.6 0403: 1022:15e3 (rev ff)
```
-----------------
- /etc/modprobe.d/vfio.conf
`options vfio-pci ids=1002:1636,1002:1637,1022:15df,1022:1639,1022:1639,1022:15e3 disable_vga=1`
----------------------------
 
Please check your IOMMU groups with: for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU group %s ' "$n"; lspci -nns "${d##*/}"; done. You probably have the same issue as this thread and you probably need to split that IOMMU group (using pcie_acs_override, which breaks host/VM security isolation).
Also, don't enable All Functions because PCIe device 06:00 has many functions that are necessary for the Proxmox host. Only passthrough 06:00.0 and 06:00.1. Make sure to early bind those two devices to vfio-pci and to use this work-around to enable passthrough of the only GPU in your computer.
 
Thank you

as your advice i keep only 2 devices from 06:00 and add this options to kernel

quiet amd_iommu=on initcall_blacklist=sysfb_init pcie_acs_override=downstream, multifunction"

I remove all function option ,
but still got same error

kvm: -device vfio-pci,host=0000:06:00.0,id=hostpci0.0,bus=ich9-pcie-port-1,addr=0x0.0,x-vga=on,multifunction=on: vfio 0000:06:00.0: failed getting region info for VGA region index 8: Invalid argument
device does not support requested feature x-vga
TASK ERROR: start failed: QEMU exited with code 1

My IOMMU Groupgroups

Code:
IOMMU group 0 00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
IOMMU group 10 06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Renoir [1002:1636] (rev ff)
IOMMU group 11 06:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1637] (rev ff)
IOMMU group 12 06:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df] (rev ff)
IOMMU group 13 06:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 [1022:1639] (rev ff)
IOMMU group 14 06:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Renoir USB 3.1 [1022:1639] (rev ff)
IOMMU group 15 06:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller [1022:15e3] (rev ff)
IOMMU group 1 00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
IOMMU group 2 00:02.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge [1022:1634]
IOMMU group 3 00:02.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge [1022:1634]
IOMMU group 4 00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge [1022:1632]
IOMMU group 5 00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus [1022:1635]
IOMMU group 6 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 51)
IOMMU group 6 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU group 7 00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 0 [1022:1448]
IOMMU group 7 00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 1 [1022:1449]
IOMMU group 7 00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 2 [1022:144a]
IOMMU group 7 00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 3 [1022:144b]
IOMMU group 7 00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 4 [1022:144c]
IOMMU group 7 00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 5 [1022:144d]
IOMMU group 7 00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 6 [1022:144e]
IOMMU group 7 00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 7 [1022:144f]
IOMMU group 8 01:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Device [1022:43ec]
IOMMU group 8 01:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] Device [1022:43eb]
IOMMU group 8 01:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Device [1022:43e9]
IOMMU group 8 02:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Device [1022:43ea]
IOMMU group 8 02:03.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Device [1022:43ea]
IOMMU group 8 03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8192EE PCIe Wireless Network Adapter [10ec:818b]
IOMMU group 8 04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 16)
IOMMU group 9 05:00.0 Non-Volatile memory controller [0108]: Phison Electronics Corporation E12 NVMe Controller [1987:5012] (rev 01)
thx
 
small update
I set kernel options to : quiet amd_iommu=on initcall_blacklist=sysfb_init pcie_acs_override=downstream
now error changed:


kvm: ../hw/pci/pci.c:1562: pci_irq_handler: Assertion `0 <= irq_num && irq_num < PCI_NUM_PINS' failed.
TASK ERROR: start failed: QEMU exited with code 1
 
quiet amd_iommu=on initcall_blacklist=sysfb_init pcie_acs_override=downstream, multifunction"
What is the output of cat /proc/cmdline?
but still got same error

kvm: -device vfio-pci,host=0000:06:00.0,id=hostpci0.0,bus=ich9-pcie-port-1,addr=0x0.0,x-vga=on,multifunction=on: vfio 0000:06:00.0: failed getting region info for VGA region index 8: Invalid argument
device does not support requested feature x-vga
You have not yet shown your VM configuration (file from /etc/pve/qemu-server) but the Primary GPU option (x-vga=1) is meant for NVidia GPUs and AMD GPUs work better without it. Just set the Display option to none.
My IOMMU Groupgroups
Those groups mean nothing because you are using pcie_acs_override=downstream, multifunction. But you probably need that, otherwise passthrough of the GPU will remove too many devices from the Proxmox host (as IOMMU groups cannot be shared). Don't remove multifunction, that won't help.
 
thank you for helping :)

Code:
cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-5.15.74-1-pve root=/dev/mapper/pve-root ro quiet amd_iommu=on initcall_blacklist=sysfb_init pcie_acs_override=downstream, multifunction

Code:
root@pve:/etc/pve/qemu-server# cat 200
cat: 200: No such file or directory
root@pve:/etc/pve/qemu-server# cat 200.conf
agent: 1,fstrim_cloned_disks=1
bios: ovmf
boot: order=ide0;usb0
cores: 4
efidisk0: local-lvm:vm-200-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
hostpci0: 0000:06:00,pcie=1,rombar=0
hostpci1: 0000:06:00.1,pcie=1,rombar=0
ide0: MediaHDD:200/vm-200-disk-0.qcow2,size=256G
machine: pc-q35-7.1
memory: 8192
meta: creation-qemu=7.1.0,ctime=1669274004
name: Windows11
net0: e1000=E6:60:BC:D0:A7:38,bridge=vmbr0,firewall=1
numa: 0
ostype: win11
scsihw: virtio-scsi-single
smbios1: uuid=b0597144-c4c8-4f8e-a0fe-cb45c93a76dc
sockets: 2
tpmstate0: local-lvm:vm-200-disk-1,size=4M,version=v2.0
usb0: host=30de:6545
vmgenid: 37563acd-53a3-41cb-9208-65743f3b590c
vmstatestorage: local-lvm

I build new win 11 , now when attach VGA got the error
Code:
swtpm_setup: Not overwriting existing state file.
kvm: ../hw/pci/pci.c:1562: pci_irq_handler: Assertion `0 <= irq_num && irq_num < PCI_NUM_PINS' failed.
stopping swtpm instance (pid 1045031) due to QEMU startup error
TASK ERROR: start failed: QEMU exited with code 1
 
Last edited:
Sorry, I must have missed your reply.
thank you for helping :)

Code:
cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-5.15.74-1-pve root=/dev/mapper/pve-root ro quiet amd_iommu=on initcall_blacklist=sysfb_init pcie_acs_override=downstream, multifunction
amd_iommu=on does nothing and can be remove.
pcie_acs_override=downstream, multifunction should be pcie_acs_override=downstream,multifunction but try not to use it. However, for this integrated GPU I think you need to.
Code:
root@pve:/etc/pve/qemu-server# cat 200
cat: 200: No such file or directory
root@pve:/etc/pve/qemu-server# cat 200.conf
agent: 1,fstrim_cloned_disks=1
bios: ovmf
boot: order=ide0;usb0
cores: 4
efidisk0: local-lvm:vm-200-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
hostpci0: 0000:06:00,pcie=1,rombar=0
hostpci1: 0000:06:00.1,pcie=1,rombar=0
ide0: MediaHDD:200/vm-200-disk-0.qcow2,size=256G
machine: pc-q35-7.1
memory: 8192
meta: creation-qemu=7.1.0,ctime=1669274004
name: Windows11
net0: e1000=E6:60:BC:D0:A7:38,bridge=vmbr0,firewall=1
numa: 0
ostype: win11
scsihw: virtio-scsi-single
smbios1: uuid=b0597144-c4c8-4f8e-a0fe-cb45c93a76dc
sockets: 2
tpmstate0: local-lvm:vm-200-disk-1,size=4M,version=v2.0
usb0: host=30de:6545
vmgenid: 37563acd-53a3-41cb-9208-65743f3b590c
vmstatestorage: local-lvm
Device 06:00 is passed through with all functions, which includes 06:00.1, but that one is also passed through. Please change the hostpci0 line to passthrough only 06:00.0 (not All Functions).
Why disable ROM Bar? Try enabling it, which works for most people.
I build new win 11 , now when attach VGA got the error
Code:
swtpm_setup: Not overwriting existing state file.
kvm: ../hw/pci/pci.c:1562: pci_irq_handler: Assertion `0 <= irq_num && irq_num < PCI_NUM_PINS' failed.
stopping swtpm instance (pid 1045031) due to QEMU startup error
TASK ERROR: start failed: QEMU exited with code 1
I don't know how to fix that, but maybe it goes away when you fix hostpci0.

EDIT: Since this is an integrated CPU, you probable don't want to passthrough 06:00 with all functions. Unfortunately, I don't think passthrough of this integrated GPU will work...
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!