Page 1 of 1

PCI passthrough not working: vboxpci failed to attach to IOMMU with error -22

Posted: 28. Aug 2018, 13:14
by PhoenixStarEclipse
I'm trying to pass my GPU to a windows 10 VM by PCI passthrough. Without the GPU passed through, the VM started up normally. However, it stuck with screen all black after passing the GPU through.
To confirm that I have IOMMU working:

Code: Select all

$ dmesg | grep IOMMU
[    0.000000] DMAR: IOMMU enabled
[    0.001000] DMAR-IR: IOAPIC id 2 under DRHD base  0xfed91000 IOMMU 1
[    8.190365] vboxpci: IOMMU found
[  583.452576] vboxpci: created IOMMU domain 000000003a5cc108
[  583.518270] vboxpci 0000:01:00.0: failed to attach to IOMMU, error -22
[  865.751850] vboxpci: freeing IOMMU domain 000000003a5cc108
[  891.743447] vboxpci: created IOMMU domain 000000003a5cc108
[  891.809661] vboxpci 0000:01:00.0: failed to attach to IOMMU, error -22
[ 1053.476154] vboxpci: freeing IOMMU domain 000000003a5cc108
[ 1159.784026] vboxpci: created IOMMU domain 000000003a5cc108
[ 1159.803868] vboxpci 0000:01:00.0: failed to attach to IOMMU, error -22
[ 1176.934509] vboxpci: freeing IOMMU domain 000000003a5cc108
[ 3717.221025] vboxpci: created IOMMU domain 000000003a5cc108
[ 3717.286825] vboxpci 0000:01:00.0: failed to attach to IOMMU, error -22
I checked dmesg, and there are some lines seems related:

Code: Select all

[ 3715.843815] vboxdrv: 000000004d6926a0 VMMR0.r0
[ 3715.926751] vboxdrv: 000000000216b29e VBoxDDR0.r0
[ 3716.009099] vboxpci: detected device: 10de:1c81 at 01:00.0, driver pci-stub
[ 3716.009162] vboxpci 0000:01:00.0: vboxPciOsDevInit
[ 3716.009217] vboxpci 0000:01:00.0: region 0: mmio f6000000+16777216
[ 3716.009219] vboxpci 0000:01:00.0: region 1: mmio e0000000+268435456
[ 3716.009220] vboxpci 0000:01:00.0: region 3: mmio f0000000+33554432
[ 3716.009222] vboxpci 0000:01:00.0: region 5: pio e000+128
[ 3716.009223] vboxpci 0000:01:00.0: region 6: mmio f7000000+524288
[ 3716.009233] vboxpci 0000:01:00.0: got irq 129
[ 3717.221025] vboxpci: created IOMMU domain 000000003a5cc108
[ 3717.286770] vboxpci 0000:01:00.0: PCIRAW_POWER_ON
[ 3717.286824] vboxpci 0000:01:00.0: pci_reset_function() failed
[ 3717.286825] vboxpci 0000:01:00.0: failed to attach to IOMMU, error -22
I googled it and found many posts involving VFIO, but the official documentation didn't mention it. Is this the problem?
Thanks, any help is appreciated.

Re: PCI passthrough not working: vboxpci failed to attach to IOMMU with error -22

Posted: 28. Aug 2018, 15:00
by andyp73
Unfortunately, as far as we know there are only a handful of people who have attempted to use PCI passthrough and at last count only 1.5 people who managed to get it to work and zero who enjoyed the experience or the results!

We'll do our best to answer any questions but I expect that you will be on your own for much of the journey.

-Andy.