(SOLVED) Windows 10 KVM hangs when installing amd drivers

my windows guest in Qemu KVM seems to work just fine until i install my AMD graphics drivers. right at 40% the VM blacks out the screen and completely hangs.
my host is debian GNU/Linux 10 with an amd threadripper 1950X
the guest GPU is an AMD Radeon RX 590
here is my guest’s XML file: https://pastebin.com/ZBPiNLak
i have already added “options kvm allow_unsafe_assigned_interrupts=1 ignore_msrs=1” to my /etc/modprobe.d/vfio.conf
i was originally using host-passthrough for the vcpu, but that resulted in windows 10 installer bluescreening on boot every single time.

any help is appreciated.

Have you tried setting host-passthrough back on after windows installs?

1 Like

i tried that. it made no difference.

Hmmm.

So are you using the QEMU window on the host to view the VM, or are you using the video out from the GPU?

Also, have you checked that the passed through GPU and it’s audio are still using VFIO?

i look at the monitor connected to the VM, as well as the spice viewer, the entire guest hangs during driver install. i did SSH into the host and can confirm that vfio-pci does remain loaded into the GPU and its audio device at all times.

Maybe try going into device manager in the windows VM and updating drivers for the 590 instead of using the AMD driver package.

Maybe you are running into the AMD gpu reset bug? In that case, you would need to restart the host after every VM shutdown/reboot. You may later be able to ameliorate this, there are a couple of options to allow guest reboots without the host rebooting.

1 Like

i do not think it is the pci reset bug as the same virtualization setup runs Linux with that GPU perfectly fine. and it can even reboot without the host rebooting

i tried to install the drivers from the device manager, but the graphics card is not listed in device manager (or i just couldn’t find it). despite the VM using a monitor plugged into it.

It’s not showing in device manager? So you only have the cirrus emulated VGA under display adapters and no default vga device or anything?

the only entries in “display adapters” are 2 “Microsoft Basic Display Adapter”. devices.

Hi, I also had some issues on my Threadripper. However, I think ignore_msrs=1 did the trick for me.

I’m using CPU model “EPYC” and don’t disable the “hypervisor” feature.

My guest is on Windows 1803, BTW. The version might have a big impact actually. For example it didn’t need ignore_msrs=1 on a previous release. If you’re using something newer then maybe that’s the problem.

1 Like

One basic display adapter is probably the emulated vga, the other is the 590.

neither device installs anything when i try to install a driver from windows update via the device manager. it always says the current driver is up to date.

The emulated VGA device has drivers on the virtio ISO.
https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html

I had hoped that the microsoft would have known good drivers that would autodownload, but I guess the 590 is just too new.

after setting the cpu to “EPYC”, the dirver suceeds to install and the VM boots up witht he dirver. however it never gets an image to the monitor connected to the GPU. windows clearly sees it as monitor number 2, but no setting ive tried gets any output to it after OVMF “start boot option” screen.

if you’ve gotten GPU passthrough to work on threadripper, could you please post your XML configuration of the working setup?

Sure, here’s my XML: https://pastebin.com/M7QXuXQm

Glad you got a step farther. If I remember correctly, I only tweaked CPU topology and memory nodes in there (I’m in NUMA mode), other than that I’m using virt-manager to configure it.

Hm, my passthrough GPU is RX 570. I don’t remember having any issues with display, it worked automatically. I have a small monitor connected via HDMI to the card. I have only one (real) monitor set to active. The other one is from the spice I think and I disabled it in Windows so there’s no extended desktop.

1 Like

after comparing XML configs, the only significant difference i could find is that you have included a numatune block.

after adding the same numatune block to my XML file, the VM fails to start at all with error: “error: Invalid value ‘0’ for ‘cpuset.mems’: Invalid argument”

it may be worth noting that lstopo -v shows that the graphics card is associated with numa node 0.

Huh. Not sure about that error. Yeah, on my setup the graphics card is in the node 0, that’s why I’m picking memory and CPU cores from there.

But anyway, I don’t think any of this matters for your display problem. No idea what’s wrong with that. If you got your physical monitor to work under a Linux guest, then it should work the same on Windows. For me, as soon as I installed the driver the HDMI output started working.

During the boot sequence I briefly see BIOS messages and the Windows logo loading via spice, and then my monitor gets the signal on the Windows login screen.

1 Like

if i disable the emulated display, the monitor just goes black (but not into standby) after OVMF’s “start boot option”.

UPDATE: after switching my monitor’s connection form DVI-D to HDMI, windows now outputs a purple screen to the monitor connected to the GPU. the QXL display still functions flawlessly.

UPDATE: after changing to windows 10 1709, then installing the dec 19 2018 version of radeon software, it all just works over hdmi. but there’s still no output over dvi.

so im gonna mark this as solved.