[PR #2943] [CLOSED] Monitor: opt-in rootless Apple Silicon GPU charts #4349

Closed
opened 2026-11-07 15:35:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2943
Author: @mjhagen
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: codex/macos-monitor-upstream


📝 Commits (1)

  • ad23cb4 Add opt-in Apple Silicon Monitor sensors and charts

📊 Changes

8 files changed (+547 additions, -41 deletions)

View changed files

📝 README.md (+3 -0)
➕ docs/MACOS_MONITOR.md (+56 -0)
➕ serve/apple_telemetry.py (+153 -0)
📝 serve/telemetry.py (+27 -4)
➕ serve/test_apple_telemetry.py (+169 -0)
➕ serve/test_charts.cjs (+60 -0)
📝 serve/web/app.js (+78 -36)
📝 serve/web/index.html (+1 -1)

📄 Description

Closes #2942. Follow-up to the basic macOS IORegistry support in #2360.

Summary

The Mac Monitor can read GPU load and memory, but temperature, power and PCIe remain empty. Add opt-in Apple Silicon charts with rootless temperature/power readings and GPU frequency in place of the discrete-GPU PCIe card.

Enable with STRATA_MACOS_TELEMETRY=1; install optional macmon with brew install macmon for temperature, power and clock readings.

What changed

  • Read GPU driver allocations from IORegistry and label them as shared memory across all apps. Model sizing keeps using the existing Metal reader and working-set budget.
  • Run one background macmon pipe process, discard readings after five seconds, recover from stopped/stalled helpers, and close the helper with telemetry.
  • Adapt Apple dashboard labels, show unavailable samples as gaps, and label strata-mlx's expert-cache budget accurately.
  • Document setup, metric meanings and limitations; add hardware-independent sensor, lifecycle, HTTP and chart tests.

Extra Notes

The feature is off by default. Existing macOS _Metal, NVIDIA/AMD readers, Windows AMD notes and the default spark renderer are preserved; the original spark function is unchanged. Tests cover default reader selection, AMD precedence on macOS, unchanged default chart behavior, missing helpers and stale/invalid data.

Validation on upstream main 477ac13c:

  • python -m unittest serve.test_server serve.test_monitor serve.test_apple_telemetry — 356 tests passed.
  • node serve/test_charts.cjs, node --check serve/web/app.js, and git diff --check — passed.
  • M3 Pro, 18 GPU cores, 36 GiB, macmon 0.10.0: real GPU load/allocation/temperature/power/frequency through the current-main mock HTTP server; browser rendering checked with no console errors. A streamed Flash Next generation was also verified in the earlier v0.1.40-based deployment.

No native engine sources or build files changed. Native Metal/CUDA/HIP/SYCL builds and physical NVIDIA/AMD/Intel Mac hardware were not tested. The extra sensors use OS-dependent IORegistry/IOReport/SMC interfaces and remain optional.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2943 **Author:** [@mjhagen](https://github.com/mjhagen) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/macos-monitor-upstream` --- ### 📝 Commits (1) - [`ad23cb4`](https://github.com/Niko1221/Strata/commit/ad23cb42b83c749863a0e9be6e8a57cc1a41f922) Add opt-in Apple Silicon Monitor sensors and charts ### 📊 Changes **8 files changed** (+547 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+3 -0) ➕ `docs/MACOS_MONITOR.md` (+56 -0) ➕ `serve/apple_telemetry.py` (+153 -0) 📝 `serve/telemetry.py` (+27 -4) ➕ `serve/test_apple_telemetry.py` (+169 -0) ➕ `serve/test_charts.cjs` (+60 -0) 📝 `serve/web/app.js` (+78 -36) 📝 `serve/web/index.html` (+1 -1) </details> ### 📄 Description Closes #2942. Follow-up to the basic macOS IORegistry support in #2360. ## Summary The Mac Monitor can read GPU load and memory, but temperature, power and PCIe remain empty. Add opt-in Apple Silicon charts with rootless temperature/power readings and GPU frequency in place of the discrete-GPU PCIe card. Enable with `STRATA_MACOS_TELEMETRY=1`; install optional `macmon` with `brew install macmon` for temperature, power and clock readings. ## What changed - Read GPU driver allocations from IORegistry and label them as shared memory across all apps. Model sizing keeps using the existing Metal reader and working-set budget. - Run one background `macmon pipe` process, discard readings after five seconds, recover from stopped/stalled helpers, and close the helper with telemetry. - Adapt Apple dashboard labels, show unavailable samples as gaps, and label strata-mlx's expert-cache budget accurately. - Document setup, metric meanings and limitations; add hardware-independent sensor, lifecycle, HTTP and chart tests. ## Extra Notes The feature is off by default. Existing macOS `_Metal`, NVIDIA/AMD readers, Windows AMD notes and the default spark renderer are preserved; the original spark function is unchanged. Tests cover default reader selection, AMD precedence on macOS, unchanged default chart behavior, missing helpers and stale/invalid data. Validation on upstream main `477ac13c`: - `python -m unittest serve.test_server serve.test_monitor serve.test_apple_telemetry` — **356 tests passed**. - `node serve/test_charts.cjs`, `node --check serve/web/app.js`, and `git diff --check` — passed. - M3 Pro, 18 GPU cores, 36 GiB, macmon 0.10.0: real GPU load/allocation/temperature/power/frequency through the current-main mock HTTP server; browser rendering checked with no console errors. A streamed Flash Next generation was also verified in the earlier v0.1.40-based deployment. No native engine sources or build files changed. Native Metal/CUDA/HIP/SYCL builds and physical NVIDIA/AMD/Intel Mac hardware were not tested. The extra sensors use OS-dependent IORegistry/IOReport/SMC interfaces and remain optional. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:35:04 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4349
No description provided.