๐ฎ Run LLMs on your Intel Mac's AMD GPU โ llama.cpp + Vulkan/MoltenVK on macOS (Radeon Pro 5500M, 4ร faster than CPU). Confirmed working !.
TL;DR: Yes, GPU-accelerated llama.cpp works under macOS on Intel MacBook Pro with AMD Radeon โ via Vulkan/MoltenVK. But two flags are mandatory:
-fa 0(RDNA correctness bug) and-c 4096(VRAM oversubscription trap). Without the second one you get a soul-crushing 0.6 tokens/sec and will wrongly blame the driver. With both: 46โ54 t/s generation โ ~4ร faster than CPU.Companion guide for Linux/ROCm on the same hardware (zero-fuss option): Ollama + ROCm on T2 MacBook Pro
| Path | Prompt (pp) | Generation (tg) | Verdict |
|---|---|---|---|
Vulkan/MoltenVK, -fa 0 -c 4096 |
92โ168 t/s | 46โ54 t/s | โ the way |
| CPU (i9-9980HK + Accelerate BLAS) | 87 t/s | 13.4 t/s | โ fallback |
| Vulkan/MoltenVK, default context | ~10 t/s | 0.6 t/s | |
Metal backend (-ngl 99) |
โ | โ | โ broken on this GPU (#19563) |
Model: Llama-3.2-3B-Instruct Q4_K_M ยท llama.cpp build b10106 (also verified on b8193)
| Component | Details |
|---|---|
| Device | MacBook Pro 16" 2019 (MacBookPro16,1) |
| CPU | Intel Core i9-9980HK |
| GPUs | Intel UHD 630 + AMD Radeon Pro 5500M (8GB, Navi 14 / gfx1012) |
| OS | macOS 26 (Tahoe) |
| MoltenVK | 1.4.1 (Homebrew) |
| llama.cpp | b10106 (current master at time of writing) |
Should also apply to: any 2019โ2020 15"/16" MBP or iMac with an AMD dGPU (5300M/5500M/5600M, Vega, RX 5700/6xxx eGPU).
brew install molten-vk vulkan-headers vulkan-loader glslang shaderc
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build-vk -DGGML_METAL=OFF -DGGML_VULKAN=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build-vk -j -t llama-cli -t llama-benchLook for -- Including Vulkan backend in the cmake output. (Full Xcode or CLT both fine.)
GGML_VK_VISIBLE_DEVICES=0 \
VK_ICD_FILENAMES=$(brew --prefix molten-vk)/etc/vulkan/icd.d/MoltenVK_icd.json \
./build-vk/bin/llama-cli -m ~/models/llama32-3b-q4.gguf -ngl 99 -fa 0 -c 4096Every piece matters:
| Flag / env | Why |
|---|---|
VK_ICD_FILENAMES=... |
Points the Vulkan loader at MoltenVK |
GGML_VK_VISIBLE_DEVICES=0 |
Pins the AMD dGPU (device 1 is the useless Intel iGPU) |
-ngl 99 |
Offload all layers |
-fa 0 |
Flash attention produces gibberish on these AMD GPUs via MoltenVK (#20029, #20104). Mandatory. |
-c 4096 |
THE flag. See below. |
Modern llama-cli defaults the context size to the model's full context window โ 45,312 tokens for Llama-3.2-3B. On an 8 GB card that allocates:
llama_memory_breakdown_print: | Vulkan0 (Pro 5500M) | 8176 total = ... self 11236 = 1918 model + 4956 context + 4362 compute
11.2 GB requested on an 8 GB GPU. Metal doesn't refuse โ it silently pages VRAM over PCIe on every token. Result: ~1.6 s/token (0.6 t/s), while llama-bench (which uses a small internal context that fits) reports a healthy 25 t/s โ a mismatch that sends you chasing driver ghosts for an evening. Ask me how I know.
Debugging moral: if interactive generation is inexplicably slow on a discrete GPU while benchmarks look fine, read the llama_memory_breakdown_print at exit first. If self exceeds your VRAM, cap the context (-c 4096 fits comfortably: ~2 GB model + ~0.5 GB KV + compute).
| Model | Quant | Notes |
|---|---|---|
| Llama 3.2 1B/3B | Q4_K_M | sweet spot, 46โ54 t/s tg |
| Qwen 2.5 1.5B/3B | Q4_K_M | works |
| 7โ8B | Q4_K_M | fits, slower; keep context modest |
| Approach | Result |
|---|---|
Metal backend (GGML_METAL=ON, -ngl 99) |
๐ failed to decode prompt batch, res = -3 โ non-UMA + no simdgroup-matmul; see #19563 |
Vulkan with flash attention (-fa 1) |
๐ gibberish output on RDNA |
| Vulkan with default context | ๐ 0.6 t/s (VRAM paging โ the trap above) |
| Ollama on macOS (Intel) | โ CPU-only by design ("x86 (CPU only)") |
MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS=0 etc. |
๐คท no effect on the slowdown (it was never a sync issue) |
- llama.cpp #19563 โ Metal broken on AMD dGPUs
- llama.cpp #20029 / #20104 โ Vulkan FA gibberish on Intel-Mac AMD
- MoltenVK configuration parameters
- Companion: ROCm/Ollama on T2 Ubuntu (same laptop)
Debugged the hard way on a real MacBookPro16,1 in one long Thursday. If this saved you that Thursday, โญ the gist.
Author: Khalid Halba (GitHub: khalidhalba-jhu) ยท Last updated: July 2026