[GH-ISSUE #14] RTX 3070 (GA104, 10de:2484) unlocked inside a VFIO guest; an in-guest FLR cleared WPR2, so no cold boot was needed #9

Closed
opened 2026-10-31 06:55:30 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @goktug7913 on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/JustAResearcher/gpu-unlock-ada/issues/14

Summary

  • GA104 confirmed working: RTX 3070 non-LHR 10de:2484, VBIOS 94.04.3A.40.2B, at revision 4e7fefc.
  • The card runs inside a KVM/VFIO guest (libvirt, Ubuntu 24.04 guest, kernel 6.8.0-147, NVIDIA open 580.178.04). The host has no NVIDIA driver; the card is bound to vfio-pci.
  • It unlocked live, with no cold boot. The card had been in use by nvidia for days. I unloaded nvidia, triggered an FLR from inside the guest, and the module then read wpr2_hi=0x0 and completed the full sequence. On this card under VFIO, an FLR clears WPR2.
  • It survives VM reboots. The VFIO/QEMU reset on a guest reboot leaves SS0/SS1 unlocked and the PLM open. The initramfs module then returns -EALREADY.

Setup

  • Host: physical function reset_method = flr bus, and DevCap shows FLReset+. The guest also sees FLReset+, so the claim check passes and the guest's pcie_flr becomes a real FLR.
  • Guest: nvidia is not in the initramfs. Firmware is generated with make assets and staged in /lib/firmware/gpu-unlock/610.43.03/. The module is built with make -C kernel/gpu_unlock against the guest kernel.

Live sequence (card previously initialized by nvidia)

sudo systemctl stop nvidia-persistenced
sudo rmmod nvidia_uvm nvidia_drm nvidia_modeset nvidia
echo 1 | sudo tee /sys/bus/pci/devices/0000:06:00.0/reset   # FLR
sudo insmod gpu_unlock.ko targets=0000:06:00.0
sudo modprobe nvidia nvidia_uvm nvidia_drm

Key log lines:

entry: plm=0xffffff8f ss0=0x3200125 ss1=0x7 wpr2_hi=0x0
FWSEC WPR2: low=0x1ffe000 high=0x1ffee00 expected_page=0x1ffe00 end=0x1fff00000
selector result: SS0=0x88888888 expected=0x88888888 matched=1
selector result: SS1=0x8 expected=0x8 matched=1
PCIe FLR returned: result=0
post-FLR SEC2 reset released, GSP halted, BME=0 pending=0 WPR2=1ffffe00:00000000 SS0=88888888 SS1=00000008
gpu_unlock: unlocked

The stock 580.178.04 driver then loaded with no Xid errors.

Results (same card, 270 W cap, same driver and cubin, stock vs unlocked)

Probe Stock Unlocked
tensor_modes_issue f16/f32 (built for sm_86) 45.8 T 89.6 T (1.96×)
tensor_modes_issue tf32/f32 22.9 T 45.3 T (1.98×)
tensor_modes_issue u4/s32 (control) 364.0 T 362.5 T
cuBLAS 8192³ fp16/fp32acc 44.4 TF/s 80.2 TF/s
cuBLAS 8192³ bf16/fp32acc 44.2 TF/s 79.2 TF/s
cuBLAS 8192³ fp16/fp16acc (control) 75.8 TF/s 75.5 TF/s
  • 0 mismatches in every tensor_modes_issue mode.
  • validate_gemm: 6/6 FP16/BF16 cases exact vs the CPU reference.
  • Random 4096² vs an fp64 reference: fp16/fp32acc relative error 2.1e-4 (fp16acc: 3.3e-3), so accumulation stays fp32.
  • 90 s bf16 8192³ soak: 78.8 TF/s, bit-identical repeats, 79 °C, no Xid.
  • Every GEMM mode now sits at the 270 W cap (throttle reason: SW power cap).

Boot persistence

  • Installed via DKMS, the initramfs-tools modules.d file, and gpu_unlock.targets=0000:06:00.0 on the guest cmdline.
  • After a guest reboot the log shows entry: plm=0xffffffff ss0=0x88888888 ss1=0x8 wpr2_hi=0x0, then -EALREADY. Throughput is still unlocked (f16/f32 90.6 T, cuBLAS 79.9 TF/s).
  • Not tested yet: a full host power-off followed by the initramfs unlock on a cold card.

Small suggestions

  1. validate_gemm.cu hard-rejects anything other than sm_89. Allowing sm_86 (prop.minor != 9 && prop.minor != 6) was the only change needed to run it on Ampere. tensor_modes_issue.cu builds unchanged with -arch=sm_86.
  2. The already-unlocked path is reported as gpu_unlock: unlock failed (-114). A distinct info-level message such as "already unlocked (PLM open), skipping" would avoid alarming anyone on warm/VM reboots.
  3. README: "power off before the first attempt" could mention that an FLR may be enough, at least on GA104 under VFIO. Under passthrough, unload nvidia and write to the sysfs reset node first.
Originally created by @goktug7913 on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/JustAResearcher/gpu-unlock-ada/issues/14 ## Summary - **GA104 confirmed working**: RTX 3070 non-LHR `10de:2484`, VBIOS 94.04.3A.40.2B, at revision `4e7fefc`. - **The card runs inside a KVM/VFIO guest** (libvirt, Ubuntu 24.04 guest, kernel 6.8.0-147, NVIDIA open 580.178.04). The host has no NVIDIA driver; the card is bound to `vfio-pci`. - **It unlocked live, with no cold boot.** The card had been in use by `nvidia` for days. I unloaded `nvidia`, triggered an FLR from inside the guest, and the module then read `wpr2_hi=0x0` and completed the full sequence. On this card under VFIO, an FLR clears WPR2. - **It survives VM reboots.** The VFIO/QEMU reset on a guest reboot leaves SS0/SS1 unlocked and the PLM open. The initramfs module then returns `-EALREADY`. ## Setup - Host: physical function `reset_method` = `flr bus`, and DevCap shows `FLReset+`. The guest also sees `FLReset+`, so the claim check passes and the guest's `pcie_flr` becomes a real FLR. - Guest: `nvidia` is not in the initramfs. Firmware is generated with `make assets` and staged in `/lib/firmware/gpu-unlock/610.43.03/`. The module is built with `make -C kernel/gpu_unlock` against the guest kernel. ## Live sequence (card previously initialized by nvidia) ```sh sudo systemctl stop nvidia-persistenced sudo rmmod nvidia_uvm nvidia_drm nvidia_modeset nvidia echo 1 | sudo tee /sys/bus/pci/devices/0000:06:00.0/reset # FLR sudo insmod gpu_unlock.ko targets=0000:06:00.0 sudo modprobe nvidia nvidia_uvm nvidia_drm ``` Key log lines: ``` entry: plm=0xffffff8f ss0=0x3200125 ss1=0x7 wpr2_hi=0x0 FWSEC WPR2: low=0x1ffe000 high=0x1ffee00 expected_page=0x1ffe00 end=0x1fff00000 selector result: SS0=0x88888888 expected=0x88888888 matched=1 selector result: SS1=0x8 expected=0x8 matched=1 PCIe FLR returned: result=0 post-FLR SEC2 reset released, GSP halted, BME=0 pending=0 WPR2=1ffffe00:00000000 SS0=88888888 SS1=00000008 gpu_unlock: unlocked ``` The stock 580.178.04 driver then loaded with no Xid errors. ## Results (same card, 270 W cap, same driver and cubin, stock vs unlocked) | Probe | Stock | Unlocked | |---|---:|---:| | `tensor_modes_issue` f16/f32 (built for sm_86) | 45.8 T | 89.6 T (1.96×) | | `tensor_modes_issue` tf32/f32 | 22.9 T | 45.3 T (1.98×) | | `tensor_modes_issue` u4/s32 (control) | 364.0 T | 362.5 T | | cuBLAS 8192³ fp16/fp32acc | 44.4 TF/s | 80.2 TF/s | | cuBLAS 8192³ bf16/fp32acc | 44.2 TF/s | 79.2 TF/s | | cuBLAS 8192³ fp16/fp16acc (control) | 75.8 TF/s | 75.5 TF/s | - 0 mismatches in every `tensor_modes_issue` mode. - `validate_gemm`: 6/6 FP16/BF16 cases exact vs the CPU reference. - Random 4096² vs an fp64 reference: fp16/fp32acc relative error 2.1e-4 (fp16acc: 3.3e-3), so accumulation stays fp32. - 90 s bf16 8192³ soak: 78.8 TF/s, bit-identical repeats, 79 °C, no Xid. - Every GEMM mode now sits at the 270 W cap (throttle reason: SW power cap). ## Boot persistence - Installed via DKMS, the initramfs-tools `modules.d` file, and `gpu_unlock.targets=0000:06:00.0` on the guest cmdline. - After a guest reboot the log shows `entry: plm=0xffffffff ss0=0x88888888 ss1=0x8 wpr2_hi=0x0`, then `-EALREADY`. Throughput is still unlocked (f16/f32 90.6 T, cuBLAS 79.9 TF/s). - Not tested yet: a full host power-off followed by the initramfs unlock on a cold card. ## Small suggestions 1. `validate_gemm.cu` hard-rejects anything other than sm_89. Allowing sm_86 (`prop.minor != 9 && prop.minor != 6`) was the only change needed to run it on Ampere. `tensor_modes_issue.cu` builds unchanged with `-arch=sm_86`. 2. The already-unlocked path is reported as `gpu_unlock: unlock failed (-114)`. A distinct info-level message such as "already unlocked (PLM open), skipping" would avoid alarming anyone on warm/VM reboots. 3. README: "power off before the first attempt" could mention that an FLR may be enough, at least on GA104 under VFIO. Under passthrough, unload `nvidia` and write to the sysfs `reset` node first.
Author
Owner

@JustAResearcher commented on GitHub (Oct 26, 2026):

Thanks for a really clear report! GA104 under VFIO, with an in-guest FLR clearing WPR2, is a new and useful data point, and the matched numbers line up with the 3090/3080 results.

On your suggestions:

  • validate_gemm accepts sm_86 on main now.
  • The -114 on an already-unlocked card is the module skipping because the PLM is already open. Agreed that an info-level "already unlocked, skipping" would read better than "unlock failed".
  • The FLR note is fair for VFIO setups. On bare metal the README sticks with a power-off, since WPR2 behaviour varies by board.

Closing as completed. Thanks again!

<!-- gh-comment-id:6408028280 --> @JustAResearcher commented on GitHub (Oct 26, 2026): Thanks for a really clear report! GA104 under VFIO, with an in-guest FLR clearing WPR2, is a new and useful data point, and the matched numbers line up with the 3090/3080 results. On your suggestions: - `validate_gemm` accepts sm_86 on main now. - The `-114` on an already-unlocked card is the module skipping because the PLM is already open. Agreed that an info-level "already unlocked, skipping" would read better than "unlock failed". - The FLR note is fair for VFIO setups. On bare metal the README sticks with a power-off, since WPR2 behaviour varies by board. Closing as completed. Thanks again!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JustAResearcher/gpu-unlock-ada#9
No description provided.