Skip to content

Repository files navigation

GPU Widget for macOS

A native macOS desktop widget that monitors GPU VRAM usage and system memory in real-time. Built with SwiftUI and WidgetKit for Apple Silicon Macs.

GPU Widget showing 512 GB unified memory

What it does

  • Live VRAM monitoring — displays allocated memory, in-use memory and GPU utilization percentage
  • Memory pressure indicators — color-coded pressure levels (Normal → Pressure → High → Critical)
  • Usage history graph — rolling 60-sample bar chart showing VRAM usage over time
  • System memory stats — physical, app, wired, compressed and cached memory breakdown
  • Remote monitoring — monitor GPU stats from other Macs on your network via a built-in TCP server/client
  • Desktop widgets — small, medium and large widget sizes via WidgetKit (updates every 30 seconds)

How it works

The app reads GPU statistics directly from IOKit (IOAccelerator service) and queries total GPU memory via Metal's recommendedMaxWorkingSetSize. System memory stats come from host_statistics64. Data is polled every 5 seconds in the main app and every 30 seconds for the desktop widget.

For remote monitoring the app runs a lightweight TCP server on port 9847. When a client connects it responds with a JSON payload containing the host's current GPU and system memory stats. The client/server protocol uses a simple 4-byte big-endian length header followed by the JSON body.

History is persisted to disk via an App Group container so both the main app and the widget extension share the same data.

Architecture

GPUWidget/              Main app (SwiftUI window)
GPUWidgetExtension/     WidgetKit extension (small/medium/large)
Shared/                 Shared code between app and extension
├── GPUDataProvider     IOKit + Metal GPU stats fetcher
├── MemoryStats         Data models (GPUMemorySnapshot, SystemMemoryStats)
├── NetworkMonitor      TCP server/client for remote monitoring
├── GraphDataStore      Persistent rolling history (App Group)
├── PressureColor       Pressure level enum with colors
├── SharedViews         Graph and pressure bar views
└── FormatUtils         Number formatting helpers

Requirements

  • macOS 26.0+ (Tahoe)
  • Apple Silicon (M-series)
  • Xcode 26+
  • Swift 6.0

Installation

Build from source

# Clone
git clone https://github.com/alexkerber/GPU-widget.git
cd GPU-widget

# Generate Xcode project (requires XcodeGen)
brew install xcodegen
xcodegen generate

# Open and build
open GPUWidget.xcodeproj

Build and run the GPUWidget scheme. The app installs itself as a menu bar companion — right-click your desktop → Edit Widgets → search "GPU VRAM" → drag to desktop.

Download release

Grab the latest .dmg from Releases. Mount it and drag GPU Widget.app to Applications.

Remote monitoring setup

  1. On the machine you want to monitor: open GPU Widget → Settings → enable "Share GPU data on network"
  2. On your local machine: Settings → Remote Hosts → add the IP address of the remote Mac
  3. The widget will now show remote GPU stats alongside your local data

License

MIT — do whatever you want with it.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages