vLLM refuses to start with No available memory for the cache blocks
vLLM aborts during engine initialisation because, after loading model weights and profiling the activation peak, nothing is left inside its memory budget to allocate a single paged KV cache block. The GPU is frequently not full: the free memory sits outside the fraction vLLM was told it may use.
Raise --gpu-memory-utilization. Despite reading like an out-of-memory error, this failure usually means vLLM's budget was too SMALL, because the budget is a fraction of total memory and the free memory sits outside it.
What this failure is
A vLLM startup failure in which the engine, having reserved a fixed fraction of total GPU memory and spent it on model weights and the profiled activation peak, has nothing left to allocate paged KV cache blocks from and exits rather than serving.
Why it happens (the mechanism)
vLLM sizes its KV cache from what is left over after weights and activations, inside a budget it fixes up front as gpu_memory_utilization times total device memory. It never grows into memory outside that budget, even when the card is idle. So a card with 20 GiB free and a budget already consumed by weights reports no available memory, and lowering the fraction, which is the instinct an out-of-memory error trains, removes the last of the headroom.
What you'll observe
- vLLM exits at startup instead of serving, before any request is accepted
- nvidia-smi shows several gigabytes still free on the card while vLLM reports it has no memory
- Lowering gpu_memory_utilization makes the error appear sooner rather than fixing it
- A second model launched onto a GPU that already hosts one fails while the first succeeded
Common symptoms and what they mean
| Symptom | Why it happens |
|---|---|
| ValueError: No available memory for the cache blocks. Try increasing `gpu_memory_utilization` when initializing the engine. | vLLM does not allocate whatever memory happens to be free. It fixes a budget of gpu_memory_utilization multiplied by TOTAL device memory, then subtracts model weights, the profiled activation peak and CUDA graph memory. Whatever remains becomes the paged KV cache. The error means weights plus activations already met or exceeded that budget, so the remainder was zero or too small for one block. |
| Traceback runs through vllm/v1/engine/core.py, _initialize_kv_caches, get_kv_cache_configs and check_enough_kv_cache_memory | Because the budget is a fraction of total rather than of free memory, memory held by any other process on the same device is inside the fraction vLLM believes it owns but cannot actually use. Co-locating a second engine is the common form: the second engine profiles against a GPU the first has already filled, so its fraction has to cover both footprints. |
| Free memory on device reported as lower than the desired utilization target | The counterintuitive consequence is that seeing this error alongside plenty of idle VRAM usually means the budget is too SMALL, not too large. Instinct trained on out-of-memory errors says lower the number, and lowering it makes this failure worse. |
| Raising gpu_memory_utilization by a few hundredths flips the failure to CUDA out of memory instead, with no value that works in between | vLLM does not allocate whatever memory happens to be free. It fixes a budget of gpu_memory_utilization multiplied by TOTAL device memory, then subtracts model weights, the profiled activation peak and CUDA graph memory. Whatever remains becomes the paged KV cache. The error means weights plus activations already met or exceeded that budget, so the remainder was zero or too small for one block. |
Which systems are affected
- vLLM V1 engine (the V0 engine often succeeds at a utilization value where V1 fails)
- Two or more engines co-located on one GPU, where each fraction is taken of TOTAL memory rather than free memory
- Large models on modest cards, where the window between out-of-memory and no-cache-blocks closes entirely
- Deployments using --cpu-offload-gb, which changes the profiling peak
How to confirm this is the problem
Apply the following checklist to a small reproduction: each box below is a positive signal that you are looking at this exact failure rather than a sibling in the same taxonomy.
- ✓Read the memory profiling line vLLM logs immediately before the failure and add model weights to the activation peak. If that sum is at or above gpu_memory_utilization multiplied by total memory, the budget is the cause.
- ✓Run nvidia-smi while vLLM is starting and check whether another process holds memory on the same device.
- ✓Re-launch with the utilization raised by 0.05. If the failure becomes CUDA out of memory, the budget was genuinely too small and the model does not fit at this context length.
Example training logs (fingerprint)
ERROR 08-14 09:12:44 engine.py:132] ValueError: No available memory for the cache blocks. Try increasing `gpu_memory_utilization` when initializing the engine.
File "vllm/v1/core/kv_cache_utils.py", line --, in check_enough_kv_cache_memory
INFO 08-14 09:12:41 worker.py:--] Memory profiling results: total_gpu_memory=79.15GiB model_weights=27.92GiB peak_activation=51.30GiBTimestamps and exact values vary across runs, but the pattern. An info-level start, an early WARN, an ERROR carrying the symptom. Is the actual fingerprint you should alert on. The Denpex platform flags this combination automatically.
Root cause, fix & prevention, signed in
Sign up free to see why this failure really happens, the exact remediation steps, and the production-grade prevention pattern. You also get 3 free full diagnoses for your own training logs.
Sign up free. Unlock the full analysisNo credit card · 3 free diagnoses · Instant access
Why the recommended fix works
Raising the utilization fraction enlarges the budget that the KV cache is carved from, so the leftover becomes positive. Lowering max-model-len or max-num-seqs works from the other side: both shrink the profiled activation peak, which is subtracted from the same budget. Either way the arithmetic that produced zero leftover is what changes.
Code examples
// Typical pattern:
import torch.optim as optim
optimizer = optim.AdamW(model.parameters(), lr=3e-4)
scheduler = optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=num_training_steps)
for step in range(num_training_steps):
optimizer.zero_grad()
loss = model(batch)
loss.backward()
optimizer.step()
scheduler.step()Adapt the snippet to your framework. The same pattern holds for PyTorch Lightning, Hugging Face Trainer, DeepSpeed, Megatron-LM, and vLLM training wrappers. Where the wrapper exposes a config flag (for examplelr_scheduler_type in Trainer), prefer the flag over the imperative API to keep the schedule declarative and reproducible.
Best practices by model family
| Model / Stack | Recommendation | Notes |
|---|---|---|
| Single engine, idle GPU | --gpu-memory-utilization 0.90 to 0.95 | The error message's own advice, and correct when nothing else holds memory on the device. |
| Two engines sharing one GPU | Size each fraction to cover the co-tenant's footprint too | Each fraction is measured against TOTAL memory, so 0.5 plus 0.45 does not fit. |
| Large model on a modest card | Lower --max-model-len before raising utilization | The activation peak scales with sequence length and is subtracted from the same budget. |
| Debugging a suspected regression | VLLM_USE_V1=0 as a diagnostic only | If V0 starts at the same fraction, the cause is a V1 profiling difference rather than sizing. |
With the fix vs without the fix
| Dimension | With the fix | Without the fix |
|---|---|---|
| What limits the KV cache | gpu_memory_utilization times TOTAL memory, minus weights and activations | Assumed to be whatever memory is free on the card |
| Correct response to the error | Usually raise the fraction | Lower the fraction, which makes it worse |
| Effect of another process on the GPU | Counted inside vLLM's budget but unusable by it | Assumed to be accounted for automatically |
Real engineering notes
“The window between this error and CUDA out of memory can close completely on a large model. Teams have reported 0.9 giving out of memory and 0.8 giving no available cache blocks on the same deployment, with nothing in between that works. When that happens the model does not fit at the requested context length and no utilization value will make it fit; shorten the context or add tensor parallelism instead of continuing to bisect the fraction.”
Visual fingerprint
total device memory |========================================| 80 GiB budget (util 0.60) |========================| 48 GiB model weights |==============| 28 GiB activation peak | |=========| 20 GiB KV cache left | | 0 GiB <-- fails here
Related failures to investigate next
Root cause, fix & prevention
Frequently asked questions
Twelve targeted questions that engineers and on-call staff most commonly ask about this failure.
The GPU has plenty of free memory. Why does vLLM say there is none?
Should I lower gpu_memory_utilization to fix this?
Why did this start when I put a second model on the same GPU?
Does --enforce-eager fix it?
References
- ↗vLLM issue #2248: recent vLLMs ask for too much memory, No available memory for the cache blocks
- ↗vLLM issue #5274: high gpu_memory_utilization gives OOM, low gives no available memory for the cache blocks
- ↗vLLM discussion #15842: the error when launching two models on the same GPU
- ↗vLLM source: check_enough_kv_cache_memory in kv_cache_utils.py
- ↗vLLM documentation: conserving memory
Don't just read the fix, diagnose your run
The encyclopedia tells you what went wrong. Denpex tells you what went wrong in YOUR training run. With your logs, your config, and your stack.