feat: Intel Mac GPU monitoring via IOAccelerator: utilization and VRAM for iGPU and AMD dGPU
- Dominant language
- Rust
- Stars
- 279
- Forks
- 28
- Avg merge
- 8h 35m
- Merged PRs (30d)
- 30
Description
## Background
Deferred follow-up to #306 (Intel Mac base support). That issue delivers CPU, SMC temperature, and chassis power support for Intel Macs and explicitly accepts an empty GPU list. This issue adds actual GPU monitoring (utilization, VRAM, temperature) for Intel integrated GPUs and AMD discrete GPUs via the IOAccelerator registry, the sudo-free path used by common macOS monitoring tools. To be scheduled when demand materializes; Apple has announced macOS 26 (Tahoe) as the last Intel-supported release, so the useful lifetime is bounded.
Depends on #306, in particular the SMC sp78 discovery fix and the Intel-specific reader wiring.
## Current State
- The only macOS GpuReader is Apple-Silicon-only and is not even instantiated on Intel (src/device/reader_factory.rs:117-125). Its metrics all come from IOReport/SMC via the native manager (src/device/readers/apple_silicon_native.rs:139-256); no Metal API is actually used ("Metal" is only a version label, :200-209).
- The GPU frequency table lookup matches `AppleARMIODevice` (src/device/macos_native/ioreport.rs:206) and the core-count fallback parses `AGXAccelerator` (apple_silicon_native.rs:373-391); both are absent on Intel Macs, which expose `IntelAccelerator` / `AMDRadeonX*` classes instead.
## Scope
- [ ] New IntelMacGpuReader enumerating IOAccelerator registry entries (IntelAccelerator, AMDRadeonX*) and reading PerformanceStatistics: "Device Utilization %", VRAM used/total, "In use system memory".
- [ ] GPU temperature via SMC TG0P/TG0D (keys already listed at src/device/macos_native/smc.rs:501; requires the sp78 discovery fix from #306).
- [ ] Handle multi-GPU topologies: iGPU + dGPU automatic switching (MacBook Pro), multiple dGPUs (Mac Pro), eGPU hot plug and unplug.
- [ ] UI: the unified-memory assumptions must not apply to Intel GPUs. The dashboard currently substitutes system RAM for GPU memory and sums combined power when `architecture == "Apple Silicon"` (src/ui/dashboard.rs:54-110, 223-232); Intel GPUs should report real VRAM and flow down the generic path. Gauge layout: gpu_renderer sniffs `name.contains("Apple") || name.contains("Metal")` for the 3-gauge ANE layout (src/ui/renderers/gpu_renderer.rs:346, 432-437); Intel GPUs must get the standard 2-gauge layout.
- [ ] API: standard GPU metrics only; no ANE or Apple-Silicon-specific names. Note `all_smi_ane_utilization` is currently exported unconditionally for every GPU (src/api/metrics/gpu.rs:97-105); make it conditional or document a constant 0.
- [ ] Per-process GPU attribution stays out of scope (the Apple Silicon reader also returns an empty list, apple_silicon_native.rs:258-262).
## Considerations
- PerformanceStatistics key names differ between Intel and AMD drivers and across macOS versions; this needs testing on real hardware (the org has a self-hosted Intel Mac).
- Per-GPU power is generally unavailable without sudo; leave power to the chassis PSTR approximation from #306.
## Acceptance Criteria
- [ ] On an Intel Mac with an iGPU (and, where available, a dGPU), view mode lists each GPU with utilization, VRAM used/total, and temperature.
- [ ] The API exports the standard GPU metric family per device, with no ANE or Apple-Silicon-specific metric names for Intel GPUs.
- [ ] Multi-GPU setups and eGPU removal do not crash the reader.
- [ ] Integration is complete end to end: the reader is instantiated by the reader factory, GPU data renders in the TUI with the standard 2-gauge layout, and the API serves it. Module-only delivery does not satisfy this issue.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.