Skip to content

Improve macOS GPU monitoring and telemetry - #496

Open
spofdamon wants to merge 11 commits into
Syllo:masterfrom
spofdamon:macos-support
Open

Improve macOS GPU monitoring and telemetry#496
spofdamon wants to merge 11 commits into
Syllo:masterfrom
spofdamon:macos-support

Conversation

@spofdamon

@spofdamon spofdamon commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • make the macOS test suite build reliably, run it in CI, and move platform parsing and sampling logic into focused, testable helpers
  • report per-process GPU utilization from AGX client GPU-time deltas while hardening IOKit and process resource handling
  • correct process CPU accounting under Rosetta and clarify unified-memory reporting
  • add Apple GPU power draw, active-residency-weighted clock speed, GPU temperature, and system fan RPM telemetry, with fractional display for low power values

The Apple-specific telemetry fails gracefully when private IOReport, IOKit, or SMC data is unavailable.

Testing

  • cmake --build build --parallel
  • ctest --test-dir build --output-on-failure
  • 34 of 34 tests pass on an Apple M5 Max running macOS 26.5.2

Apple IOReport samples scale correctly from roughly 1.2 W at idle to more than 60 W under a controlled Metal load. However, integer milliwatt-to-watt conversion flattened the entire 1.0-1.9 W range to 1 W and made the telemetry appear stuck.

Retain one decimal place when no power limit is available and in snapshot output so low-power variation remains visible.
Apple Silicon exposes its GPU thermal domain through undocumented lowercase Tg keys in AppleSMC rather than Metal. Discover that sorted key range with a binary lookup, cache valid float sensors, and report their average without scanning the full SMC table.

Throttle sensor reads to once per second and fail closed when the private protocol, key ordering, types, or permissions differ.
Apple Silicon exposes current fan speeds through undocumented F?Ac AppleSMC keys. Discover and cache valid float sensors alongside the existing GPU temperature keys, throttle samples independently, and report the highest active system fan through nvtop's singular RPM field.

Keep temperature and fan discovery independent so either metric remains available when the other key family is missing or changes. Prefer measured RPM over the integrated-GPU CPU-FAN placeholder, and reject malformed sensor samples.
@spofdamon

spofdamon commented Aug 5, 2026

Copy link
Copy Markdown
Author

I can remove 629ab90 if you're not interested in mac CI.

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