GPU passthrough does not seem to work with windows in unraid. This server was running proxmox yesterday
Here is a list of things that do work:
- [x] GPU passthrough for linux/ubuntu (both unraid and proxmox)
- [x] GPU passthrough for windows within proxmox (same hardware)
- [x] VirtIO device passthrough (so non-direct hardware)
- [ ] GPU passthrough for windows in unraid
Here are the things I have tried:
- [x] Binding VFIO at boot
- [x] Enabling PCIe ACS override
- [x] Disabling/reenabling hyperV
- [x] Disabling/Enabling SPICE (as the primary GPU)
- [x] Disabling/Enabling VNC (as the primary GPU)
- [x] Disabling/Enabling the sound card of the GPU
- [x] Including and excluding a GPU vBios
- [x] Connecting a monitor to the output of the GPU (monitor turns on with linux install, not with the windows install)
- [x] Moving CPU cores
- [x] Moving the GPU to a different PCI-e slot
- [x] Recreating the VM
- [x] Passing the GPU as a device outside of the graphics passthrough
**Sometimes** I get this error (after running the windows VM after changing a setting):
```
internal error: qemu unexpectedly closed the monitor: 2024-01-02T06:41:37.639667Z qemu-system-x86_64: -device {"driver":"pcie-pci-bridge","id":"pci.7","bus":"pci.1","addr":"0x0"}: Bus 'pci.1' not found
```
Otherwises I get no errors in the logs
I am really stumped on why windows isn't working
```
PATH=/bin:/sbin:/usr/bin:/usr/sbin \
HOME='/var/lib/libvirt/qemu/domain-24-Windows 11' \
XDG_DATA_HOME='/var/lib/libvirt/qemu/domain-24-Windows 11/.local/share' \
XDG_CACHE_HOME='/var/lib/libvirt/qemu/domain-24-Windows 11/.cache' \
XDG_CONFIG_HOME='/var/lib/libvirt/qemu/domain-24-Windows 11/.config' \
/usr/local/sbin/qemu \
-name 'guest=Windows 11,debug-threads=on' \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain-24-Windows 11/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
-blockdev '{"driver":"file","filename":"/etc/libvirt/qemu/nvram/9f1371d1-5a41-0856-76b0-ebb3b64c433f_VARS-pure-efi-tpm.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
-machine pc-q35-7.2,usb=off,dump-guest-core=off,mem-merge=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-accel kvm \
-cpu host,migratable=on,hv-time=on,host-cache-info=on,l3-cache=off \
-m 16384 \
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":17179869184}' \
-overcommit mem-lock=off \
-smp 4,sockets=1,dies=1,cores=4,threads=1 \
-uuid 9f1371d1-5a41-0856-76b0-ebb3b64c433f \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=35,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=localtime \
-no-hpet \
-no-shutdown \
-boot strict=on \
-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \
-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \
-device '{"driver":"pcie-root-port","port":11,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x3"}' \
-device '{"driver":"pcie-root-port","port":19,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x2.0x3"}' \
-device '{"driver":"pcie-root-port","port":20,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x2.0x4"}' \
-device '{"driver":"pcie-root-port","port":10,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x2"}' \
-device '{"driver":"pcie-pci-bridge","id":"pci.7","bus":"pci.1","addr":"0x0"}' \
-device '{"driver":"ich9-usb-ehci1","id":"usb","bus":"pcie.0","addr":"0x7.0x7"}' \
-device '{"driver":"ich9-usb-uhci1","masterbus":"usb.0","firstport":0,"bus":"pcie.0","multifunction":true,"addr":"0x7"}' \
-device '{"driver":"ich9-usb-uhci2","masterbus":"usb.0","firstport":2,"bus":"pcie.0","addr":"0x7.0x1"}' \
-device '{"driver":"ich9-usb-uhci3","masterbus":"usb.0","firstport":4,"bus":"pcie.0","addr":"0x7.0x2"}' \
-device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.2","addr":"0x0"}' \
-blockdev '{"driver":"file","filename":"/mnt/user/isos/Win11_23H2_English_x64v2.iso","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"raw","file":"libvirt-3-storage"}' \
-device '{"driver":"ide-cd","bus":"ide.0","drive":"libvirt-3-format","id":"sata0-0-0"}' \
-blockdev '{"driver":"file","filename":"/mnt/user/isos/virtio-win-0.1.240.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw","file":"libvirt-2-storage"}' \
-device '{"driver":"ide-cd","bus":"ide.1","drive":"libvirt-2-format","id":"sata0-0-1"}' \
-blockdev '{"driver":"file","filename":"/mnt/user/domains/Windows 11/vdisk1.img","node-name":"libvirt-1-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \
-device '{"driver":"ide-hd","bus":"ide.2","drive":"libvirt-1-format","id":"sata0-0-2","bootindex":1,"write-cache":"on","serial":"vdisk1"}' \
-netdev tap,fd=36,id=hostnet0 \
-device '{"driver":"virtio-net","netdev":"hostnet0","id":"net0","mac":"52:54:00:d7:2a:16","bus":"pci.3","addr":"0x0"}' \
-chardev pty,id=charserial0 \
-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \
-chardev socket,id=charchannel0,fd=34,server=on,wait=off \
-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \
-chardev qemu-vdagent,id=charchannel1,name=vdagent,clipboard=on,mouse=on \
-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":2,"chardev":"charchannel1","id":"channel1","name":"com.redhat.spice.0"}' \
-chardev 'socket,id=chrtpm,path=/run/libvirt/qemu/swtpm/24-Windows 11-swtpm.sock' \
-tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \
-device '{"driver":"tpm-tis","tpmdev":"tpm-tpm0","id":"tpm0"}' \
-device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-vnc 0.0.0.0:0,websocket=5700,audiodev=audio1 \
-k en-us \
-device '{"driver":"qxl-vga","id":"video0","max_outputs":1,"ram_size":67108864,"vram_size":67108864,"vram64_size_mb":0,"vgamem_mb":16,"bus":"pci.7","addr":"0x1"}' \
-device '{"driver":"vfio-pci","host":"0000:01:00.0","id":"hostdev0","bus":"pci.4","addr":"0x0","romfile":"/mnt/user/isos/vbios/p1000.rom"}' \
-device '{"driver":"vfio-pci","host":"0000:01:00.1","id":"hostdev1","bus":"pci.5","addr":"0x0"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
char device redirected to /dev/pts/0 (label charserial0)
qxl_send_events: spice-server bug: guest stopped, ignoring
```
```
text error warn system array login
Loading config from /boot/config/vfio-pci.cfg
BIND=0000:01:00.0|10de:1cb1 0000:01:00.1|10de:0fb9---
Processing 0000:01:00.0 10de:1cb1
Vendor:Device 10de:1cb1 found at 0000:01:00.0
IOMMU group members (sans bridges):
/sys/bus/pci/devices/0000:01:00.0/iommu_group/devices/0000:01:00.0
/sys/bus/pci/devices/0000:01:00.0/iommu_group/devices/0000:01:00.1
Binding...
success...
Device 10de:1cb1 at 0000:01:00.0 bound to vfio-pci
---
Processing 0000:01:00.1 10de:0fb9
Vendor:Device 10de:0fb9 found at 0000:01:00.1
IOMMU group members (sans bridges):
/sys/bus/pci/devices/0000:01:00.1/iommu_group/devices/0000:01:00.0
/sys/bus/pci/devices/0000:01:00.1/iommu_group/devices/0000:01:00.1
Binding...
0000:01:00.0 already bound to vfio-pci
0000:01:00.1 already bound to vfio-pci
success...
Device 10de:0fb9 at 0000:01:00.1 bound to vfio-pci
---
Devices listed in /sys/bus/pci/drivers/vfio-pci:
lrwxrwxrwx 1 root root 0 Jan 2 05:18 0000:01:00.0 -> ../../../../devices/pci0000:00/0000:00:01.0/0000:01:00.0
lrwxrwxrwx 1 root root 0 Jan 2 05:18 0000:01:00.1 -> ../../../../devices/pci0000:00/0000:00:01.0/0000:01:00.1
vfio-pci binding complete
```