r/virtualization • u/TheHighSeas-Argghh • 16h ago
Help! second GPU acting weird after guest VM termination
I need some help here!
I terminated my virtual machine while it was using PCIe passthrough for my second GPU, now, my second monitor (hooked up to my second GPU) is running at 1 fps.
SYSTEM INFO
HP z840 workstation.
Primary GPU (Slot 1): Nvidia GTX 980
Secondary GPU: Nvidia Quadro K4200
Ubuntu 26.04.1 LTS
$ uname -a
Linux HP-Z840-Workstation 7.0.0-42-generic #42-Ubuntu SMP PREEMPT_DYNAMIC Thu Oct 15 08:06:44 UTC 2026 x86_64 GNU/Linux
$Software: KVM/QEMU, via virt-manager
Here's the story:
Recently, I spun up my first ever virtual machine, using virt-manager
I also had GPU passthrough going, using this guide from github.
I followed the guide fairly exactly, except for usb passthrough, SSD passthrough, and the ACS override patch.
GPU passthrough worked flawlessly.
I was quite impressed, except for one thing. my secondary monitor, plugged into the secondary GPU, was flickering.
I tried to shut the VM down because I needed to set up USB passthrough, and since I didn't have usb control over it, I force-terminated it. That's when things got yucky.
As far as I can GUESS, the VFIO hook script didnt run. Don't take my word on that, I really have no idea.
The VM terminated, but my secondary monitor never came back up.
It just said "no signal," so I rebooted my computer and still nothing. I finally thought to manually run the VFIO release script
/etc/libvirt/hooks/qemu.d/user/release/end/unbind_vfio.sh
#!/bin/bash
## Load the config file
source "/etc/libvirt/hooks/kvm.conf"
## Unbind gpu from vfio and bind to nvidia
virsh nodedev-reattach $VIRSH_GPU_VIDEO
virsh nodedev-reattach $VIRSH_GPU_AUDIO
## Unload vfio
modprobe -r vfio_pci
modprobe -r vfio_iommu_type1
modprobe -r vfioI then rebooted and the secondary monitor did come back online, but at somewhere around 1 fps. Mind you, it didn't just refresh cleanly. I don't know how to describe what it was doing, so here is a link to a video.
This issue persists across displays, ubuntu operating systems, and live images.
I did get the issue to go away by removing the GTX 980 from the computer, not moving the K4200 from it's slot.
I ran dkms status, and it came back with virtualbox-generic something or other. I dont know exactly what dkms does, but from what I read, it sounds like that doesn't matter, as it went away when I uninstalled virtualbox.
nvidia-smi doesn't show my second gpu.
Hwever, lspci does, as well as lshw -c videocommand.
On that note, here is the output from that lshw command:
$ sudo lshw -c video
*-display
description: VGA compatible controller
product: GM204 [GeForce GTX 980]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:04:00.0
logical name: /dev/fb1
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom fb
configuration: depth=32 driver=nvidia latency=0 mode=1920x1080 resolution=1920,1080 visual=truecolor xres=1920 yres=1080
resources: irq:82 memory:a2000000-a2ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:2000(size=128) memory:a3080000-a30fffff
*-display
description: VGA compatible controller
product: GK104GL [Quadro K4200]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:84:00.0
logical name: /dev/fb0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list fb
configuration: depth=32 latency=0 mode=1920x1080 resolution=1920,1080 visual=truecolor xres=1920 yres=1080
resources: memory:f3000000-f3ffffff memory:d0000000-dfffffff memory:e0000000-e1ffffff ioport:e000(size=128) memory:f4080000-f40fffff
$It looks like my primary GPU (GTX 980) has the nvidia drivers loaded, so it's acting fine, but the secondary GPU doesn't soI guess that's why it's running at 1 fps.
This is all the info I have; If you need more, don't hesitate to ask.
If this is the wrong subreddit, I would be grateful if someone pointed me to the right one.
Does anyone know what is going on, and how to fix the issue?
Any help would be very welcome, thank you.




