Repository navigation
Conversation
|
Tried this on my GA403UV on 7.1.9-arch1-2, and there are no more power draw spikes every 4-5 minutes. But manually changing the platform-profile still triggers a power draw spike, even in Integrated mode. |
|
Sorry, I just read the
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. It makes sense to me to also defer that notification, as it is not needed while the GPU is powered down. |
|
I tested around it on the same model family (GA403UV, RTX 4060 Laptop, driver 615.71.09, Linux 7.2.6) and found a similar issue that I don't think are covered by this PR nor #1181 covers. This time it happens on AC, and much more often than the battery-tick case. Essentially, the dGPU moves from D3cold to D0 roughly every 30 s. It stays in D0 for ~25 s and only reaches D3cold for 1–6 s before being woken again. From what I saw, the wake-up is due to Notify(PEGP, 0xD1/0xD2/0xD3) to the GPU's ACPI device: 43 notifies in 60 s in my case. All notifications have stopped once battery has reached its charge limit. |
|
Tested c70c661 + 555c98d on an ASUS ROG Zephyrus G16 GU605CP (RTX 5070 Laptop GB206 10de:2d58, Core Ultra 9 285H), nvidia-open 610.57.04 patched via DKMS, kernel 7.2.5. |
|
Tested c70c661 + 555c98d on an ASUS ROG Zephyrus G16 GA605WI (Ryzen AI 9 HX 370 / Radeon 890M, RTX 4070 Laptop 10de:2860), BIOS GA605WI.316, nvidia-open 615.78.08 (both commits apply cleanly), kernel 7.2.8, NixOS, Idle on battery, Plasma Wayland, polling
The patched run still had two wakes of about 21 s, one when unplugging the charger and one when the platform profile changed, both expected per the PR description. Between them the GPU stayed runtime-suspended; 1455 s suspended vs 44 s active over the 25-minute run. No driver errors in the kernel log after boot. |
|
Tested c70c661 + 555c98d on an ASUS ROG Zephyrus G16 GA605KM (Ryzen AI 7 350, RTX 5060 Laptop GPU 10de:2d59), BIOS GA605KM.307, nvidia-open 610.57.04 patched through DKMS (only this PR), kernel 7.2.5 (Arch-based), Same trigger as the GU605CP and GA605WI reports and #1300. On every 1 % battery drop the EC runs query 0x3F and then 0xB6. In this DSDT, Battery, idle desktop, no
No NVRM errors or assertions in the kernel log of the patched boot (about 16 h of uptime so far). Not tested here: whether nvidia-powerd picks up the deferred notification after the next resume. On battery this firmware disables the DC Dynamic Boost controller anyway ( Logs were collected and summarised with help from an LLM assistant; every number comes from the kernel log and sysfs samples described above. |
|
This PR fixes the repeated GPU wakeups on my Legion 7 16IRX9 in Balanced mode on AC. The new Test resultsOn this laptop, the firmware repeatedly reports the same power limits in the I tested PR commit The three 60-second runs recorded function-graph durations for
Stock 595.99.02 also reproduced the wakeups. I counted four 0x48 queries in a separate 30-second check. With LACT's GPU monitoring service ( Mutex checkIf Both Adding the same mode check avoids that call and keeps the existing notification path in coarse and disabled modes. This diff is against 595.99.02 with the PR applied; it also applies after the PR on 610.57.04, 615.71.09 and 615.78.08. --- a/src/nvidia/arch/nvalloc/unix/src/dynamic-power.c
+++ b/src/nvidia/arch/nvalloc/unix/src/dynamic-power.c
@@ -1532,7 +1532,14 @@ NvBool RmDeferNvpcfNotifyIfIdle(
nv_priv_t *nvp = NV_GET_NV_PRIV(nv);
NvBool bDefer;
- if (nvp == NULL)
+ /*
+ * Defer only when os_ref_dynamic_power(nv, NV_DYNAMIC_PM_FINE) would
+ * take the mutex and could resume the GPU. In coarse mode it does
+ * neither. In NV_DYNAMIC_PM_NEVER mode the mutex can be NULL, because
+ * rm_init_dynamic_power_management() selects that mode when it fails
+ * to create the mutex.
+ */
+ if ((nvp == NULL) || (NV_DYNAMIC_PM_FINE > nvp->dynamic_power.mode))
{
return NV_FALSE;
} |
|
Thank you for the proposed fix. We have a solution incorporated in the driver and will be included in a future release. You can reference NVIDIA internal bug number 4084236. |
|
Same problem here on a Lenovo Legion Pro; only happens in the System
What I see In bpftrace on Profile test After switching to |
|
Hi everyone, I just wanted to add my voice in support of this PR. I'm running Arch Linux on an ASUS TUF Gaming A15 (FA506NCG) with an RTX 3050 Laptop GPU and a Radeon iGPU. I was able to confirm this exact issue using bpftrace. The stack trace clearly shows the firmware sending NVPCF ACPI notifications and the driver waking up the dGPU (rm_acpi_nvpcf_notify -> os_ref_dynamic_power -> pci_device_shutdown) immediately after it tries to suspend, causing endless wake/sleep loops and battery drain when idle. The detailed analysis and measurements in this PR are spot on. I would love to see this merged upstream so we don't have to rely on manual kernel module patching. Thank you for the excellent work on this fix! +1 for merging. |
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: