Here is my setup. I have it set up so that I can play games in GNU/Linux as a friend plays in the VM.
Guide:
wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
Script:
#!/bin/bash
OPTS=""
# CPU Configuration
OPTS="$OPTS -cpu host,kvm=off"
OPTS="$OPTS -smp 2,sockets=1,cores=2,threads=1"
OPTS="$OPTS -enable-kvm"
# RAM
OPTS="$OPTS -m 6000"
# UEFI
OPTS="$OPTS -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd"
# QEMU Monitoring
OPTS="$OPTS -monitor stdio"
# Optical drive
#OPTS="$OPTS -cdrom "/path/to/iso""
# Emulated video device
#OPTS="$OPTS -vga qxl"
# 240GB SSD
OPTS="$OPTS -hda /dev/sdc"
# R9 270
OPTS="$OPTS -device vfio-pci,host=06:00.0,multifunction=on"
OPTS="$OPTS -device vfio-pci,host=06:00.1"
# PCI Gigabit NIC
OPTS="$OPTS -device vfio-pci,host=05:00.0,rombar=0 -net none"
# USB DAC
OPTS="$OPTS -usb -device usb-host,vendorid=0x0d8c,productid=0x000e"
# Gamepad
OPTS="$OPTS -usb -device usb-host,vendorid=0x1532,productid=0x0111 "
# USB Hub connected to KVM switch
OPTS="$OPTS -usb -device usb-host,hostbus=3,hostport=13.1.1 -usb -device usb-host,hostbus=3,hostport=13.1.2 -usb -device usb-host,hostbus=3,hostport=13.1.3 -usb -device usb-host,hostbus=3,hostport=13.1.4 -usb -device usb-host,hostbus=3,hostport=13.1.5 -usb -device usb-host,hostbus=3,hostport=13.1.6 -usb -device usb-host,hostbus=3,hostport=13.1.7"
OPTS="$OPTS -usb -device usb-host,hostbus=3,hostport=10.1.7 -usb -device usb-host,hostbus=3,hostport=10.1.6"
# USB hub on monitor
OPTS="$OPTS -usb -device usb-host,hostbus=2,hostport=5.1.1 -usb -device usb-host,hostbus=2,hostport=5.1.2 -usb -device usb-host,hostbus=2,hostport=5.2 -usb -device usb-host,hostbus=2,hostport=5.1"
# Start VM
sudo qemu-system-x86_64 $OPTS