Vfio-pci QEMU/KVM full passthrough code 43 error (Linux host, GP107M GPU)

Hello, I’m having a problem where VFIO-PCI passthrough for the GP107M GPU (NVIDIA GTX 1050 with Max-Q Design) simply doesn’t work. I’m running a Linux host (kernel version is 7.0.10) with QEMU/KVM. I tried both Windows and Linux guests, Windows shows code 43 (the device stopped because it reported an error) and Linux simply shows an error when I try to actually utilize the GPU (OpenGL context init failed, Vulkan error, …). However, if I put the GPU back into the host machine, it works correctly without any issues. What am I doing wrong here?

I’m using the following arguments: -device pcie-root-port,id=p2,slot=0,chassis=2,bus=pcie.0
-device vfio-pci,host=02:00.0,bus=p2,x-pci-sub-vendor-id=0x1043,x-pci-sub-device-id=0x1481,x-pci-vendor-id=0x10de,x-pci-device-id=0x1c8d. This GPU does not have video output (it’s a “3D Controller”, not a video output controller) so there’s no x-vga or display in the arguments. If I try enabling that QEMU will say that the device does not support any known display output method.

(I tried with chassis=1 and it didn’t fix the issue, without pcie-root-port the drivers didn’t install at all)

Changing the CPU flags didn’t help (I tried both with the default options and with VM hiding options, nothing changed).

When booting QEMU I also get the following warning:

qemu-system-x86_64: vfio-pci: Cannot read device rom at 0000:02:00.0
Device option ROM contents are probably invalid (check dmesg).
Skip option ROM probe with rombar=0, or load from file with romfile=

I successfully extracted the VBIOS from my computer’s firmware (vbios: BIOS (ia32) ROM Ext. IBM comp. Video "IBM VGA Compatible\001" (210*512) instruction 0xeb4b3734; at 0x17
0 PCI NVIDIA device=0x1c8d PRIOR, ProgIF=3, at 0x40 VPD, revision 3, code revision 0x3, last ROM, 3rd reserved 0x8000) but adding it did not fix the “Code 43” error.

How do I get it to work properly?