Skip to content

Battery ACPI event wakes up dGPU, shortening battery life on Linux #860

Closed

Description

@ZingiberisZhang

NVIDIA Open GPU Kernel Modules Version

570.144

Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.

  • I confirm that this does not happen with the proprietary driver package.

Operating System and Version

Description: NixOS 25.05 (Warbler)

Kernel Release

Linux Zephyrus 6.14.6 #1-NixOS SMP PREEMPT_DYNAMIC Fri May 9 07:56:10 UTC 2025 x86_64 GNU/Linux

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • I am running on a stable kernel release.

Hardware: GPU

GPU 0: NVIDIA GeForce RTX 4060 Laptop GPU (UUID: GPU-15764050-a2ea-30c8-e844-a5f96fbe0389)

Describe the bug

When battery discharges, it will send a ACPI notification that wakes up dGPU on multi-gpu systems, which shortens battery life

To Reproduce

To reproduce this issue, I leave my laptop idle, and run the following scripts in terminal

sudo bpftrace -e '
kretprobe:nv_pmops_runtime_resume
{
    printf("nv_pmops_runtime_resume returned %d for process %s (pid=%d)\n", retval, comm, pid);
    print(kstack(20));
}
'

and when my dGPU got waken up, it prints:

nv_pmops_runtime_resume returned 0 for process kworker/0:1 (pid=5380)

        __rpm_callback+65
        rpm_callback+89
        rpm_resume+1243
        __pm_runtime_resume+75
        pci_device_shutdown+34
        nv_indicate_not_idle+43
        os_ref_dynamic_power+342
        rm_acpi_nvpcf_notify+131
        acpi_ev_notify_dispatch+70
        acpi_os_execute_deferred+23
        process_one_work+394
        worker_thread+564
        kthread+235
        ret_from_fork+49
        ret_from_fork_asm+26

which indicate that some ACPI event wakes it up. So I run sudo acpi_listen, and got battery PNP0C0A:00 00000080 00000001.

After digging into the source code in this repo, I found that rm_acpi_nvpcf_notify calls os_ref_dynamic_power without checking the dGPU's current runtime power status. I think that it should check whether the dGPU is in the D3Cold state before calling os_ref_dynamic_power to ensure dGPU does not get waken up accidentally.

Bug Incidence

Always

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

More Info

No response

