10. Activity Monitor for AI
Activity Monitor is your primary debugging tool on macOS. It shows real-time CPU, GPU, memory, and network utilization. For AI workloads, the relevant columns are: GPU (the percentage of the Apple Silicon GPU being used), Memory (how much RAM the process is consuming), and CPU (how much of the CPU is engaged).
Open Activity Monitor from Applications > Utilities or use Activity Monitor.app. In the default view, CPU is the primary sort. Change to Memory to see which processes are consuming RAM.
For AI inference monitoring:
# Check memory pressure from command line
memory_pressure
# Returns green/yellow/red and page-in/page-out rates
# Check per-process GPU usage with powermetrics (requires sudo)
sudo powermetrics --samplers gpu -i 500 -n 10
# Updates every 500ms, 10 samples
# Check which process is using GPU (approximate)
ps aux | grep -E "(ollama|llama.cpp|mlx)" | awk '{print $2}'
In Activity Monitor, sort by the GPU tab (View > Dock Icon > Show GPU Usage). During active inference with Metal, you should see GPU utilization between 30–80%. If it stays below 10%, Metal is not being used—the runtime has fallen back to CPU.
The Memory tab shows real memory pressure. The memory_pressure command is more honest than Activity Monitor's color coding:
memory_pressure
# Example output:
# Pressurization: (green)
# Pages paged in: 1234
# Pages swapped in: 0
# Pages paged out: 567
If pages swapped in is non-zero and growing during inference, your workload is exceeding physical RAM. You need a smaller model or a smaller context window.
Real failure mode: A process shows high CPU but low GPU in Activity Monitor during inference. This means Metal is not routing work to the GPU. Check that the model binary was compiled with Metal support, or switch to an MLX model which has guaranteed Metal acceleration.
Run a model via Ollama in one terminal. Open Activity Monitor, navigate to the GPU tab, observe GPU utilization during generation. Note the difference between initial token generation (higher GPU usage) and streaming output (variable usage).