KVM VGA passthough freezing issues (Resolved)

I succeded in getting KVM with VGA passthough on an AMD APU and MSI Radeon 390 after the advice given to me from my previous topic:

So now I have the latest Radeon driver installed and a basic Windows system running with a few games.

The issue though is when in-game. It plays flawlessly at better performance than my old system (probably because there was so many background processes sloing them down) but occasionally freezes for a few seconds. Say Geralt is mid-sentence and he freezes with this horrible buzzing sound in my headphones. Are there and settings I am missing, doing wrong or is it just an issue I'll have to deal with?

My QEMU Script:

qemu-system-x86_64 \
-serial none \
-parallel none \
-nodefaults \
-nodefconfig \
-enable-kvm \
-name Windows \
-cpu host,kvm=off,check \
-smp sockets=1,cores=4,threads=1 \
-m 6144 \
-rtc base=localtime \
-drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/ovmf_code_x64.bin \
-drive if=pflash,format=raw,file=/usr/share/ovmf/x64/ovmf_vars_x64.bin \
-device vfio-pci,host=01:00.0,multifunction=on \
-device vfio-pci,host=01:00.1 \
-soundhw hda \
-netdev user,id=user.0 -device e1000,netdev=user.0 \
-usb -usbdevice host:046d:c537 -usbdevice host:2516:0011 \
-boot menu=on \
-nographic \
-vga none \
-device virtio-scsi-pci,id=scsi \
-device ide-cd,bus=ide.1,drive=virtiocd \
-drive file=/usr/share/virtio/virtio-win.iso,id=virtiocd,if=none \
-hda ./windows/win.qcow2

System Specs:

AMD A10 6800K
MSI R9 390 8GB
AsRock FM2A85X-ITX
Arch Linux running Windows 8.1 with UEFI BIOS(s) from https://www.kraxel.org/repos/jenkins/edk2/

I can cope it most of the time, but it definitely is immmersion breaking and online games will be near unplayable if I lock mid game. I already have terrible ping times as it is! I'm also having trouble getting the pulseaudio to work as I have to run the script as root..


I also get a few blue screens (CRITICAL_PROCESS_ERROR) in which I can only fix by going into safe mode, uninstalling the graphics driver and rebooting. The graphics then reinstalls and I can reboot a few times until another
blue screen.

It can also be kind of random. It can restart after a blue screen and the system is working fine again..

Is this an issue with KVM or something I am doing wrong? I also
cannot get an arch linux guest to run. It completely freezes after a few of the bootup messages...

So the video and audio lock up momentarily or is it a audio only issue? and does it do it in other games or other operations in Windows?

It's like the system hangs occasionally. In games it happens, but it would probably happen if I did anything intensive.. The GPU fan spins down when the system locks and then back up again so I can only assume it's the GPU passthrough being odd..

So......how is your hardware configured as far as CPU, memory, and drive space, I had a problem like that when I used the default drive space allocation in QEMU/Virt-manager while I was testing different setups, but in my final couple of KVMs I used a entire 1tb HD for the KVM and the problem never came back, I do have sound latency but that's a totally different issue. I've never ran Win 8 or 8.1 but I'd assume it like every other Windows OS wants to create a swap file, I found that using part of a drive that the host was also using cause latency kinda' like your describing...but not sure exactly what your problem might be.

OK I think the issue is solved.. I did something stupid.. I didn't enable the vfio-bind service at boot..! No idea how it was working without binding the devices but now it seems to run without any issues.

Still unable to get sound to work, but I'm using the gpu sound via my monitor so there arnt any issues there. The only problem I have is with booting an arch linux guest which still locks at startup..