published fresh until

CUDA out of memory in vLLM: KV cache or engine startup?

Summary As of October 2026, diagnose vLLM startup failures from the first worker traceback: CUDA allocation failure, insufficient KV capacity and an engine-core wrapper need different actions. Flags were checked against vLLM 0.32.0 docs (checked 2026-10-20); historical wording is labelled.

Not for choosing a team server, see vllm-sglang-llama-cpp-or-ollama-to-serve-a-team-llm-2026

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

The last engine-start failure can hide the actionable exception in an earlier worker log. Identify the allocation phase before changing settings. Sources checked 2026-10-20.

131072-token context exceeds KV capacity

Exact error prefix: ValueError: The model's max seq len (131072) is larger than the maximum number of tokens that can be stored in KV cache. Issue #7526 reports this with capacity 30880; the existing #2418 transcript also includes a 131072-token case. These historical reports do not guarantee your model’s capacity.

Lower --max-model-len below the KV capacity printed in your own log, then read the new startup log: capacity can change with configuration. This reduces the supported context below 131072. Untested experiment: for the 30880-token example, try --max-model-len 28000; the number is a trial, not a universal setting.

If you need more capacity, raise --gpu-memory-utilization carefully after checking available memory and other allocations; it controls this instance's memory budget, not exclusive GPU ownership. Explicit --kv-cache-memory-bytes overrides it. Consider KV quantization via --kv-cache-dtype only if the documentation for your installed version supports the dtype, model and hardware. Do not copy a latest-only dtype into an older release. Sources: engine arguments, memory guide and 0.32.0 flags. Neither a larger allocation nor KV quantization guarantees 131072 tokens will fit.

Versions and status

ItemScope
Flag referencevLLM 0.32.0 CLI, checked 2026-10-20
LicenceApache-2.0, checked 2026-10-20; checkpoint terms separate
Error evidenceReal GitHub transcripts, including historical wording

Untested experiment: commands below are diagnostic trials. "$MODEL_PATH" is your existing checkpoint path; preserve its revision.

What changed

The V1 guide says graph capture uses more memory than V0, checked 2026-10-20. The changelog confirms vLLM 0.32.0, released 2026-10-18 (checked 2026-10-20). An upgrade is not an established cure.

What breaks

CUDA allocation failure

Error prefix: torch.OutOfMemoryError: CUDA out of memory. Allocation sizes follow and vary. Issue #42147, checked 2026-10-20, shows OOM while allocating the minimal cache for CUDA-graph profiling, before real KV-cache allocation.

Weights may exceed available memory, or cache allocation, warmup and graph capture may exhaust what remains. For graph/warmup failure try the documented context, batch and eager-mode controls.

vllm serve "$MODEL_PATH" --max-model-len 2048 --max-num-seqs 2 --enforce-eager

This reduces context/concurrency and disables graph capture. Memory guide and target CLI, checked 2026-10-20. If weights alone do not fit, select a supported smaller/quantized checkpoint or use --tensor-parallel-size with available GPUs; consult the memory guide for offloading.

Do not blindly raise --gpu-memory-utilization when capture fails; it can consume headroom for later allocations. Do not assume fragmentation caused the failure just because the exception suggests allocator tuning. Eager success does not prove production throughput.

KV capacity validation failure

Exact historical message from issue #2418, checked 2026-10-20.

ValueError: The model's max seq len (4096) is larger than the maximum number of tokens that can be stored in KV cache (3664). Try increasing `gpu_memory_utilization` or decreasing `max_model_len` when initializing the engine.

Those counts are historical: the allocated KV blocks cannot fit even one maximum-length request. Choose a limit below your own log's capacity; a trial for that example is below.

vllm serve "$MODEL_PATH" --max-model-len 2048

Flag spelling comes from the target CLI, checked 2026-10-20. If longer context is required, inspect free memory and other processes before increasing cache allocation. An explicit --kv-cache-memory-bytes overrides automatic sizing through --gpu-memory-utilization. Current CLI, checked 2026-10-20.

Do not increase the maximum sequence length to fix insufficient cache, assume weight quantization also quantizes KV, or expect fewer requested output tokens to repair startup validation. Historical wording may differ on current backends.

Engine startup wrapper

Exact verified message from issue #21410, checked 2026-10-20.

RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}

The suffix varies; this wrapper identifies no unique cause. The earlier traceback shows graph-capture OOM. Capture the full log per official troubleshooting, checked 2026-10-20.

VLLM_LOGGING_LEVEL=DEBUG vllm serve "$MODEL_PATH" 2>&1 | tee vllm-startup.log
rg -n 'Traceback|OutOfMemoryError|ValueError|RuntimeError' vllm-startup.log

Read the first causal traceback. For graph errors try --enforce-eager per troubleshooting; for cache capacity use the preceding branch. Otherwise follow the matching troubleshooting section.

Do not discard worker output, restart unchanged repeatedly, increase timeouts to hide a crash, or replace the CUDA stack based only on the final wrapper.

How to migrate

1. Save the command and first worker exception. 2. Change one setting at a time; confirm flags with vllm serve --help. 3. Restore context, concurrency and graphs separately; keep a rollback. Compare runtime/checkpoint locks after upgrades.

What to test

Test real-weight startup, short generation, longest prompt plus output, concurrency and cold restarts. Record phase, capacity and latency after eager mode/offloading.

Community evidence

  • #2418: historical capacity validation and lower-length reports.
  • #42147: OOM in the minimal profiling cache before real KV allocation, and scoped memory workarounds.
  • #21410: dummy-load success followed by real graph-capture failure. Checked 2026-10-20.

Pitfalls

Increasing cache allocation may help capacity validation and worsen a later allocation failure. Lower concurrency cannot fix oversized weights. Verify kernel/hardware support before copying quantization settings.

A prompt to give your agent

Your training data may predate this behavior. Read https://docs.vllm.ai/en/v0.32.0/cli/serve/, https://docs.vllm.ai/en/latest/configuration/conserving_memory/ and https://docs.vllm.ai/en/latest/usage/troubleshooting/ before proposing flags; do not guess. Read the linked GitHub transcript matching my error. Inspect my complete log and installed version, identify the first causal exception and allocation phase, then propose one reversible command change with a source. Preserve the checkpoint revision. Explain why changing cache allocation helps this phase and give a context/concurrency test. Treat the final engine message as a wrapper until the earlier traceback establishes a cause.

Limits

Wording varies by backend; no universal memory setting.

Started from a post by @ZisIsNotZis, packaged by the editor. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# CUDA out of memory in vLLM: KV cache or engine startup?
Summary: As of October 2026, diagnose vLLM startup failures from the first worker traceback: CUDA allocation failure, insufficient KV capacity and an engine-core wrapper need different actions. Flags were checked against vLLM 0.32.0 docs (checked 2026-10-20); historical wording is labelled.
Copy for agent
get the whatworks thread vllm-cuda-out-of-memory-kv-cache-engine-core-startup-errors and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread vllm-cuda-out-of-memory-kv-cache-engine-core-startup-errors
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks