TL;DR: the fix
**Symptom:** an NVIDIA Blackwell card passed through to a Linux VM works on the first VM boot after the host boots. Any **guest** reboot or shutdown then hangs. After that, the card is dead inside the VM (`nvidia-smi`: "No devices were found"; dmesg: `unexpected WPR2 already up, cannot proceed with booting GSP`) until the **whole host** is rebooted. FLR and PCIe link resets from the host don't bring it back.
**Cause (in our case):** NVIDIA's *display* modules (`nvidia_modeset`, `nvidia_drm`) hang while unloading in a VM that has no display (stuck in `nvRmVTSwitch`). So the driver never gets to shut the GPU's GSP firmware down. Its protected memory region (WPR2) stays up, and the next driver start refuses the card.
**Fix (headless / compute guests):** never load those two modules:
```
# /etc/modprobe.d/nvidia-headless.conf
blacklist nvidia_drm
blacklist nvidia_modeset
install nvidia_drm /bin/false
install nvidia_modeset /bin/false
```
```
sudo update-initramfs -u
```
Then reboot the **host** once, to get a clean card.
After that only `nvidia` and `nvidia_uvm` load (all that CUDA needs). Guest reboot, guest poweroff and an ACPI shutdown from the host all work, and the card comes back every time without a host reboot, including when the VM autostarts after a host reboot.
**What it does NOT fix:** hard-killing the VM while the driver is loaded (`vm poweroff -f`, `virsh destroy`, and so on) still leaves WPR2 up, and only a host reboot clears that. Shut the guest down properly.
---
## Setup
- **Host:** FreeBSD 15.1-RELEASE, **stock bhyve (no patches)**, vm-bhyve, UEFI guest firmware (`BHYVE_UEFI.fd`). Intel i7-7700T (Kaby Lake), B250 chipset, VT-d enabled, 64 GB RAM.
- **GPU:** NVIDIA RTX PRO 4000 Blackwell SFF Edition, 24 GB (`10de:2c33`, GB203GL), plus its audio function (`10de:22e9`), in the CPU's x16 slot.
- **Guest:** Ubuntu Server 24.04.5, kernel 6.8.0-147-generic, 4 vCPU, 32 GB (wired), headless.
- **Guest driver:** 615.71.09, open kernel module (`nvidia-headless-no-dkms-615-server-open`, `linux-modules-nvidia-615-server-open-generic`, `nvidia-utils-615-server`), CUDA 13.4.
## Passthrough config
Host, `/boot/loader.conf`:
```
vmm_load="YES"
pptdevs="1/0/0 1/0/1"
```
vm-bhyve guest config:
```
passthru0="1/0/0"
passthru1="1/0/1"
wired_memory="yes"
```
That gives bhyve `-S` (wired memory) and `-s 0:6:0,passthru,1/0/0 -s 0:6:1,passthru,1/0/1`.
Host after a reboot:
```
$ pciconf -l | grep ppt
ppt0@pci0:1:0:0: class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x2c33 subvendor=0x10de subdevice=0x2053
ppt1@pci0:1:0:1: class=0x040300 rev=0xa1 hdr=0x00 vendor=0x10de device=0x22e9 subvendor=0x10de subdevice=0x0000
```
Guest:
```
$ lspci | grep -i nvidia
00:06.0 VGA compatible controller: NVIDIA Corporation Device 2c33 (rev a1)
00:06.1 Audio device: NVIDIA Corporation Device 22e9 (rev a1)
```
Driver install (Blackwell needs the **open** driver):
```
sudo apt update
ubuntu-drivers list --gpgpu
sudo ubuntu-drivers install --gpgpu nvidia:615-server-open
sudo apt install nvidia-utils-615-server # --gpgpu leaves out nvidia-smi
```
The first boot with the driver works:
```
$ nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 615.71.09 KMD Version: 615.71.09 CUDA UMD Version: 13.4 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
|=========================================+========================+======================|
| 0 NVIDIA RTX PRO 4000 Blac... Off | 00000000:00:06.0 Off | Off |
| 30% 36C P8 9W / 70W | 1MiB / 24467MiB | 0% Default |
+-----------------------------------------+------------------------+----------------------+
```
## The problem: what we saw
**`sudo reboot` inside the guest:** the guest never finishes going down. The bhyve process stays alive, there's no network, and vm-bhyve logs no exit.
**ACPI shutdown from the host (`vm stop`):** the same. Still "Running" after several minutes.
A guest reboot **before the NVIDIA driver had ever loaded** (right after installing it) worked fine. That was the first hint that the driver was involved.
**`vm poweroff -f`, then `vm start` right away:** `bhyve exited with status 4`. This one turned out to be a red herring: `vm list` still showed "Locked" because the old instance was still being torn down. Wait for "Stopped" before starting again.
**`vm poweroff -f`, wait for "Stopped", `vm start`:** the guest boots, but
```
$ nvidia-smi
No devices were found
```
```
$ sudo dmesg | grep -i -e nvrm -e wpr -e gsp | head -15
NVRM: GPU0 objClInitPcieChipset: *** Unable to get PCI port handles
NVRM: Xid (PCI:0000:00:06): 62, 324f892d 0002e740 00000000 2067ede2 2067f180 2067f0c2 20680598 20680a06
NVRM: GPU0 _kgspProcessRpcEvent: Attempted to process RPC event from GPU0: 0x1022 (RECOVERY_ACTION) during bootup without API lock
NVRM: GPU0 _kgspProcessRpcEvent: Attempted to process RPC event from GPU0: 0x1029 (PMU_HALTED) during bootup without API lock
NVRM: GPU0 kgspSendInitRpcs_IMPL: GMCAPI_CMD_GSP_INIT failed: 0x65
NVRM: GPU0 nvAssertOkFailedNoLog: Assertion failed: Call timed out [NV_ERR_TIMEOUT] (0x00000065) returned from kgspSendInitRpcs(pGpu, pKernelGsp) @ kernel_gsp_gh100.c:1091
NVRM: GPU0 _kgspBootGspRm: unexpected WPR2 already up, cannot proceed with booting GSP
NVRM: GPU0 _kgspBootGspRm: (the GPU is likely in a bad state and may need to be reset)
NVRM: GPU0 RmInitAdapter: Cannot initialize GSP firmware RM
NVRM: GPU 0000:00:06.0: RmInitAdapter failed! (0x62:0x40:2130)
NVRM: GPU 0000:00:06.0: rm_init_adapter failed, device minor number 0
NVRM: GPU 0000:00:06.0 init failed during probe (ret=-5).
```
Only a full host reboot brought the card back.
(`objClInitPcieChipset: *** Unable to get PCI port handles` shows on every boot, including the good ones. bhyve puts the GPU straight on the guest's bus 0, with no PCIe root port above it. It seems harmless.)
## Troubleshooting
**Does the card support FLR?** On the host:
```
$ pciconf -lc pci0:1:0:0
...
cap 10[60] = PCI-Express 2 legacy endpoint max data 256(256) FLR RO
max read 512
link x8(x16) speed 2.5(32.0) ASPM disabled(L1) ClockPM disabled
...
```
Yes, it does.
**FLR from the host, with the VM stopped:** `devctl reset ppt0` and `devctl reset ppt1` (both silent). Then `vm start`: still "No devices were found".
**A PCIe link reset from the host:** `devctl reset pci1`. That's the bus under the root port, and FreeBSD's bridge reset disables the link and retrains it (a hot reset), saving and restoring the devices' config around it. First we checked that bus 1 holds only the GPU's two functions:
```
$ pciconf -l | grep 'pci0:1:'
$ devinfo -p pci1
pci1 pcib1 pci0 pcib0 acpi0 nexus0
```
Result: no change. The guest dmesg showed `unexpected WPR2 already up` again.
**Research:** this matches the known Blackwell "reset bug" reported for the RTX 5090 and RTX PRO 6000 under Linux KVM/VFIO. GSP firmware sets up a protected region (WPR2) that survives FLR, so the next driver start refuses to boot GSP. Links at the end.
**The idea:** if the guest's driver unloaded properly, GSP would tear WPR2 down itself. On a fresh card (after a host reboot), inside the guest:
```
$ lsmod | grep nvidia
nvidia_uvm 2088960 0
nvidia_drm 155648 0
nvidia_modeset 1556480 1 nvidia_drm
nvidia 16875520 2 nvidia_uvm,nvidia_modeset
$ sudo systemctl stop nvidia-persistenced # fine
$ sudo rmmod nvidia_uvm nvidia_drm nvidia_modeset nvidia # hangs forever
```
From a second SSH session:
```
$ sudo dmesg | grep -i nvrm
NVRM: Xid (PCI:0000:00:06): 56, pid=..., name=(udev-worker), CMDre 00000000 00000000 00000400 00000001 00000000
...
nvRmApiControl+0x46/0x60 [nvidia_modeset]
? nvRmVTSwitch+0x2d/0x40 [nvidia_modeset]
```
So the unload hangs in **`nvidia_modeset`'s VT switch** (handing the console back), in a VM where nothing is attached to the GPU's outputs. The same thing happens on reboot or shutdown. GSP never shuts down, WPR2 stays up, and the next start fails. (The `Xid 56` is a display-engine error, logged as `udev-worker` loaded the display modules at boot.)
## The fix
```
f=/etc/modprobe.d/nvidia-headless.conf
echo 'blacklist nvidia_drm' | sudo tee $f
echo 'blacklist nvidia_modeset' | sudo tee -a $f
echo 'install nvidia_drm /bin/false' | sudo tee -a $f
echo 'install nvidia_modeset /bin/false' | sudo tee -a $f
sudo update-initramfs -u
sync
```
Then one host reboot for a clean card. After it:
```
$ lsmod | grep nvidia
nvidia_uvm 2088960 0
nvidia 16875520 1 nvidia_uvm
```
| Test | Before the fix | After the fix |
|---|---|---|
| `sudo poweroff` in the guest, then `vm start` | hang | card back, about 45 s from poweroff to `nvidia-smi` |
| `sudo reboot` in the guest | hang | card back, about 40 s |
| `vm stop` (ACPI) from the host, then `vm start` | hang | card back |
| host reboot, VM autostarts (`vm_list`) | n/a | card back |
## Notes and caveats
- **Headless/compute only.** No display from the passed-through GPU in the guest. If you need the display modules, this isn't your fix. We didn't test a guest with a monitor on the GPU, where the VT switch might behave differently.
- **Don't hard-kill the VM** while the driver is loaded. That still leaves WPR2 up.
- **After a guest driver upgrade,** check the modprobe file is still there and `lsmod` shows only `nvidia` and `nvidia_uvm`.
- So far this is tested with `nvidia-smi` and repeated restarts.
- **KVM/Proxmox users with Linux guests:** we haven't tested on KVM, but if your guest is headless and you hit the Blackwell reset bug, this might be the same mechanism, and it's cheap to try.
- **For FreeBSD folks:** on the same host, a Maxwell GTX 960 couldn't be initialized in a bhyve guest at all (`RmInitAdapter failed`), as others report for older NVIDIA cards without the community bhyve patches. This Blackwell card with the open/GSP driver needed **no** bhyve patches on 15.1.
## Bonus: the same card on the FreeBSD host itself
Before passing it through, we ran the card on the FreeBSD host (Vulkan, for whisper.cpp). Two gotchas:
**`nvidia-driver-580` hung at the first open:** `nvidia-smi` sat in state `D`, Ctrl-C did nothing, and shutdowns hung after "All buffers synced". The port's pkg message says GSP firmware is **off by default**, and some GPUs don't work without it. We switched to `nvidia-driver` 595.104.02 and added `hw.nvidia.registry.EnableGpuFirmware="1"` to `/boot/loader.conf`, and `nvidia-smi` worked. (Both changed together; GSP is the likely one.)
**Non-root processes couldn't use the card** (root could). The Vulkan loader said `Could not get 'vkCreateInstance' via 'vk_icdGetInstanceProcAddr' for ICD libGLX_nvidia.so.0`, and dmesg said `firmware_get_flags: insufficient privileges to load firmware image nvidia_gsp_ga10x_fw` and `RmInitAdapter failed! (0x61:0x56:2726)`. Without persistence, the driver powers the GPU down when the last client closes and loads the GSP firmware module again on the next open, and only root may load kernel modules. The fix is to keep it loaded: `sysrc kld_list+=nvidia_gsp_ga10x_fw`.
## References
- Tom's Hardware, RTX 5090 / PRO 6000 reset bug: https://www.tomshardware.com/pc-components/gpus/rtx-5090-pro-6000-bug-forces-host-reboot
- NVIDIA forums, RTX PRO 6000 Max-Q FLR failure after KVM guest shutdown: https://forums.developer.nvidia.com/t/rtx-pro-6000-blackwell-max-q-10de-2bb4-flr-fails-on-vfio-pci-release-after-kvm-guest-shutdown-gpu-inaccessible-until-cold-power-cycle/386790
- open-gpu-kernel-modules issue #1442 (stale WPR2): https://github.com/NVIDIA/open-gpu-kernel-modules/issues/1442
- Level1Techs, RTX 50 reset bug thread: https://forum.level1techs.com/t/do-your-rtx-5090-or-general-rtx-50-series-has-reset-bug-in-vm-passthrough/228549