Skip to content

GSP: PFM_REQ_HNDLR_STATE_SYNC_CALLBACK missing from _kgspProcessRpcEvent bootup whitelist #1145

Open

Description

@mnencia

Summary

NV_VGPU_MSG_EVENT_PFM_REQ_HNDLR_STATE_SYNC_CALLBACK (0x101a) is not on the bootup-poll whitelist in _kgspProcessRpcEvent (src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c, around line 1436). When this RPC arrives while CPU-RM is polling for GSP_INIT_DONE without holding the API lock, it falls through to the default: arm, emits a misleading "during bootup without API lock" error, hits NV_ASSERT(0) at kernel_gsp.c:1447, and the RPC is silently dropped, so the Platform Request Handler never sees that wake's state sync.

This is a log-noise / dropped-RPC report, not a crash. The driver continues to function, but the kernel log accumulates two NVRM error lines per affected wake.

Symptom

On a Blackwell laptop dGPU (RTX PRO 1000, driver 595.71.05, NVreg_DynamicPowerManagement=3), runtime-D3 wake-ups produce the following pair:

NVRM: _kgspProcessRpcEvent: Attempted to process RPC event from GPU0: 0x101a (PFM_REQ_HNDLR_STATE_SYNC_CALLBACK) during bootup without API lock
NVRM: nvAssertFailedNoLog: Assertion failed: 0 @ src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c:1447

Roughly two-thirds of runtime-D3 wakes produce the pair; the rest are clean. Timing-dependent, with clusters of all-assert and all-clean consecutive wakes, consistent with the RPC being driven by the platform handler's own sync schedule rather than the wake itself. The "during bootup without API lock" wording is misleading: this is well past initial GSP boot, on a steady-state runtime-D3 wake.

Root cause

The whitelist immediately above the default: arm enumerates the RPCs that are explicitly safe (or expected) to arrive during the bootup poll window. PFM_REQ_HNDLR_STATE_SYNC_CALLBACK is simply absent from that list:

case NV_VGPU_MSG_EVENT_UCODE_LIBOS_PRINT:
case NV_VGPU_MSG_EVENT_GSP_LOCKDOWN_NOTICE:
case NV_VGPU_MSG_EVENT_GSP_POST_NOCAT_RECORD:
case NV_VGPU_MSG_EVENT_GSP_INIT_DONE:
case NV_VGPU_MSG_EVENT_OS_ERROR_LOG:
case NV_VGPU_MSG_EVENT_GSP_LOAD_EXEC_GENERIC_BOOTLOADER:
case NV_VGPU_MSG_EVENT_GSP_LOAD_EXEC_HS_BINARY:
    break;
default:
    NV_PRINTF(LEVEL_ERROR, "Attempted to process RPC event from GPU%d: 0x%x (%s) during bootup without API lock\n",
              ...);
    NV_ASSERT(0);

Why this handler is safe to run in the bootup-poll context

_kgspRpcEventPlatformRequestHandlerStateSyncCallback decodes the RPC payload and dispatches via pfmreqhndlrStateSync_IMPL on the flags field:

  • For PMGR_LOAD and THERM_INIT, the prereq callbacks only call osQueueWorkItem and return; they touch no shared state inline and make no GSP RPC. The in-tree comment at those callbacks ("we need this to succeed so that we don't have a recursive GSP RPC") guarantees the no-RPC property explicitly.
  • For SMBPBI_OP_SET / SMBPBI_OP_CLEAR, the synchronous portion writes Platform Request Handler counter fields. The polling thread holds the GPU subdevice lock for the duration of the bootup poll, so no concurrent writer to that state can race against the dispatch.

In short: no recursive GSP RPCs, no unprotected shared-state writes. The handler is well-behaved under the constraints the bootup-poll whitelist is enforcing.

Suggested fix

diff --git a/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c b/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c
index ab1c3695..b3c36405 100644
--- a/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c
+++ b/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c
@@ -1440,6 +1440,7 @@ _kgspProcessRpcEvent
             case NV_VGPU_MSG_EVENT_OS_ERROR_LOG:
             case NV_VGPU_MSG_EVENT_GSP_LOAD_EXEC_GENERIC_BOOTLOADER:
             case NV_VGPU_MSG_EVENT_GSP_LOAD_EXEC_HS_BINARY:
