perf: add macOS GPU monitoring via mactop and ioreg (#816)

Implement performance monitoring on OSX for Apple Silicon hardware. 

The implementation uses a combination of mactop and ioreg. If mactop is
installed (`brew install mactop`) it is used in a headless cli mode to
stream usage metrics. mactop hooks into unpublished(?) C based APIs in
OSX. Rather than introduce a cgo dependency into llama-swap's build
chain only for darwin I opted to go the external process route.

ioreg, which comes bundled with OSX is used as the fallback. It does not
provide temperature and power usage data but is able to show accurate
GPU and memory utilization.

Updates #771, #814
This commit is contained in:
Benson Wong
2026-06-03 21:51:03 -07:00
committed by GitHub
parent 9be9a87fa0
commit 29d3d9ba20
4 changed files with 371 additions and 2 deletions
+1 -1
View File
@@ -402,7 +402,7 @@
<p class="text-sm text-txtsecondary">
This is an experimental feature. Please use <a
class="underline hover:text-txtmain"
href="https://github.com/mostlygeek/llama-swap/discussions/771">discussion #711</a
href="https://github.com/mostlygeek/llama-swap/discussions/771">discussion #771</a
> for instructions and to share feedback.
</p>