[GH-ISSUE #135] Compatibility report: RTX 3060 Laptop 6 GB (10de:2520, Lenovo 17aa:3a5d) - unlocks only with NVreg_GpuInitOnProbe=1, likely root cause for the 'no speedup' reports #99

Open
opened 2026-10-26 16:40:34 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @andreas715 on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Zagitta/gpu-unlock/issues/135

TL;DR: this board unlocks, but only when the NVIDIA driver is told to initialise the GPU
at PCI probe (NVreg_GpuInitOnProbe=1). With the 595 default (init on first client open) the
selectors are written and verified pre-driver, then re-latched during the first client-init and
the rate stays at stock. Related: #53, #125 (boards that gained), #124, #111 (unlock completes,
no speedup).


Result

gpu_unlock completes on this board and the selectors verify before the driver binds, but the
tensor rate stays at stock. Root cause: the 595 driver's GPU init lifetime. It initialises the
GPU on the first client open and stops it on the last client close, so the device is
initialised (and torn down) again between the module's pre-driver write and the first CUDA
process, which re-latches the selectors.

Setting NVreg_GpuInitOnProbe=1 - initialise at PCI probe, before any client exists - makes the
unlock take effect: FP16 +55%, BF16 +56%, TF32 +66%, FP32 control flat. Reproduced four times
across three GEMM sizes, with GSP on and GSP off.

Card

Lenovo laptop (subsystem 17aa:3a5d), AMD Ryzen 7 5800H, RTX 3060 Laptop GPU 6 GB (GA106M),
VBIOS 94.06.21.00.23, 30 SMs. Hybrid graphics: the internal panel is driven by the AMD iGPU
(nvidia-drm: Cannot find any crtc or sizes), the dGPU is CUDA-only and never leaves D0.

PCI IDs

0000:01:00.0 3D controller [0302]: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] [10de:2520] (rev a1)
        Subsystem: Lenovo Device [17aa:3a5d]
0000:01:00.1 Audio device [0403]: NVIDIA Corporation GA106 High Definition Audio Controller [10de:228e] (rev a1)

VBIOS version: 94.06.21.00.23

Software

Kali rolling, kernel 7.0.12+kali-amd64, NVIDIA 595.91.07 proprietary (DKMS), Secure Boot
disabled, kernel lockdown none, initramfs-tools 0.151, power limit 85 W current / 90 W max.
The module is unsigned and taints the kernel.

