QEMU-KVM, GPU Passthrough, Windows 10 - Crashing

I've been happily running a couple of Windows 10 VMs on QEMU-KVM with GPU Passthrough for the last few years with little issue. A few days ago however (21 May 2020) both my VMs started crashing on start-up.

If I boot Windows in safe mode - it works. If I boot with the Windows GPU drivers disabled - it works. As soon as install or enable the driver it crashes (blank screen, VM uses 100% CPU, can't toggle num lock on keyboard) and after a few seconds the VM reboots.

Anyone had similar issues or know how I can further troubleshoot?


Hardware

  • MB: GA-X99P-SLI
  • CPU: i7-6850K
  • RAM: 32GB
  • Host GPU: Nvidia Geforce 9400 GT
  • Guest GPUs x2: Nvidia GTX GeForce 1060 6GB
  • Disk: Samsung 950 PRO NVMe 512GB

Software

  • Ubuntu Server 18.04/20.04
  • qemu-kvm 2.11/4.2
  • Windows 10 x64 1909

Things I've Tried

  • Although unlikely, as both VMs started crashing at the same time, I rolled back several Windows updates
  • Tried old drivers, windows update drivers, and the latest Nvidia drivers
  • This coincided with an apt upgrade so I tried rolling back but I couldn't (easily) as I'd cleaned my cache (d'oh!!) and the packages weren't available
  • There's no errors or warnings in Windows events
  • There's no errors or warnings in /var/log/libvirt/qemu
  • All GPUs run fine together on bare metal
  • Rebuilt everything with latest LTS version of Ubuntu (20.04) and related qemu-kvm (4.2)
  • Switched VMs from i440 to Q35
2

2 Answers

OK, so thanks to this post I've managed to fix the issue, at least in a test environment:

The steps I took were:

  1. Set <kvm><hidden state='off'/></kvm> in my VM config - this disabled the GPU drivers so I could boot into windows
  2. Set the MSISupported registry key to "1" for my GPU
  3. Re-set <kvm><hidden state='on'/></kvm> in my VM config

--

I'll rebuild my VMs properly next weekend (I've been running one Win 10 instance on bare metal) and, all things going well, accept this as the answer.

--

Edit: I rebuilt my VMs and the above initially fixed the issue. I run multiple different GPUs across my VMs however and, every time I changed GPU, it reset the registry key. I ended up replacing all my GPUs with AMDs which worked better (still have a reset bug, but at least they worked).

Adding this fixes the problem

 <hyperv> <vendor_id state="on" value="whatever"/> </hyperv>

Had the same problem.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like