Passing a GPU to a Virtual Machine for full performance
This is a documentation of my PCI-E pass through setup.
This projects goal was to allow me to use Linux as my main operating system, while still allowing me to play modern windows games outside of wine. To do this I configured QEMU on Linux to attach a PCI-E card, giving it almost native 3d performance. The below video goes into greater detail:
Note: 7B SYSTEM_THREAD_EXCEPTION Bsod is caused by nvidia detecting a virtual machine and killing the driver. Make sure you have cpu host config being passed to the KVM machine. I was not able to get this working using libvirt and virt-manager, which is why I created the shell script. If you are having issues with the aforementioned issue, mount your img to qemu directly using the following configuration fire and see if that works.
#!/bin/bash /usr/bin/synergys –daemon –config /etc/synergy.conf qemu-system-x86_64 -enable-kvm -m 2024 -cpu host,kvm=off \ -smp 4,sockets=1,cores=4,threads=1 \ -device vfio-pci,host=05:00.0,x-vga=on -device vfio-pci,host=05:00.1 \ -device virtio-scsi-pci,id=scsi \ -drive file=/home/dontpanic/vtw/windows.img,id=disk,format=raw,if=none -device scsi-hd,drive=disk \ -usb -usbdevice host:04ca:0061 \ -vga none