Activity

  1. added
    bug
    on May 20, 2025
  2. ZaheenJ commented on Dec 7, 2025

    @ZaheenJ

    Did you ever find a solution to this issue? I believe I'm having the same issue on a Zephyrus G16 with a 4070.

  3. sharp004 commented on Mar 16, 2026

    @sharp004

    I have the same issue on my razer blade 14 with a 3080. Running on Nobara with 580 open nvidia driver. @PetrusCrus did you find any workaround /solutions ?

  4. ZingiberisZhang commented on Mar 17, 2026

    @ZingiberisZhang
    Author

    I solved this by patching my ACPI table @sharp004

  5. sharp004 commented on Mar 17, 2026

    @sharp004

    Thank you for the hint @PetrusCrus
    My dGPU cycles between D0 and D3cold every ~11 seconds on battery, while it stays stable in D3cold on AC power — which matches exactly the behavior described in this issue.

    Could you share more details about what you did exactly in the ACPI table ?

    • Which table did you patch (DSDT or a specific SSDT)?
    • Which method/device did you modify — did you remove or conditionally suppress the Notify(NPCF, 0xC0) call, or did you take a different approach?
    • Did you disable the NPCF device entirely or just the notification?
    • How did you deploy the patched table (initrd CPIO override, Dracut, or another method)?
    • Did you notice any side effects (Dynamic Boost, suspend/resume, etc.)?

    Any code snippet or diff of your patch would be extremely helpful. Thanks!

  6. phlipmode commented on Oct 19, 2026

    @phlipmode

    Still reproducible with 615.78.08 (open kernel modules) on an RTX 50 laptop. I traced the firmware side on my machine. On this ASUS model, the periodic wake-up comes from an EC query that sends Notify(NPCF, 0xC0) every time it adjusts the Dynamic Boost budget, and that query is not gated by _OSI.

    System

    • ASUS ROG Zephyrus G16 GU605CR, BIOS GU605CR.311 (2025-11-20)
    • Intel Core Ultra 9 285H (Arrow Lake) + RTX 5070 Ti Laptop (GB205M, 10de:2f58), MUX in hybrid mode, internal panel on the iGPU
    • Driver 615.78.08, open kernel modules (NVreg_DynamicPowerManagement=2, Runtime D3 status: Enabled (fine-grained))
    • Kernel 7.2.9, Fedora 44 based (Bazzite), KDE Plasma 6.7 Wayland

    Behaviour

    • On battery only: every 3 to 5 minutes, about 1 s after a power_supply change uevent for BAT1, the dGPU goes D3cold → D0. It stays in D0 for about 24 s, then returns to D3cold.
    • With AC connected it stays in D3cold.
    • Each wake is accompanied by nvidia 0000:01:00.0: Enabling HDA controller in dmesg.
    • No userspace client causes it. During the wakes, no process had /dev/nvidia*, renderD129 or card0 open. Only Xwayland holds card0 permanently, and that does not prevent D3cold otherwise.
    • The behaviour is unchanged with nvidia-powerd stopped.
    • It is also unchanged when all userspace access to the dGPU is blocked through an eBPF LSM (cardwire "integrated" mode). This matches a kernel-internal wake path.

    Firmware path (from the decompiled DSDT, OEM _ASUS_ / Notebook, rev 0x01072009)

    The EC query _QB6 re-evaluates the Dynamic Boost budget from the AC state and the battery charge (RSOC), and then calls SPAB:

    Method (_QB6, 0, NotSerialized)
    {
        If ((FTBL == 0x02))
        {
            If ((ACIN == One))          { SPAB (One) }
            ElseIf ((RSOC > 0x32))      { SPAB (One) }
            Else                        { NDF9 = Zero
                                          SPAB (Zero) }
        }
        ElseIf ((ACIN == One))          { SPAB (One) }
        Else                            { SPAB (Zero) }
    }
    
    Method (SPAB, 1, NotSerialized)
    {
        If (CondRefOf (\_SB.NPCF))
        {
            If ((Arg0 == Zero)) { ^^^^NPCF.DBAC = One
                                  ^^^^NPCF.DBDC = One }
            If ((Arg0 == One))  { ^^^^NPCF.DBAC = Zero
                                  ^^^^NPCF.DBDC = Zero }
            Notify (NPCF, 0xC0) // unconditional, even if nothing changed
        }
    }

    \_SB.NPCF is NVDA0820, defined in the Optimus SSDT (OptRf2 / Opt2Tabl). The battery itself is notified separately via _Q3F / _Q8C, which call Notify (BAT1, 0x80).

    Other Notify (NPCF, 0xC0) sources in the same DSDT are:

    • _QA8
    • SFMN, called from _QD4
    • ASUS WMI WMNB (profile changes)

    None of them is periodic.

    Driver side

    nv_acpi_nvpcf_event() (kernel-open/nvidia/nv-acpi.c) handles ACPI_NVPCF_EVENT_CHANGE (0xC0) by calling rm_acpi_nvpcf_notify(). As the original report showed with bpftrace, that path resumes the GPU (os_ref_dynamic_power → runtime resume) regardless of its current power state. Firmware that re-sends 0xC0 on every battery-level update therefore keeps waking a dGPU that is otherwise idle in D3cold.

    Notes

    • acpi_osi= will not help here: _QB6 and SPAB do not check _OSI/OSYS.
    • I found no module parameter to opt out of NVPCF handling.
    • Possible driver-side fixes:
      • If the GPU is runtime-suspended, defer or coalesce the NVPCF update and apply it on the next resume, instead of resuming the GPU just to process it.
      • Alternatively, ignore 0xC0 notifications whose resulting budget is identical to the current one, since SPAB re-sends the same values most of the time.

    Reproduce / check

    # on battery, idle; watch runtime PM state of the dGPU next to battery uevents
    udevadm monitor --kernel --subsystem-match=power_supply &
    while sleep 0.5; do echo "$(date +%T) $(cat /sys/bus/pci/devices/0000:01:00.0/power/runtime_status)"; done | uniq -f1
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions