DarwinKVM icon indicating copy to clipboard operation
DarwinKVM copied to clipboard

Struggling with hang on `[IOPCIConfigurator::configure()] PCI configuration PCI0`

Open valinet opened this issue 3 months ago • 2 comments

So, I have been struggling for a few days now to get a macOS Tahoe VM going with passed through AMD WX4100 GPU. Host specs:

Gigabyte Z690 UD DDR4
CPU i7-12700k
GPU AMD Radeon Pro WX 4100
OS Proxmox 9.0.10
Linux kernel 6.14.11-2-pve

Followed your guide top to bottom. Installed OS successfully when booting with the vmware GPU. As soon as I switch to passing though the AMD card, boot gets stuck at:

PCI configuration begin
IOPCIConfigurator::configure()] PCI configuration PCI0

What is even more spectacular is, if I let it sit like that for 10-15 minutes, it eventually goes to the desktop. It is just that it hangs so long in there, and I do not understand why. I do not know what to try, I do not understand why this is happening... Here's my Proxmox config, if it is of any use, I am booting with just one core to minimize the variability for now:

agent: 1
args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -smbios type=2 -device qemu-xhci -device usb-kbd -device usb-tablet -global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off -device 'vfio-pci,host=0000:09:00.0,id=hostpci0.0,bus=ich9-pcie-port-1,addr=0x0.0,x-vga=on,multifunction=on' -device 'vfio-pci,host=0000:09:00.1,id=hostpci0.1,bus=ich9-pcie-port-1,addr=0x0.1' -cpu Cascadelake-Server,vendor=GenuineIntel
autostart: 0
balloon: 0
bios: ovmf
boot: order=ide0
cores: 1
cpu: Cascadelake-Server
efidisk0: local-zfs:vm-113-disk-0,size=1M
ide0: local:iso/opencore.iso,cache=unsafe,media=disk,size=20000M
machine: q35
memory: 8192
meta: creation-qemu=9.1.2,ctime=1758506884
name: macos
net0: vmxnet3=BC:24:11:30:A1:DB,bridge=vmbr0
numa: 0
onboot: 0
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=539cab61-c5d1-42c6-8d52-a4897c653f88
sockets: 1
tablet: 1
usb0: host=1-7.1.2
vga: none
virtio0: local-zfs:vm-113-disk-1,cache=none,discard=on,size=80G
vmgenid: 47c4fdab-0045-4223-8801-e3b952fd5fe8

And here is the qemu-system-x86_64 command this leads to:

