Skip to content

perf: cache GPU sensor readings to reduce redundant driver polling#5495

Open
TUSHAR91316 wants to merge 1 commit into
seerge:mainfrom
TUSHAR91316:main
Open

perf: cache GPU sensor readings to reduce redundant driver polling#5495
TUSHAR91316 wants to merge 1 commit into
seerge:mainfrom
TUSHAR91316:main

Conversation

@TUSHAR91316
Copy link
Copy Markdown

Summary

Optimizes discrete and integrated GPU telemetry queries (temperature, usage, and wattage) in AmdGpuControl and NvidiaGpuControl by caching sensor data for 500ms.

Rationale

  • Overhead Reduction: Multiple telemetry readings (e.g. CPU/GPU temp, power, activity) queried sequentially in the same UI or OSD overlay loop previously triggered separate driver/WMI calls (up to 3 times per tick).
  • AMD ADL Optimization: Consolidates PMLog queries (ADL2_New_QueryPMLogData_Get) so Edge Temp, activity, and power readings reuse a single cached payload per update cycle.
  • NVIDIA NVAPI/NVML Optimization: Caches discrete state, core utilization, and NVML power queries for 500ms, minimizing overhead and stuttering.
  • Battery Health: Prevents constant dGPU wakeups or polling spikes, assisting runtime D3 power savings.

Introduce short-term caching for GPU telemetry to reduce frequent ADL/NV API calls. AmdGpuControl: add cached ADLPMLogData for discrete and integrated adapters with timestamps and helper methods (GetDiscreteLogData/GetIntegratedLogData); reuse cached data across temperature, GPU usage and power queries and enforce a 500ms reuse window. Also adjust IsValid placement and simplify iGPU power/usage paths. NvidiaGpuControl: add cached GPU state, usage and power values with 500ms expiry, update GetGpuState/GetGpuUse/GetGpuPower to use cached results and handle power states/NVML shutdown consistently. Minor whitespace/BOM cleanup in Nvidia file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant