GPU passthrough in VM hangs when booting with libvirt, vs qemu

Hey all! Long time Hackintosher here. I've got a new build, i9 14900k, 128GB of RAM, ASUS Z790 Plus-wifi that has the latest Sonoma working flawlessly with an AMD 580 GPU (one of the Chinese ones that's a spoofed 570 I think). I had to edit and then flash the ROM to make it work, but it all works flawlessly now. My next endeavor is getting the same performance in KVM. I've managed to accomplish this, again, flawlessly using Qemu in both Ubuntu and openSUSE using GPU passthrough for the same card. The thing that has me stumepd is that it only works with a boot script that opens qemu in both Ubuntu and openSUSE. When I use the same (i think) config in libvirt/virsh in Ubuntu, it also works, but in openSUSE, using libvirt results in it hanging on PCI Configuration Begin when booting in verbose mode. I've tried all the usual boot flags for OpenCore but haven't gotten it to work. I'm suspecting it has to do with the way libvirt adds all kidns of pcie slots etc, but different things trying to rearrange slots doesn't help. Specifying or not specifying a ROM image has no effect either way. In both setups, vfio is configured to control the PCIe cards on boot. All vdisks are stored on a ZFS pool. Any thoughts are welcome! Thanks!

Libvirt config: https://www.dropbox.com/scl/fi/8262ae4z0p2svt6t12ylb/macOS.xml?rlkey=f7dpjc62ysxnxholo5ke1o607&dl=0

boot script: https://www.dropbox.com/scl/fi/ywr4n2430xwjqbwbijlzj/boot.sh?rlkey=4s8l5lrqt231i2ni4fsu7vm77&dl=0

submitted by /u/gdo83
[link] [comments]