qemu-system-x86_64 \
  -id 113 \
  -name 'macos,debug-threads=on' \
  -no-shutdown \
  -chardev 'socket,id=qmp,path=/var/run/qemu-server/113.qmp,server=on,wait=off' \
  -mon 'chardev=qmp,mode=control' \
  -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect-ms=5000' \
  -mon 'chardev=qmp-event,mode=control' \
  -pidfile /var/run/qemu-server/113.pid \
  -daemonize \
  -smbios 'type=1,uuid=539cab61-c5d1-42c6-8d52-a4897c653f88' \
  -object '{"id":"throttle-drive-efidisk0","limits":{},"qom-type":"throttle-group"}' \
  -blockdev '{"driver":"raw","file":{"driver":"file","filename":"/usr/share/pve-edk2-firmware//OVMF_CODE.fd"},"node-name":"pflash0","read-only":true}' \
  -blockdev '{"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":false,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"host_device","filename":"/dev/zvol/rpool/data/vm-113-disk-0","node-name":"ebc8d9c6b3f6d0086c0a1c11c20bc3c","read-only":false},"node-name":"fbc8d9c6b3f6d0086c0a1c11c20bc3c","read-only":false,"size":131072},"node-name":"drive-efidisk0","read-only":false,"throttle-group":"throttle-drive-efidisk0"}' \
  -smp '1,sockets=1,cores=1,maxcpus=1' \
  -nodefaults \
  -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
  -vga none \
  -nographic \
  -cpu 'Cascadelake-Server,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,vendor=GenuineIntel' \
  -m 8192 \
  -object '{"id":"throttle-drive-ide0","limits":{},"qom-type":"throttle-group"}' \
  -object '{"id":"throttle-drive-virtio0","limits":{},"qom-type":"throttle-group"}' \
  -global 'ICH9-LPC.disable_s3=1' \
  -global 'ICH9-LPC.disable_s4=1' \
  -readconfig /usr/share/qemu-server/pve-q35-4.0.cfg \
  -device 'vmgenid,guid=47c4fdab-0045-4223-8801-e3b952fd5fe8' \
  -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' \
  -device 'usb-host,hostbus=1,hostport=7.1.2,id=usb0' \
  -chardev 'socket,path=/var/run/qemu-server/113.qga,server=on,wait=off,id=qga0' \
  -device 'virtio-serial,id=qga0,bus=pci.0,addr=0x8' \
  -device 'virtserialport,chardev=qga0,name=org.qemu.guest_agent.0' \
  -iscsi 'initiator-name=iqn.1993-08.org.debian:01:b298271ccd6' \
  -blockdev '{"detect-zeroes":"on","discard":"ignore","driver":"throttle","file":{"cache":{"direct":false,"no-flush":true},"detect-zeroes":"on","discard":"ignore","driver":"raw","file":{"aio":"io_uring","cache":{"direct":false,"no-flush":true},"detect-zeroes":"on","discard":"ignore","driver":"file","filename":"/var/lib/vz/template/iso/opencore.iso","node-name":"e8b79fc868782ef5bbb50bf48d059be","read-only":false},"node-name":"f8b79fc868782ef5bbb50bf48d059be","read-only":false},"node-name":"drive-ide0","read-only":false,"throttle-group":"throttle-drive-ide0"}' \
  -device 'ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100,write-cache=on' \
  -blockdev '{"detect-zeroes":"unmap","discard":"unmap","driver":"throttle","file":{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"unmap","discard":"unmap","driver":"host_device","filename":"/dev/zvol/rpool/data/vm-113-disk-1","node-name":"e0490da98efe3c685bfb62d7765d5b8","read-only":false},"node-name":"f0490da98efe3c685bfb62d7765d5b8","read-only":false},"node-name":"drive-virtio0","read-only":false,"throttle-group":"throttle-drive-virtio0"}' \
  -device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,write-cache=on' \
  -netdev 'type=tap,id=net0,ifname=tap113i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown' \
  -device 'vmxnet3,mac=BC:24:11:30:A1:DB,netdev=net0,bus=pci.0,addr=0x12,id=net0' \
  -machine 'pflash0=pflash0,pflash1=drive-efidisk0,type=q35+pve1' \
  -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' \
  -smbios 'type=2' \
  -device qemu-xhci \
  -device usb-kbd \
  -device usb-tablet \
  -global 'nec-usb-xhci.msi=off' \
  -global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \
  -device 'vfio-pci,host=0000:09:00.0,id=hostpci0.0,bus=ich9-pcie-port-1,addr=0x0.0,x-vga=on,multifunction=on' \
  -device 'vfio-pci,host=0000:09:00.1,id=hostpci0.1,bus=ich9-pcie-port-1,addr=0x0.1' \
  -cpu 'Cascadelake-Server,vendor=GenuineIntel'

Thank you for this valuable resource.

valinet avatar Sep 22 '25 13:09 valinet

I tried messing with npci=0x2000, npci=0x3000, I see the enum is in IOPCIConfigurator.h and it affects the debug variable in IOPCIBridge.cpp, no success. Is the card somehow fucked up? It's the second card I try, the first one was not working even under Windows. This one works fine under Windows, no code 43. I also tried it on bare metal, on a i3 Skylake build and it worked fine, so I am fairly certain the card is fine.

valinet avatar Sep 22 '25 13:09 valinet

Forgot to mention, I also have vendor-reset installed. Maybe that makes the reset phase stall somehow...?

valinet avatar Sep 22 '25 17:09 valinet