gpu-unlock at af28cbb plus the one-line local patch adding 0x2520 to supported_ids
(same approach as #53 / #125), DKMS install, firmware generated locally into
/usr/lib/firmware/gpu-unlock/610.43.03, initramfs-tools drop-in, kernel command line
gpu_unlock.targets=0000:01:00.0.

Measurements

cuBLAS cublasGemmEx, FP32 accumulate, 8 warm-up + 16 timed, median, AC,
platform_profile=performance. Cross-checked with torch.matmul (reduced-precision
reductions off).

8192³ stock unlock, 595 default init unlock, GpuInitOnProbe=1, GSP off unlock, GpuInitOnProbe=1, GSP on
FP16 24.69 24.38 / 24.97 / 25.24 38.14 38.30 / 38.49 / 38.53
BF16 25.68 25.46 / 25.72 / 25.66 39.81 39.81 / 40.01 / 40.21
TF32 13.07 12.97 / 12.98 / 12.99 21.51 21.50 / 21.63 / 21.67
FP32 (control) 8.64 8.55 / 8.59 / 8.54 8.65 8.63 / 8.64 / 8.66

4096³ with the fix: FP16 38.0, BF16 40.9, TF32 20.9, FP32 6.78.
2048³ with the fix: FP16 40.6, BF16 42.0, TF32 22.8, FP32 6.62.

GSP is irrelevant to the unlock (both columns match). It does cost VRAM:
NVreg_EnableGpuFirmware=1 leaves CUDA with 5935 free / 6054 total MiB, =0 gives
5686 / 5809 - so GSP off is worth ~245 MiB and is the configuration to keep here.

Idle: 9.2 W at 210 MHz with probe init, 11.4 W before - no idle power penalty.
Load: 82-89 W, 1770 MHz, 55 °C.

Kernel log

Pre-driver, with the fix in place (FEAT_PLM added by a logging-only local patch):

pci 0000:01:00.0: entry: plm=0xffffff8f ss0=0x31501126 ss1=0x6 wpr2_hi=0x0
pci 0000:01:00.0: selector write: SS0=0x88888888
pci 0000:01:00.0: selector write: SS1=0x8
pci 0000:01:00.0: pre-FLR selectors: ss0=0x88888888 ss1=0x8
pci 0000:01:00.0: post-FLR SEC2 reset released, GSP halted, BME=0 pending=0 WPR2=1ffffe00:00000000 SS0=88888888 SS1=00000008 FEAT_PLM=ffffffff
pci 0000:01:00.0: gpu_unlock: unlocked

The same log is printed with the default init lifetime, and the rate still stays flat - the
selector write is not the part that fails.

Evidence that the re-latch happens at driver init

  • With the driver bound and the default init lifetime: SS0=0x31501126 (its pre-unlock value),
    SS1=0x6, FEAT_PLM=0xffffff8f - back to the values the module recorded at entry.
  • Writing SS0/SS1 from a module while the driver owns the GPU is ignored
    (before 0x31501126 -> after 0x31501126): host access is protected again once the GPU has
    been initialised.
  • GSP on (NVreg_EnableGpuFirmware=1) vs off (=0): identical, before and after. Not the
    GSP axis.
  • Not runtime PM: runtime_suspended_time was 395 ms over 76 s uptime; the dGPU stays in D0.
  • Suspend/resume never actually happened on this box: both deep and s2idle attempts abort
    with nv_pmops_suspend returns -5 because NVreg_PreserveVideoMemoryAllocations=1 needs
    the driver's procfs suspend interface. Suspend-based evidence is void here.

What does not work: nvidia-persistenced

Holding the GPU with nvidia-persistenced (persistence_mode: Enabled) does not preserve
the selectors: 24.48 / 25.78 / 13.14 / 8.66, i.e. stock. Mechanically expected in hindsight -
the daemon is itself the first client, so its client-open init is the very init that re-latches
the selectors. Only initialisation that happens before any client opens the device
(probe-time) keeps them.

Caveat: shutdown/restart can stall while the unlock is active

Correction to my first reading: this is a shutdown stall, not a boot hang. Twice on this
machine, pressing restart produced a dark screen with the power LED still on and no further
progress; the next power-on then worked normally (that "failed boot" never existed - the
machine never finished shutting down, so there was no journal for it). Recovery both times:
hold the power button, cold power-on.

Nothing survives in the journal past systemd-shutdown: Sending SIGTERM to remaining processes... - journald stops there on this box even on clean shutdowns - so the stalled step
is not directly visible. The prime suspect is the driver's power-management path rather than
the module: this machine has NVreg_PreserveVideoMemoryAllocations=1 and
NVreg_EnableS0ixPowerManagement=1 set, and the same driver already fails suspend with

NVRM: GPU 0000:01:00.0: PreserveVideoMemoryAllocations module parameter is set. System Power
Management attempted without driver procfs suspend interface.
nvidia 0000:01:00.0: PM: pci_pm_suspend(): nv_pmops_suspend [nvidia] returns -5

i.e. those parameters require the procfs suspend integration (nvidia-persistenced-style
/proc/driver/nvidia/suspend), and it is not configured here.

Confirmed fix: with both parameters removed, the same restart that had wedged twice shut
down instantly. So the stall was the driver's shutdown/power-management path calling into a
suspend interface that was never set up, not gpu_unlock - the module only runs at boot.

Not yet explained: one boot after that fix came up on a text console instead of the GUI (no
journal entry exists for it at all, so it likely never reached userspace; the panel was showing
the previous shutdown console). Possibly unrelated flakiness on this machine, which the owner
says predates the unlock. Worth flagging only so nobody blames the module for it.

Why other boards and drivers differ

In 595 GpuInitOnProbe defaults to 0 (init on first client open); in 615 the default becomes
AUTO, which initialises at PCI probe for an ordinary PCI GPU. That matches the reports: the
2520 boards that gained ran 615.78.08 (#125) and 595.99.02 with open modules (#53), while the
"unlock completes, no speedup" reports (#124 3070 laptop, #111 3050 6GB) are consistent with a
teardown-on-close init lifetime eating the unlock the same way.

Suggested upstream change: check and log this parameter when the unlock verifies but the
driver about to bind is 595 or older with probe-time init disabled - that would turn a silent
no-op into a one-line hint for every mobile report.

Reproducing / reverting

# enable
echo 'options nvidia NVreg_GpuInitOnProbe=1' | sudo tee /etc/modprobe.d/nvidia-gpuinit.conf
sudo update-initramfs -u -k "$(uname -r)"   # reboot
# revert to the stock GPU init lifetime
sudo rm /etc/modprobe.d/nvidia-gpuinit.conf
sudo update-initramfs -u -k "$(uname -r)"   # reboot

Keep gpu_unlock.targets=0000:01:00.0 on the kernel command line. Removing it (or running
revert.sh) disables the unlock without touching the driver parameter.

Originally created by @andreas715 on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/Zagitta/gpu-unlock/issues/135 TL;DR: this board unlocks, but only when the NVIDIA driver is told to initialise the GPU at PCI probe (`NVreg_GpuInitOnProbe=1`). With the 595 default (init on first client open) the selectors are written and verified pre-driver, then re-latched during the first client-init and the rate stays at stock. Related: #53, #125 (boards that gained), #124, #111 (unlock completes, no speedup). --- ## Result `gpu_unlock` completes on this board and the selectors verify before the driver binds, but the tensor rate stays at stock. Root cause: the 595 driver's GPU init lifetime. It initialises the GPU on the first client open and stops it on the last client close, so the device is initialised (and torn down) again between the module's pre-driver write and the first CUDA process, which re-latches the selectors. Setting `NVreg_GpuInitOnProbe=1` - initialise at PCI probe, before any client exists - makes the unlock take effect: FP16 +55%, BF16 +56%, TF32 +66%, FP32 control flat. Reproduced four times across three GEMM sizes, with GSP on and GSP off. ## Card Lenovo laptop (subsystem `17aa:3a5d`), AMD Ryzen 7 5800H, RTX 3060 Laptop GPU 6 GB (GA106M), VBIOS `94.06.21.00.23`, 30 SMs. Hybrid graphics: the internal panel is driven by the AMD iGPU (`nvidia-drm: Cannot find any crtc or sizes`), the dGPU is CUDA-only and never leaves D0. ## PCI IDs ```text 0000:01:00.0 3D controller [0302]: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] [10de:2520] (rev a1) Subsystem: Lenovo Device [17aa:3a5d] 0000:01:00.1 Audio device [0403]: NVIDIA Corporation GA106 High Definition Audio Controller [10de:228e] (rev a1) ``` VBIOS version: `94.06.21.00.23` ## Software Kali rolling, kernel `7.0.12+kali-amd64`, NVIDIA `595.91.07` proprietary (DKMS), Secure Boot disabled, kernel lockdown none, initramfs-tools 0.151, power limit 85 W current / 90 W max. The module is unsigned and taints the kernel. `gpu-unlock` at `af28cbb` plus the one-line local patch adding `0x2520` to `supported_ids` (same approach as #53 / #125), DKMS install, firmware generated locally into `/usr/lib/firmware/gpu-unlock/610.43.03`, `initramfs-tools` drop-in, kernel command line `gpu_unlock.targets=0000:01:00.0`. ## Measurements cuBLAS `cublasGemmEx`, FP32 accumulate, 8 warm-up + 16 timed, median, AC, `platform_profile=performance`. Cross-checked with `torch.matmul` (reduced-precision reductions off). | 8192³ | stock | unlock, 595 default init | unlock, `GpuInitOnProbe=1`, GSP off | unlock, `GpuInitOnProbe=1`, GSP on | | ----- | ----- | ----------------------- | ---------------------------------- | ---------------------------------- | | FP16 | 24.69 | 24.38 / 24.97 / 25.24 | **38.14** | 38.30 / 38.49 / 38.53 | | BF16 | 25.68 | 25.46 / 25.72 / 25.66 | **39.81** | 39.81 / 40.01 / 40.21 | | TF32 | 13.07 | 12.97 / 12.98 / 12.99 | **21.51** | 21.50 / 21.63 / 21.67 | | FP32 (control) | 8.64 | 8.55 / 8.59 / 8.54 | 8.65 | 8.63 / 8.64 / 8.66 | 4096³ with the fix: FP16 38.0, BF16 40.9, TF32 20.9, FP32 6.78. 2048³ with the fix: FP16 40.6, BF16 42.0, TF32 22.8, FP32 6.62. GSP is irrelevant to the unlock (both columns match). It does cost VRAM: `NVreg_EnableGpuFirmware=1` leaves CUDA with 5935 free / 6054 total MiB, `=0` gives 5686 / 5809 - so GSP off is worth ~245 MiB and is the configuration to keep here. Idle: 9.2 W at 210 MHz with probe init, 11.4 W before - no idle power penalty. Load: 82-89 W, 1770 MHz, 55 °C. ## Kernel log Pre-driver, with the fix in place (`FEAT_PLM` added by a logging-only local patch): ```text pci 0000:01:00.0: entry: plm=0xffffff8f ss0=0x31501126 ss1=0x6 wpr2_hi=0x0 pci 0000:01:00.0: selector write: SS0=0x88888888 pci 0000:01:00.0: selector write: SS1=0x8 pci 0000:01:00.0: pre-FLR selectors: ss0=0x88888888 ss1=0x8 pci 0000:01:00.0: post-FLR SEC2 reset released, GSP halted, BME=0 pending=0 WPR2=1ffffe00:00000000 SS0=88888888 SS1=00000008 FEAT_PLM=ffffffff pci 0000:01:00.0: gpu_unlock: unlocked ``` The same log is printed with the default init lifetime, and the rate still stays flat - the selector write is not the part that fails. ## Evidence that the re-latch happens at driver init - With the driver bound and the default init lifetime: `SS0=0x31501126` (its pre-unlock value), `SS1=0x6`, `FEAT_PLM=0xffffff8f` - back to the values the module recorded at `entry`. - Writing SS0/SS1 from a module while the driver owns the GPU is **ignored** (`before 0x31501126 -> after 0x31501126`): host access is protected again once the GPU has been initialised. - GSP on (`NVreg_EnableGpuFirmware=1`) vs off (`=0`): identical, before and after. Not the GSP axis. - Not runtime PM: `runtime_suspended_time` was 395 ms over 76 s uptime; the dGPU stays in D0. - Suspend/resume never actually happened on this box: both `deep` and `s2idle` attempts abort with `nv_pmops_suspend returns -5` because `NVreg_PreserveVideoMemoryAllocations=1` needs the driver's procfs suspend interface. Suspend-based evidence is void here. ## What does *not* work: nvidia-persistenced Holding the GPU with `nvidia-persistenced` (`persistence_mode: Enabled`) does **not** preserve the selectors: 24.48 / 25.78 / 13.14 / 8.66, i.e. stock. Mechanically expected in hindsight - the daemon is itself the first client, so its client-open init is the very init that re-latches the selectors. Only initialisation that happens before any client opens the device (probe-time) keeps them. ## Caveat: shutdown/restart can stall while the unlock is active Correction to my first reading: this is a **shutdown** stall, not a boot hang. Twice on this machine, pressing restart produced a dark screen with the power LED still on and no further progress; the next power-on then worked normally (that "failed boot" never existed - the machine never finished shutting down, so there was no journal for it). Recovery both times: hold the power button, cold power-on. Nothing survives in the journal past `systemd-shutdown: Sending SIGTERM to remaining processes...` - journald stops there on this box even on clean shutdowns - so the stalled step is not directly visible. The prime suspect is the driver's power-management path rather than the module: this machine has `NVreg_PreserveVideoMemoryAllocations=1` and `NVreg_EnableS0ixPowerManagement=1` set, and the same driver already fails suspend with ```text NVRM: GPU 0000:01:00.0: PreserveVideoMemoryAllocations module parameter is set. System Power Management attempted without driver procfs suspend interface. nvidia 0000:01:00.0: PM: pci_pm_suspend(): nv_pmops_suspend [nvidia] returns -5 ``` i.e. those parameters require the procfs suspend integration (`nvidia-persistenced`-style `/proc/driver/nvidia/suspend`), and it is not configured here. **Confirmed fix:** with both parameters removed, the same restart that had wedged twice shut down instantly. So the stall was the driver's shutdown/power-management path calling into a suspend interface that was never set up, not `gpu_unlock` - the module only runs at boot. Not yet explained: one boot after that fix came up on a text console instead of the GUI (no journal entry exists for it at all, so it likely never reached userspace; the panel was showing the previous shutdown console). Possibly unrelated flakiness on this machine, which the owner says predates the unlock. Worth flagging only so nobody blames the module for it. ## Why other boards and drivers differ In 595 `GpuInitOnProbe` defaults to `0` (init on first client open); in 615 the default becomes `AUTO`, which initialises at PCI probe for an ordinary PCI GPU. That matches the reports: the 2520 boards that gained ran 615.78.08 (#125) and 595.99.02 with open modules (#53), while the "unlock completes, no speedup" reports (#124 3070 laptop, #111 3050 6GB) are consistent with a teardown-on-close init lifetime eating the unlock the same way. Suggested upstream change: check and log this parameter when the unlock verifies but the driver about to bind is 595 or older with probe-time init disabled - that would turn a silent no-op into a one-line hint for every mobile report. ## Reproducing / reverting ```sh # enable echo 'options nvidia NVreg_GpuInitOnProbe=1' | sudo tee /etc/modprobe.d/nvidia-gpuinit.conf sudo update-initramfs -u -k "$(uname -r)" # reboot # revert to the stock GPU init lifetime sudo rm /etc/modprobe.d/nvidia-gpuinit.conf sudo update-initramfs -u -k "$(uname -r)" # reboot ``` Keep `gpu_unlock.targets=0000:01:00.0` on the kernel command line. Removing it (or running `revert.sh`) disables the unlock without touching the driver parameter.
Sign in to join this conversation.
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
Zagitta/gpu-unlock#99
No description provided.