fix(dashboard-api): wire Apple Silicon into /api/gpu/detailed#1025
Merged
Lightheartdevs merged 1 commit intoLight-Heart-Labs:mainfrom Apr 27, 2026
Merged
Conversation
/api/gpu/detailed returned 503 "No GPU data available" on Apple Silicon because `_get_raw_gpus` only branched on `amd` and fell through to NVIDIA→AMD detection (both return None on macOS), producing an empty list even though `get_gpu_info_apple()` was available and worked fine (already used by /api/features). Add an apple branch to `_get_raw_gpus` that wraps the aggregate `GPUInfo` into a single-entry list of `IndividualGPU`. Synthesize a stable `uuid="apple-unified-0"` (>=8 chars to satisfy GPUCard.jsx's `.slice(-8)` key) and `index=0`. Utilization / temperature stay hard-zero on Apple (IOKit isn't accessible from Python here); power_w remains None. The dashboard already handles `power_w = null` and zero-valued utilization/temperature gracefully. NVIDIA / AMD / CPU paths are unchanged — the new branch is gated on the exact string "apple".
5 tasks
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.
What
Wire Apple Silicon GPU detection into
/api/gpu/detailedso the endpoint returns real data instead of a 503 on macOS.Why
_get_raw_gpusinrouters/gpu.pyonly had a branch foramd, then fell through to NVIDIA/AMD sysfs probing — both returnNoneon macOS, yielding an empty list. The existingget_gpu_info_apple()call (already used by/api/features) was never consulted, so every call to/api/gpu/detailedon Apple Silicon returned503 No GPU data available.How
routers/gpu.py: importget_gpu_info_applealphabetically into the existingfrom gpu import (...)block; add private helper_apple_info_to_individual(info: GPUInfo) -> IndividualGPUthat wraps the aggregateGPUInfointo a singleIndividualGPUwithindex=0anduuid="apple-unified-0"(≥8 chars, satisfiesGPUCard.jsx .slice(-8)key requirement); add"apple"as the first branch in_get_raw_gpus, returning[_apple_info_to_individual(info)]orNoneif detection fails (propagates to the existing 503 path).tests/test_gpu_detailed.py: new fixture_sample_apple_gpu_info(); 3 new tests covering single-entry return,None-propagation, and full endpoint 200 response with Apple aggregate data.Testing
pytest tests/test_gpu_detailed.py -k "not history"— 19/19 pass; ruff clean.curl -H "Authorization: Bearer $DASHBOARD_API_KEY" http://localhost:$DASHBOARD_API_PORT/api/gpu/detailedshould return HTTP 200 with a single-entrygpusarray (chip name, VRAM, utilization 0, temperature 0, power_w null).Known Considerations
powermetricsor direct IOKit bindings. Out of scope here.power_wisNoneon Apple; the dashboard already handles this gracefully.Platform Impact
/api/gpu/detailednow returns 200 with GPU data."apple"; existing NVIDIA/AMD paths unchanged.