Skip to content

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.

Quick answer

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.

Memory#vllm#kv-cache#gpu-memory-utilization#inference-serving#startup-failure#paged-attention

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

SymptomWhy 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_memoryBecause 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 targetThe 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 betweenvLLM 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)

training.log (synthetic 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.30GiB

Timestamps 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 analysis

No 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 reference pattern
// 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 / StackRecommendationNotes
Single engine, idle GPU--gpu-memory-utilization 0.90 to 0.95The error message's own advice, and correct when nothing else holds memory on the device.
Two engines sharing one GPUSize each fraction to cover the co-tenant's footprint tooEach fraction is measured against TOTAL memory, so 0.5 plus 0.45 does not fit.
Large model on a modest cardLower --max-model-len before raising utilizationThe activation peak scales with sequence length and is subtracted from the same budget.
Debugging a suspected regressionVLLM_USE_V1=0 as a diagnostic onlyIf V0 starts at the same fraction, the cause is a V1 profiling difference rather than sizing.

With the fix vs without the fix

DimensionWith the fixWithout the fix
What limits the KV cachegpu_memory_utilization times TOTAL memory, minus weights and activationsAssumed to be whatever memory is free on the card
Correct response to the errorUsually raise the fractionLower the fraction, which makes it worse
Effect of another process on the GPUCounted inside vLLM's budget but unusable by itAssumed 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

Where the KV cache comes from
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
With a 0.60 budget on an 80 GiB card, 28 GiB of weights plus a 20 GiB activation peak consume the entire 48 GiB budget and leave zero for the KV cache, which is the condition that raises this error. The 32 GiB outside the budget stays unused.

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?
vLLM only uses the fraction of TOTAL memory given by gpu_memory_utilization. Memory outside that fraction is never touched, so free VRAM and available budget are different quantities.
Should I lower gpu_memory_utilization to fix this?
Usually the opposite. Lowering it shrinks the budget the KV cache is carved from and makes this failure more likely. Lower it only when the symptom is CUDA out of memory instead.
Why did this start when I put a second model on the same GPU?
Each engine's fraction is taken of total memory, not of free memory. The second engine profiles against a card the first has already filled, so its fraction must cover both footprints.
Does --enforce-eager fix it?
It reclaims memory reserved for CUDA graphs and sometimes provides enough headroom, but it is not sufficient on its own in many reported cases.

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.