nvidia: defer NVPCF notifications until runtime resume - #1299
Open
lars76 wants to merge 2 commits into
Open
Conversation
This was referenced Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
On hybrid laptops, the NVIDIA GPU is powered down while idle. However, the firmware can still send NVPCF notifications:
sudo sh -c 'echo balanced > /sys/firmware/acpi/platform_profile'nvidia-powerdreads the latest power limits.Projected onto typical one-hour scenarios (derived from the measured per-wake cost, not from separate runtime A/B tests):
Roughly 20% longer projected battery runtime during normal iGPU-only use.
Problem
On an ASUS GA403UI with an RTX 4070 Laptop GPU, the EC sends
Notify(NPCF, 0xC0)for every 1% of battery discharge.rm_acpi_nvpcf_notify()takes a dynamic-power reference for every notification, waking the GPU even when it is already runtime-suspended.Each wake keeps the GPU in D0 for approximately 20–22 seconds while the deferred-idle checks complete.
Measured with driver 610.57.04 and Linux 7.1.6:
See also: #860 (same root cause), #905 (NVPCF subset), #1201 (same symptom on two other Zephyrus laptops).
Why the notification must not be dropped
The notification contains no policy data. It tells subscribers such as
nvidia-powerdto retrieve the latest policy from the NVPCF_DSM.With notifications discarded while the GPU was suspended,
nvidia-powerdwas not told to retrieve a changed profile. After the GPU resumed, it continued using the old 75/55 W limits instead of the new 90/65 W limits. The limits remained stale until another notification arrived.This is an alternative to the NVPCF portion of #1181. Both approaches prevent the notification-induced wake, but this change preserves delivery of the notification after the GPU resumes.
Scope
This change handles NVPCF only.
A platform-profile change also updates the GPU's temperature target, and the firmware announces that with a second, independent notification on the GPU's ACPI device (
ACPI_NOTIFY_GPS_STATUS_CHANGE, handled byRmHandleGPSStatusChange()).Unlike NVPCF, that notification is consumed by the driver itself rather than by
nvidia-powerd, and nothing re-reads the value later if it is missed.This patch leaves it untouched, so on the tested laptop a profile change still wakes the GPU once. Since it only fires on user actions, the cost is negligible.
#1181 suppresses this notification as well.
How to test (Arch Linux)
After reboot, verify the patched modules are actually running:
Then test on battery: unplug at 98% or lower (at 99–100% the battery gauge stalls and the notification does not fire), wait a minute for the unplug wake to settle, and watch
cat /sys/bus/pci/drivers/nvidia/*/power/runtime_active_timeacross 2–3% of discharge. Patched: the value stays flat. Stock: it grows by roughly 20,000 ms per 1%. Do not run
nvidia-smiorlspciduring the window, as both wake the GPU themselves.Uninstall: