Skip to main content

Apple Silicon GPU/CPU/Memory monitoring CLI — like gpustat, but for Metal

Project description

metalstat

PyPI

Apple Silicon GPU/CPU/Memory monitoring CLI — like gpustat, but for Metal.

screenshot

No sudo required. Uses IOReport private API for GPU/power metrics.

Install

pip install metalstat

Or with uv:

uv tool install metalstat

Usage

# One-shot: all metrics + top processes
metalstat -a -p

# Watch mode: refresh every 1s
metalstat -a -i 1

# See all options
metalstat --help

Understanding Apple Silicon memory (vs. CUDA)

Apple Silicon uses Unified Memory Architecture (UMA) — the CPU and GPU share a single pool of RAM. There is no separate VRAM. This is fundamentally different from NVIDIA/CUDA where the GPU has its own dedicated memory (e.g. 24GB VRAM on an RTX 4090) and data must be copied between CPU and GPU over PCIe.

What the memory numbers mean

  Memory  15.6 / 32.0 GB   ●green                    ← system memory (shared by CPU + GPU)
          2.7G wired / 12.9G active / ...             ← breakdown by page state
   Metal  0.0G / 25.0G                                ← GPU allocation / recommended max

System memory (15.6 / 32.0 GB) is the total unified memory usage — CPU and GPU workloads combined. The breakdown shows:

  • Wired: Locked by the kernel, cannot be paged out or compressed
  • Active: Recently used pages
  • Inactive: Not recently accessed, still in RAM, reclaimable
  • Compressed: macOS compresses inactive pages in-memory before swapping to disk

Metal GPU allocation (0.0G / 25.0G) shows how much memory is currently allocated for GPU resources (textures, buffers, ML model weights) vs. the recommended maximum. This is the closest equivalent to "VRAM used / VRAM total" on NVIDIA, but with important differences:

NVIDIA (CUDA) Apple Silicon (Metal)
GPU memory pool Dedicated VRAM (fixed) Shared with CPU (unified)
"Total" Physical VRAM size recommendedMaxWorkingSetSize (~75% of RAM)
Hard limit? Yes — allocation fails at VRAM cap No — soft limit, but going over causes swap thrashing
Zero-copy CPU↔GPU? No, must cudaMemcpy Yes, CPU and GPU see the same physical pages

The recommended max (~75% of RAM) is not a hardware limit — Metal will let you allocate beyond it. But exceeding it forces the OS to compress or swap out other memory, degrading performance. This is why a 192GB Mac can load LLMs that would need multiple 80GB A100s: the GPU directly accesses main memory with no copy overhead, but you're sharing that memory budget with the rest of the system.

Pressure (●green / ●yellow / ●red) shows system-wide memory pressure:

  • Green (>50% free): Healthy, plenty of headroom
  • Yellow (25-50% free): Moderate pressure, compression active
  • Red (<25% free): Heavy pressure, swapping likely

Requirements

  • macOS on Apple Silicon (M1/M2/M3/M4)
  • Python 3.10+

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metalstat-0.1.2.tar.gz (187.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metalstat-0.1.2-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file metalstat-0.1.2.tar.gz.

File metadata

  • Download URL: metalstat-0.1.2.tar.gz
  • Upload date:
  • Size: 187.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for metalstat-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6aace9dc03ce39d9284ba424c428702b8f4f56a7daf3da147911bfe2677741e3
MD5 814cc3853483a8e2609b1d80978874d8
BLAKE2b-256 7a32b98e6a0fd142041e0644abd13e99cda149f4f723f970ca8794a7830f1c1e

See more details on using hashes here.

File details

Details for the file metalstat-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: metalstat-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for metalstat-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea0d5e826014b1ae9a63149c2925f905fc631682827b4d0d6da609057cb0a1cb
MD5 3e5a8f5b1b524265b537e00d2e786313
BLAKE2b-256 92b7c8c0eaa3128a9239c885821c5fa8d5ab3151624766bf33a22547f97bd111

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page