I managed to finally get started with running Windows 10 under KVM, but after a while, seems to be mostly at random, it never got passed 1 hour uptime before nVidia driver crashes and I get a black screen. I can’t even RDP into the VM when it does this (I can before it crashes).
Event Viewer reports “Event 4101, Display”:
Display driver nvlddmkm stopped responding and has successfully recovered.
It never recovers though, it stays black. The next error I get is "Event 41, Kernel-Power" because I force shut it off from Virt-Manager. I get the Event 4101 every 4 seconds, I got like 10 to 20 errors logged in Event Viewer until I force off the VM. I disabled PCI-E power-saving, I disabled sleep and set display to never turn-off. I had the VM powered on 4 or 5 times and the same thing always happened.
PC specs
Pentium G4560 (2 threads passed to Windows)
8 GB of RAM (4 GB for Windows)
nVidia GT1030 (passed to Windows)
Intel HD 610 (host GPU)
M.2 SSD where the host OS (Manjaro) is installed
SATA SSD where Windows is installed (also passed the whole drive to Windows VM)
PCI-E USB expansion card (passed to Windows)
I booted directly into Windows, did a clean install of 431.36 drivers WHQL, rebooted as a VM, same thing happened. Back on bare metal, then I turned off the internet, uninstalled this one, rebooted and installed the 431.36 DCH WHQL drivers (the new “UWP driver”). Rebooted (still on bare metal), everything seemed to work fine. Turned the internet back on, rebooted, then booted inside the VM. It did last a little longer, but after around 1h, the driver crashed again, same error (Event 4101).
Any ideas? I appreciate all help, I’m getting desperate after I managed to make the VM to work, only to encounter instability.
Edit: I forgot to mention that when I’m booted straight into Windows, the GPU works as expected and I don’t encounter any crashes or instability. It only happens when I boot Windows in KVM.
I think I came across this problem recently. This was the fix for me, however I don’t know what version of qemu you’re on. I wasn’t getting code43, however drivers wouldn’t load and I was getting bsod’s and blackscreens.
QEMU 4.0: Unable to load graphics drivers/BSOD after driver install using Q35
Starting with QEMU 4.0 the q35 machine type changes the default kernel_irqchip from off to split which breaks some guest devices, such as nVidia graphics (the driver fails to load / black screen / code 43). Switch to full KVM mode instead with <ioapic driver='kvm'/> under libvirts <features> tag or kernel_irqchip=on in the -machine qemu arg.
As far as I can remember (I’m not at home at the moment), it showed nVidia GT1030 correctly. I even played a game for half and hour before I got bored and it worked fine, however, the display driver later crashed.
I will do the XML change in around 4-5h, I’m very eager to tinker with it.
I tested it for a while, played a game a few hours, opened some browsers, plugged and unplugged USBs, everything seems to work fine. I’d like to test it for a few days, before I mark your answer as the solution. But this might have solved it, it never passed 1h before until it crashed - also, all activities seemed a little smoother.
Yep, I tested the solution, I had 1 day uptime. I’m still waiting for a second wireless keyboard to arrive. I am enjoying living in the future. Thank you, @exabits
Strange, I do not have any crashes, although I installed the update from the driver updater, and not from the official site. I don’t know if this affected, but I downloaded the updater from this thinkmobiles.com/blog/best-free-driver-updater/ review and as I understand it, it determined and downloaded the exact version that we are talking about.
Sorry for reviving this topic but I wanted to leave the information here because this thread is one of the very few relevant search result for this issue. I hope it can save frustrations to someone else.
So I had a working pass through setup for a RTX 3090 but I tried every option or suggestion I could find here and on the internet for qemu-kvm, bios, etc… Also tried a lot of different Nvidia driver versions, and no matter what I did, I was getting the display driver error (code 4101) after running any graphical app for ~10-20min (and sometimes while idle). After the error occurring once, I could never fully reset the GPU without rebooting the host. Failure do do so would cause the same display driver crash/reset within minutes, until an eventual full crash of the Guest.
After searching a lot, I came upon a post about optimizations and a specific section about enabling MSI interrupts in the Windows guest for performance.
In my own Windows 10 VM, I noticed that this mode was already enabled for my GPU by default. But it lead me to read further on this topic and I found this explanation about the various interrupt modes:
I started messing with it, and it turns out, the solution for me was to force the mode to line-based interrupts on the GPU device. Since making the change I’ve been running hours long of GPU testing under 100% load without a single occurrence of the Nvidia driver crashing or error code 4101. I’ve also noticed no fps drop in the tests I’m running.
I would recommend being careful with this setting because it can make your VM non-bootable if set wrong. And there may be reasons to have certain devices functioning in MSI mode for latency (sound cards, etc). Also, the associated driver must support the requested mode. But If you have this issue, it’s worth checking out. In my case, the GPU has MSI disabled and all other devices which are capable, have it enabled.
You can edit register keys/values directly or use this tool to switch it on/off.
Search : MSI_util_v3.zip if links become broken
I was using HDMI on my GT 1030, so I’m not sure that may be a solution. The solution, as mentioned above was modifying the qemu-server XML file for the VM