Hello,
I'm currently working to setup a windows virtual machine with gpu passthrough on my archlinux host.
So at first i created a basic VM with a custom qemu command and it work great.
qemu-system-x86_64 -enable-kvm -m 8192 -cpu host,kvm=off,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_vendor_id=whatever\
-smp cores=4,threads=2\
-device vfio-pci,host=02:00.0,x-vga=on\
-device vfio-pci,host=02:00.1\
-vga none\
-soundhw hda\
-drive file=/dev/sdb,id=diska,format=raw\
-drive file=/dev/sdd,id=diskb,format=raw\
-cdrom /dev/sr0\
-usb -usbdevice host:1b1c:1b13\
-usbdevice host:1b1c:1b12\
-usbdevice host:1b1c:1c08\
-usbdevice host:046d:0a1f\
-usbdevice host:28de:1142
Today i would to go use virt-manager to manage my virtual machine but if i create a basic virtual machine with only the gpu added the gpu is never used.
I can see the GPU in the peripheral manager but it's in error 43.
The -cpu argument have the same settings as my old setup (
-cpu host,kvm=off,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_vendor_id=whatever)
Before on my old setup if i didn't add those options, the gpu was working i had an image on my screen.
Here, the screen remain in sleep mode, i have to use a spice screen to see what's going on the vm.
FYI, guest graphic card is a gtx670 02:00.0 & 02:00.1 [ 10de:1189 & 10de:0e0a ]
So here's the qemu command line started by virtmanager
/usr/sbin/qemu-system-x86_64 -name guest=Windows_10,debug-threads=on -S\
-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-24-Windows_10/master-key.aes\
-machine pc-i440fx-2.8,accel=kvm,usb=off,vmport=off,dump-guest-core=off\
-cpu host,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vendor_id=whatever,kvm=off\
-drive file=/usr/share/ovmf/x64/ovmf_x64.bin,if=pflash,format=raw,unit=0,readonly=on\
-drive file=/var/lib/libvirt/qemu/nvram/Windows_10_VARS.fd,if=pflash,format=raw,unit=1\
-m 16386 -realtime mlock=off -smp 8,sockets=8,cores=1,threads=1 -uuid fc05f50e-8a97-4c51-a8c5-627824d8075c\
-display none -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-24-Windows_10/monitor.sock,server,nowait\
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-shutdown -global PIIX4_PM.disable_s3=1\
-global PIIX4_PM.disable_s4=1 -boot strict=on\
-device nec-usb-xhci,id=usb,bus=pci.0,addr=0x5\
-drive file=/home/makz/virtio-win-0.1.134.iso,format=raw,if=none,id=drive-ide0-0-0,readonly=on\
-device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0\
-drive file=/dev/sdb,format=raw,if=none,id=drive-virtio-disk0,cache=writeback\
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x8,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1\
-drive file=/dev/sdd,format=raw,if=none,id=drive-virtio-disk1,cache=writeback\
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x9,drive=drive-virtio-disk1,id=virtio-disk1\
-netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=27\
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:88:db:2f,bus=pci.0,addr=0x3\
-device intel-hda,id=sound0,bus=pci.0,addr=0x4\
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0\
-device vfio-pci,host=02:00.0,id=hostdev0,bus=pci.0,addr=0xa,rombar=0\
-device vfio-pci,host=02:00.1,id=hostdev1,bus=pci.0,addr=0xb,rombar=0\
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7\
-msg timestamp=on
Here's my xml.
<domain type='kvm'>
<name>Windows_10</name>
<uuid>fc05f50e-8a97-4c51-a8c5-627824d8075c</uuid>
<memory unit='KiB'>16779264</memory>
<currentMemory unit='KiB'>16779264</currentMemory>
<vcpu placement='static'>8</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-2.8'>hvm</type>
<loader readonly='yes' type='pflash'>/usr/share/ovmf/x64/ovmf_x64.bin</loader>
<nvram>/var/lib/libvirt/qemu/nvram/Windows_10_VARS.fd</nvram>
</os>
<features>
<acpi/>
<apic/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='8191'/>