Local Model Slowdown, OOM, or Silent CPU Fallback
Identify why a model whose weight file looks smaller than your VRAM still spills to CPU or crashes under real context lengths.
While the model is loaded, run `ollama ps`. What does the PROCESSOR column report?
ollama ps
Look for "100% GPU" vs "65% CPU / 35% GPU" or multiple models loaded simultaneously.
Read Full Reproducible Guide →All 1 Terminal Diagnostic Probes in "Local Model Slowdown, OOM, or Silent CPU Fallback"
Complete static reference of every read-only probe command, baseline hint, and branch transition in this decision tree.
While the model is loaded, run `ollama ps`. What does the PROCESSOR column report?
ollama ps
Look for "100% GPU" vs "65% CPU / 35% GPU" or multiple models loaded simultaneously.
- • Shows partial CPU/GPU split (e.g., 45% CPU / 55% GPU)
→ sol-kv-cache-spill - • Multiple models are listed in ollama ps eating up VRAM
→ sol-multi-model-evict - • Shows 100% CPU inside a Docker container on NVIDIA PC
→ sol-nvidia-container-toolkit
3 Verified Root Causes, Fix Configs & Commands in "Local Model Slowdown, OOM, or Silent CPU Fallback"
Fix: Right-Size Context Window (num_ctx) & Enable Q8_0 KV Cache
sol-kv-cache-spillOpen WebUI or client tools often request 16K–32K context. At FP16, the KV cache adds 3–8 GB on top of the model weights, forcing layers onto slow system RAM.
- Enable Flash Attention and Q8_0 KV Cache quantization on the Ollama server (cuts KV memory by ~50%).
- Cap num_ctx to 8192 or 16384 in your Modelfile or client request options.
# Set in environment before starting Ollama export OLLAMA_FLASH_ATTENTION=1 export OLLAMA_KV_CACHE_TYPE=q8_0 export OLLAMA_NUM_PARALLEL=1
[BOUNDARY]Use the Tinker VRAM Calculator (/tools/vram-calculator/) to preview exact weight + KV cache budgets.
ollama psFix: Unload Idle Models & Set OLLAMA_MAX_LOADED_MODELS=1
sol-multi-model-evictWhen an embedding model (e.g., nomic-embed-text) and a chat LLM are called together in RAG, or when switching models, previous models remain resident for 5 minutes.
- Stop resident models immediately with ollama stop <model>.
- Set OLLAMA_MAX_LOADED_MODELS=1 (or 2 if running tiny embedding model + LLM).
ollama stop $(ollama ps | awk 'NR>1 {print $1}')
export OLLAMA_MAX_LOADED_MODELS=1
export OLLAMA_KEEP_ALIVE=5m[BOUNDARY]If using Local RAG, keep your embedding model lightweight (e.g. bge-m3 or nomic-embed-text) so both fit.
ollama psFix: Configure NVIDIA Container Toolkit & GPU Device Reservation
sol-nvidia-container-toolkitDocker containers cannot see host NVIDIA GPUs unless nvidia-container-toolkit is installed and deploy.resources.reservations.devices is declared.
- Install nvidia-container-toolkit on the host and run sudo nvidia-ctk runtime configure --runtime=docker.
- Restart Docker daemon and add the GPU reservation block in docker-compose.yml.
services:
ollama:
image: ollama/ollama:0.5.7
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu][BOUNDARY]Note: Docker Desktop on macOS cannot pass Apple Silicon Metal GPU into Linux containers; run Ollama natively on macOS host instead.
docker exec tinker-ollama nvidia-smiApple Silicon Mac Local Model Benchmark: Fixed Tasks, Quantization, Context & Speed
Measured prompt eval and token generation speeds across Q4_K_M, Q5_K_M, and Q8_0 on unified memory—showing exactly when raising num_ctx triggers SSD swap degradation.
MacBook Pro 14" (M3 Pro · 18GB & 36GB Unified Memory tested) · macOS 15.3
Ollama 0.5.7 · qwen2.5:7b-instruct · qwen2.5:14b-instruct · deepseek-r1:14b
100% Offline After Weight Pull — Verified with Wi-Fi disabled (`networksetup -setairportpower en0 off`); zero outbound telemetry from ollama serve.