Skip to content

CmdPal: Accurate GPU usage in Dock#48710

Open
michaeljolley wants to merge 1 commit into
mainfrom
dev/mjolley/squad/gpu-usage-accuracy
Open

CmdPal: Accurate GPU usage in Dock#48710
michaeljolley wants to merge 1 commit into
mainfrom
dev/mjolley/squad/gpu-usage-accuracy

Conversation

@michaeljolley

@michaeljolley michaeljolley commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

GPUStats.GetData() summed the cooked Utilization Percentage value of every engtype=3D GPU-Engine performance-counter instance for a given physical adapter. Each instance is a (process, engine) pair. Summing across processes for a single engine is correct (gives total engine utilization), but summing across multiple 3D engines on the same adapter compounds them and produces values >100% (the 104%/118% screenshots in the issue). The displayed value sum / 100 therefore exceeded 1.0, and the chart fed the raw inflated sum directly.

Fix

Mirroring the bounded-counter approach used for CPU in #46381:

  1. Bucket cooked values by (physId, engineId) rather than just physId.
  2. Reduce per-adapter to the maximum engine utilization (what Task Manager surfaces as the overall GPU number).
  3. Clamp the per-adapter value to [0, 100] before storing it as a 0–1 fraction in Data.Usage and pushing to the chart.
  4. Defensive checks: skip NaN / Infinity / negative cooked values, and skip instances whose engine id can't be parsed.

Fixes #48677

Per-engine 3D utilization values were summed across all engines on the
same physical adapter, which produced totals >100% on multi-engine GPUs
(e.g. Intel UHD 630 under load showed 104-118%).

Bucket cooked values by (physId, engineId), reduce each adapter to the
max engine utilization (matching Task Manager), and clamp to [0, 100].
Mirrors the bounded-counter approach used for CPU in #46381.
@michaeljolley michaeljolley added the Product-Command Palette Refers to the Command Palette utility label Jun 18, 2026
@michaeljolley michaeljolley self-assigned this Jun 18, 2026
@michaeljolley michaeljolley changed the title fix(cmdpal): accurate GPU usage in Dock — #48677 CmdPal: Accurate GPU usage in Dock Jun 18, 2026
@michaeljolley michaeljolley marked this pull request as ready for review June 19, 2026 00:42
@michaeljolley michaeljolley enabled auto-merge (squash) June 19, 2026 00:51
@michaeljolley michaeljolley added Needs-Review This Pull Request awaits the review of a maintainer. CmdPal-Inbox Extensions labels Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CmdPal-Inbox Extensions Needs-Review This Pull Request awaits the review of a maintainer. Product-Command Palette Refers to the Command Palette utility

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

GPU usage still inaccurate in Command Palette Dock after fix in #46381 (CPU)

1 participant