If the calculator classified a configuration as likely-fits but the process died with CUDA out of memory, treat the calculator result as an estimate. Check, in order: baseline board usage before load, whether OOM happens at weight load or during prompt prefill, the engine’s actual context length, and that engine’s own memory flags. Do not paste vLLM flags into llama.cpp, or PyTorch allocator variables into llama-cli.
Diagnostic flow
nvidia-smi baseline
→ OOM at load? weights vs net budget
→ OOM during prompt? engine prefill / batch flags
→ OOM after long chat? KV growth / cap context
→ is the engine using the assumed context / KV / extras?
| Symptom | Likely category | What to inspect |
|---|---|---|
| OOM before tokens are produced | Weights vs net budget, or baseline board usage | nvidia-smi before load; calculator reserve; selected artifact bytes |
| OOM during the first prompt | Prefill / batch workspace | llama.cpp -ub / -b; vLLM --gpu-memory-utilization and --max-model-len |
| OOM only after the chat grows | KV growth | Actual context, KV dtype, sequence count |
| Fits in the calculator, fails in another engine | Cross-engine flag mix-up | Keep llama.cpp, vLLM, and PyTorch settings in their own columns |
Baseline desktop / display VRAM
Windows DWM, browser hardware acceleration, and extra displays can consume gigabytes before the model loads. Measure with nvidia-smi (or the vendor equivalent) before load, then raise the calculator’s system/display reserve to match what you measured.
This is an observation method. It is not a claim that every Windows desktop uses a fixed 1.5–3 GB.
llama.cpp (ggml-org/llama.cpp tools/cli README, fetched 2026-09-21)
Official CLI meanings on that date:
-c, --ctx-size N— prompt context size. Default 0 = loaded from the model. For Qwen2.5-7B-Instruct the catalog native window is 32,768, not 8,192. Set-cexplicitly if you sized the calculator at 8K.-b, --batch-size N— logical maximum batch size (default 2048).-ub, --ubatch-size N— physical maximum batch size (default 512). Lowering-ubcan reduce prompt-processing workspace.-ctk/-ctv— KV cache dtypes (default f16). A Q4_K_M weight file does not switch KV to 4-bit by itself.
Defaults change across builds. Quote the version you verified. Source: llama.cpp tools/cli README.
PYTORCH_CUDA_ALLOC_CONF is not a llama.cpp switch.
vLLM (engine arguments, fetched 2026-09-21)
From vLLM engine arguments on 2026-09-21 (latest docs; the page notes it is the developer preview):
--gpu-memory-utilization— fraction of GPU memory for the model executor. Default 0.92 in those docs. Older 0.9 figures are version-specific; do not treat 0.9 as eternal.--max-model-len— model context length. If unspecified, derived from the model config. Set it to the window you actually sized.--kv-cache-dtype— KV storage dtype (defaultauto). FP8 is a separate choice from weight quantization.
These are vLLM flags, not llama.cpp flags.
PyTorch CUDA allocator (vLLM / SGLang stacks that use it)
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True applies to PyTorch CUDA allocator contexts. Official note: PyTorch CUDA semantics, environment variables. It is not a llama.cpp configuration switch.
Calculator scenario for a peak-workspace look
Open the calculator with high extras and prefill workspace enabled as a scenario, labeled as such. Example starting point: Qwen2.5-7B-Instruct Q4_K_M on the RTX 4060 8GB SKU. That still is not a runtime trace.
Related: file size is not runtime VRAM and the KV cache calculator.