mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2360] [CLOSED] telemetry: the Mac's Monitor cards - GPU load and VRAM from IOKit, th… #4004
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4004
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2360
Author: @demetree
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:f-mac-monitor📝 Commits (1)
bef1c42telemetry: the Mac's Monitor cards - GPU load and VRAM from IOKit, the rest said out loud📊 Changes
4 files changed (+205 additions, -16 deletions)
View changed files
📝
docs/DETAILS.md(+5 -0)📝
serve/server.py(+8 -11)📝
serve/telemetry.py(+114 -5)📝
serve/test_server.py(+78 -0)📄 Description
…e rest said out loud
On a Mac the Monitor tab's GPU cards were empty: telemetry had NVML (NVIDIA) and the amdgpu sysfs files (#301) and nothing else, so the Metal backend read nothing. The Apple GPU's load and memory are in the IOKit registry's IOAccelerator nodes (ioreg -l -w0 -r -c IOAccelerator, 22 ms), and the device's memory budget is the same Metal property the engine reads (metal/src/mtl_rt.mm's recommended_working_set, the engine's "GPU working set" log line
_Metal (a new reader beside _Nvml and _Amd): the index'th accelerator node's PerformanceStatistics give Device Utilization % (older chips: the renderer or the tiler) and the in-use system memory; the total is the working set, read through the Metal framework and objc_msgSend (no PyObjC). The temperature and power sensors are not readable without root (powermetrics), and an Apple Silicon GPU sits on the die, so there is no PCIe link: the cards show a dash and static gpu_note says why, the same way #1380's note does for a Windows AMD card. gpu_reader takes
amdfirst, so the AMD trees still read on a Mac for the tests, and a missing selector is asked for before it is sent (an unanswered one raises an Objective-C exception no ctypes call can catch).Service.free_vram_mib now goes through gpu_reader instead of _Nvml directly, so the Mac gets that reading too (it used to return None there).
Measured on an M1 Max (macOS 26.6.2): through the server, GET /metrics during a request - gpu_name "Apple M1 Max", gpu_vram_total_mib 25559, gpu_util 74-77 % while decoding (9 % once idle), gpu_mem_used 10.5 GiB in use of 24.96 GiB, cpu 12.6 %; the plain-text /prometheus-format metrics carry the same series. serve/test_server.py: MacTelemetry (fixture registry: two accelerators, index selection, renderer/tiler fallback, a raising runner, the note and the samples) plus AmdTelemetry, TelemetryNoDisks, Monitor and the full serve/test_server.py (318 tests) pass on the same box.
What it leaves alone: the NVIDIA and AMD paths (a test-only gpu_reader order change on macOS), and the web app - the cards read the series it already had.
Title
Issue: Resolves #
Summary
What changed
Extra Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.