+            case NV_VGPU_MSG_EVENT_PFM_REQ_HNDLR_STATE_SYNC_CALLBACK:
                 break;
             default:
                 NV_PRINTF(LEVEL_ERROR, "Attempted to process RPC event from GPU%d: 0x%x (%s) during bootup without API lock\n",

Verification

Built 595.71.05 with the diff applied, ~3 hours of normal use including many runtime-D3 wake cycles. Zero kernel_gsp.c:1447 / 0x101a lines after the patch, vs roughly two-thirds of wakes producing the pair before. No regressions observed.

Relation to issue #1064

This fix is not a fix for #1064. #1064 is a DIFR pmlock deadlock that wedges Mutter on nvkms_lock and requires SysRq REISUB to recover; the deadlock reproduces with this patch applied. The two are unrelated: the only connection is that #1064 was the path by which the missing whitelist entry got noticed. Tracking that separately on the #1064 thread.

Activity

  1. JasonYangShadow commented on May 16, 2026

    @JasonYangShadow

    exactly the same issue

    [  438.593469] NVRM: _kgspProcessRpcEvent: Attempted to process RPC event from GPU0: 0x101a (PFM_REQ_HNDLR_STATE_SYNC_CALLBACK) during bootup without API lock
    [  438.593473] NVRM: nvAssertFailedNoLog: Assertion failed: 0 @ kernel_gsp.c:1447
    
    CPU: AMD Ryzen 9 8940HX (32) @ 2.40 GHz
    GPU 1: NVIDIA GeForce RTX 5070 Ti Mobile [Discrete]
    GPU 2: AMD Radeon 610M [Integrated]
    Kernel: Linux 7.0.8-1-cachyos
    Driver Version: 595.71.05
    

    any documents on how to build the driver? I would like to apply your patch.
    Oh, I am using cachyos with a forked version of nvidia-open module, anyway, this is great for helping fix my issue.

  2. JasonYangShadow commented on May 17, 2026

    @JasonYangShadow

    an update for cachyos users, if you also suffered from the same issue. @mnencia thank you so much for the patch, I've tested and it works for me as well

    https://discuss.cachyos.org/t/where-is-the-source-code-of-cachyos-znver4-linux-cachyos-nvidia-open/29755/4?u=jasonyangshadow

  3. JasonYangShadow commented on May 18, 2026

    @JasonYangShadow

    maybe it is unrelated, though the patch can get rid of the error messages, I am still seeing the discrete gpu wakes up frequently, I think it might be related to the driver itself. I won't see this issue in former versions.

  4. wiiwax commented on May 25, 2026

    @wiiwax

    thanks for this. Just want to add that I'm seeing this too, on a different Blackwell laptop.

    • GPU: NVIDIA RTX PRO 3000 Blackwell (laptop)
    • Driver: 595.71.05 (open module, akmod-nvidia on Fedora 44)
    • Kernel: 7.0.9-205.fc44.x86_64
    • Desktop: GNOME on Wayland

    Lines up with what you described — most boots have zero of these, and the one ~15-hour session that did hit it logged a single burst of two pairs at the same timestamp, which I'm guessing is one D3 wake. No crashes, no Xid, nothing else broke. Just wanted to confirm it's not specific to the PRO 1000 in case that helps narrow things down.

    2026-05-26T06:35:02 NVRM: GPU0 _kgspProcessRpcEvent: Attempted to process RPC event from GPU0: 0x101a (PFM_REQ_HNDLR_STATE_SYNC_CALLBACK) during bootup without API lock
    2026-05-26T06:35:02 NVRM: GPU0 nvAssertFailedNoLog: Assertion failed: 0 @ kernel_gsp.c:1447
    2026-05-26T06:35:02 NVRM: GPU0 _kgspProcessRpcEvent: Attempted to process RPC event from GPU0: 0x101a (PFM_REQ_HNDLR_STATE_SYNC_CALLBACK) during bootup without API lock
    2026-05-26T06:35:02 NVRM: GPU0 nvAssertFailedNoLog: Assertion failed: 0 @ kernel_gsp.c:1447

  5. mnencia commented on Jun 9, 2026

    @mnencia
    Author

    Confirming the fix shipped in 610.43.02 (open kernel modules).

    Verified at src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c:1429:

    case NV_VGPU_MSG_EVENT_PFM_REQ_HNDLR_STATE_SYNC_CALLBACK:
    case NV_VGPU_MSG_EVENT_GSP_LOAD_EXEC_GENERIC_BOOTLOADER:
    

    Same placement as the proposed one-line patch. The paired _kgspProcessRpcEvent ... 0x101a (PFM_REQ_HNDLR_STATE_SYNC_CALLBACK) during bootup without API lock plus nvAssertFailedNoLog @ kernel_gsp.c:1447 lines that fired on roughly two thirds of runtime-D3 wakes on 595.71.05 should now be silenced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions