Repository navigation
Conversation
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.
Author
|
I can remove 629ab90 if you're not interested in mac CI. |
spofdamon
force-pushed
the
macos-support
branch
from
August 5, 2026 19:43
71d5cab to
49cfee7
Compare
This was referenced Sep 28, 2026
Conflict resolution after the upstream interface/NVLink/ECC refactor: - interface.c: keep master's NVLink-aware fan layout, but keep this PR's fan_rpm-before-CPU-FAN ordering so Apple's SMC tachometer wins over the generic "CPU-FAN" placeholder. Keep master's half-watt power formatting. - tests/CMakeLists.txt: keep master's platform selection for the process info source and add the appleTests target from this PR. - compile.yml: drop the standalone build-macos job; master already builds and tests on macOS in the matrix, with SHA-pinned actions.
- Enable IOReport/AppleSMC telemetry only on Apple Silicon. Both private interfaces, their key sets and the SMC float encoding are arm64 specific; Intel Macs also report hasUnifiedMemory for their iGPU. Detect with hw.optional.arm64, keeping Rosetta-translated builds working (falling back to sysctl.proc_translated). - Document that IOReportCopyChannelsInGroup's three trailing arguments are all uint64_t and match the private ABI, and align the declared prototypes (CFMutableDictionaryRef return, int32_t indices/returns). - Document that AppUsage.accumulatedGPUTime is a nanosecond counter (same source as Activity Monitor) and that GPU time can exceed wall time before the 100% clamp. - Document why the SMC result byte is checked and status is not, that SMC 'flt' keys are little-endian on Apple Silicon, and that the reported fan RPM is the chassis fan shared by the SoC. - Note the Rosetta 125/3 ns timebase workaround and its htop origin, and that the cached timebase is single-threaded. - Add a README note that power/clock/temperature/fan come from private interfaces that may change between macOS releases. - Report power in whole watts in the TUI and snapshot for every backend, including drivers that expose milliwatt precision; drop the fractional display proposed by the PR. - Prefer a real fan RPM over the generic CPU-FAN placeholder consistently in the TUI and snapshot output. - Add tests for a zero timebase denominator and for growing the process array across realloc increments. - Apply clang-format to the new C sources.
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.
Summary
The Apple-specific telemetry fails gracefully when private IOReport, IOKit, or SMC data is unavailable.
Testing