RUNLOCALAIv38
→WILL IT RUNBEST GPUCOMPARETROUBLESHOOTSTARTPULSEMODELSHARDWARETOOLSBENCH
RUNLOCALAI

Operator-grade instrument for local-AI hardware intelligence. Hand-written verdicts. Real benchmarks. Reproducible commands.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
  • Will it run?
GUIDES
  • Best GPU
  • Best laptop
  • Best Mac
  • Best used GPU
  • Best budget GPU
  • Best GPU for Ollama
  • Best GPU for SD
  • AI PC build $2K
  • CUDA vs ROCm
  • 16 vs 24 GB
  • Compare hardware
  • Custom compare
REF
  • Systems
  • Ecosystem maps
  • Pillar guides
  • Methodology
  • Glossary
  • Errors KB
  • Troubleshooting
  • Resources
  • Public API
EDITOR
  • About
  • About the author
  • Changelog
  • Latest
  • Updates
  • Submit benchmark
  • Send feedback
  • Trust
  • Editorial policy
  • How we make money
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

SYS · ONLINEUPTIME · 100%2026 · operator-owned
RUNLOCALAI · v38
Errors / Metal / Apple Silicon / Metal allocation failed — Apple Silicon OOM under unified memory pressure
Metal / Apple Silicon

Metal allocation failed — Apple Silicon OOM under unified memory pressure

metal::MetalCommandQueue allocation failed or [MPS] OOM
By Fredoline Eruo · Last verified May 7, 2026

Cause

Apple Silicon shares one memory pool between CPU + GPU + Neural Engine. Under pressure (large model + browser + system), the GPU allocator fails even though some RAM is free elsewhere. Causes:

  • Model size + KV cache exceed practical Mac VRAM ceiling (~70% of physical RAM)
  • macOS swapping to disk under pressure (kills throughput)
  • Other processes (Chrome, Xcode indexing, Time Machine) eating unified memory
  • MLX or llama.cpp Metal not setting GPU memory limit explicitly

Solution

1. Check pressure with vm_stat or Activity Monitor's Memory Pressure graph. If you're in yellow/red, free RAM first.

2. Drop the model size or quant:

# 70B Q4 needs ~45 GB unified memory; not viable on 32 GB Macs
# Drop to 32B Q4 (~20 GB) or 14B Q4 (~9 GB)

3. Close memory-heavy apps. Chrome easily eats 4-8 GB. Xcode indexing 2-4 GB. Time Machine + Spotlight indexing 1-2 GB. Disable Spotlight indexing on /Volumes/ if relevant.

4. Set GPU memory limit explicitly in MLX:

import mlx.core as mx
mx.metal.set_memory_limit(0.85)  # 85% of physical RAM ceiling

5. Use caffeinate for long jobs so macOS doesn't sleep mid-inference:

caffeinate -i mlx_lm.generate --model ... --prompt ...

6. Bigger picture: Apple Silicon is bandwidth-bound. For sustained workloads, Mac Studio M3 Ultra 192GB or M4 Ultra 256GB is the production-grade target. See Mac Studio M3 Ultra combo.

Related errors

  • MLX / Metal: command buffer execution failed
  • Apple Silicon: RuntimeError: MPS backend out of memory

Did this fix it?

If your case was different, email support@runlocalai.co with what you saw and we'll update the page. If it worked but took different commands on your platform, we want to know that too.