RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • 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 →

© 2026 runlocalai.coIndependently operated
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 Eruo Fredoline · Last verified Jun 12, 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
  • Metal Allocator: out of memory on Apple Silicon
  • MLX: Memory pressure detected — consider reducing batch size

Did this fix it?

If your case was different, email Contact support 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.