# vLLM No available memory for the cache blocks on a shared GPU

On one NVIDIA L40S, vLLM stopped on first start with ValueError: No available memory for the cache blocks while a second vLLM server started on the same GPU; after the chat server was set to wait for the embedding server's health check, the next fresh deploy showed 0 restarts and 0 matching log lines (2026-11-15).

Updated: 2026-11-29

Published: 2026-11-28

Video: No available memory for the cache blocks (4:17) - transcript below

ValueError: No available memory for the cache blocks. Here is what that line means, what we saw on one GPU, and what to check.

Start with the KV cache. Beside the model weights, the KV cache, activations and the serving engine need GPU memory. That remainder sets the context length and the number of concurrent users.

vLLM raises this error at startup, when nothing is left for the KV cache inside its share of GPU memory. gpu-memory-utilization sets that share, per instance. And vLLM measures free memory once, after warmup, so it cannot see memory another process takes later.

Three numbers decide it. The weights: 31.45 GiB for our default chat model. The context length: limiting it with max-model-len reduces memory use. And the share: 0.78 gave our chat server about 35933 MiB. What the weights leave must hold activations and the KV cache.

Here is our own test, from November 15, 2026. One NVIDIA L40S ran a chat vLLM server at 0.78, an embedding vLLM server at 0.12, and a speech server. The two vLLM servers started without waiting for each other. On first start, the chat server stopped with this error.

Before the next fresh deploy, we kept both shares and made the chat server wait until the embedding server reported healthy. That deploy recorded 27 lines waiting for the embedding server, 0 restarts, and 0 lines with this error. We did not test whether the start order alone made the difference.

Why not just lower the share? By our arithmetic, at 0.70 the weights alone would fill it. We did not run that setting. A lower value takes memory away from the KV cache.

The docs name two more settings: a lower max-num-seqs reduces memory use, and tensor-parallel-size spreads the model over more GPUs. In 16-bit weights, a 24 GB NVIDIA L4 caps the model at about 12 billion parameters, and a 48 GB NVIDIA L40S at about 24 billion, before any KV cache.

In the Launchable's Compose file, the chat server keeps gpu-memory-utilization 0.78 and max-num-seqs 16. To check it held, list GPU memory per process with nvidia-smi, search the log for No available memory, and confirm the server answers on port 8000. Then stop and start once, and repeat.

A related line is a different message: exceeds available Mamba cache blocks. With the default Nemotron model, setting max-num-seqs 16 removed it.

To recap: nothing was left for the KV cache inside vLLM's share. Check the weights, the context length and the share, and give each vLLM server on a shared GPU its own fraction. The full guide is at www.9owls.com.

## What does "No available memory for the cache blocks" mean?

The full line is `ValueError: No available memory for the cache blocks`. vLLM raises it at startup when nothing is left for the KV cache inside the share of GPU memory it may use. The [vLLM engine arguments](https://docs.vllm.ai/en/stable/configuration/engine_args.html) describe that share:

- `--gpu-memory-utilization` is "the fraction of GPU memory to be used for the model executor", from 0 to 1.
- It is "a per-instance limit, and only applies to the current vLLM instance".
- Two vLLM instances on one GPU each get their own fraction; the docs give 0.5 each as the example.
- "A lower value takes memory away from the KV cache."

The [vLLM optimization guide](https://docs.vllm.ai/en/stable/configuration/optimization.html) adds that vLLM measures free memory once, after warmup, so it cannot see memory another process takes later. It names another vLLM instance on the same GPU as a reason to set the fraction below 1.0.

## What did we see on a shared NVIDIA L40S?

We saw the error while testing the [Open Notebook on Nemotron Launchable](https://www.9owls.com/launchables/open-notebook-nemotron/), which runs two vLLM servers and a speech server on one GPU. These are our own fresh-deploy test records from 2026-11-15.

| Item | Recorded value |
|---|---|
| Instance | AWS g6e.xlarge, 1x NVIDIA L40S, 46068 MiB GPU memory |
| Chat server | `nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8`, `--gpu-memory-utilization 0.78`, `--max-num-seqs 16` |
| Embedding server | `nvidia/Nemotron-3.5-Embed-1B-BF16`, `--gpu-memory-utilization 0.12` |
| Also on the GPU | Speaches (text to speech and speech to text) |
| Start order, first test | Both vLLM servers started without waiting for each other |
| First test | `ValueError: No available memory for the cache blocks` at 11:29:12 on first start; the chat server came back after 1 restart |
| GPU memory in use once all ran, first test | 40138 of 46068 MiB |

The split fitted once everything was running: about 5930 MiB stayed free. The error appeared only on the first start.

![One L40S had 40138, then 39724 of 46068 MiB in use; the first deploy logged No available memory for the cache blocks.](https://www.9owls.com/assets/infographics/guides/vllm-cache-blocks-memory-error-IG06.62b1d59c82.svg "Observed GPU memory use on one NVIDIA L40S with 46068 MiB, from our two fresh deploys on 2026-11-15. On the first deploy, 40138 MiB were in use once all servers ran, and the first start logged `ValueError: No available memory for the cache blocks`. On the next deploy, 39724 MiB were in use: the chat server process used 35844 MiB and the embedding server process 3866 MiB, beside default model weights of 31.45 GiB. These are observations, not a proven cause. Source: 9owls fresh-deploy test records, 2026-11-15.")

## What changed before the clean deploy?

Before the next fresh deploy we changed the start order: the chat vLLM server now waits until the embedding vLLM server reports healthy, and each server keeps its `--gpu-memory-utilization` share.

1. We kept `--gpu-memory-utilization 0.78` on the chat server and `0.12` on the embedding server.
2. We made the chat server wait for the embedding server: a loop polls `http://vllm_embed:8000/health` every 5 seconds, for up to 10 minutes, before `vllm serve` runs, plus a `depends_on` entry in the Compose file.
3. We ran a new fresh deploy on the same instance type the same day.

| Check on the next fresh deploy, 2026-11-15 | Result |
|---|---|
| Chat server restarts | 0 |
| Embedding server restarts | 0 |
| Log lines matching `No available memory` | 0 |
| Log lines `waiting for the embedding server` | 27 |
| GPU memory in use | 39724 of 46068 MiB |
| Chat server process | 35844 MiB |
| Embedding server process | 3866 MiB |
| Stop and start | Passed; chat answered again about 9 minutes after start |

We did not test whether the start order alone, rather than the new deploy, made the difference. The table records what we saw, not a proven cause.

## Why not just lower --gpu-memory-utilization?

By our arithmetic, a lower fraction on this GPU would leave no room for the model. The arithmetic for the chat server:

| Fraction | GPU memory vLLM may use | Default model weights |
|---|---|---|
| 0.78 | about 35933 MiB | 31.45 GiB (about 32205 MiB) |
| 0.70 | 32248 MiB (31.49 GiB) | 31.45 GiB (about 32205 MiB) |

At 0.70 the weights alone would fill the share, leaving nothing for activations or the KV cache, so the default model would not fit (arithmetic; not run). We measured the weight size on 2026-11-15; we did not run the 0.70 setting. The vLLM docs make the same trade-off in general terms: a lower value takes memory from the KV cache.

## Which vLLM settings change how much memory the cache gets?

These are the settings the vLLM documentation names, read 2026-11-28. They are general advice, not results we measured.

| Setting | What the vLLM docs say |
|---|---|
| `--gpu-memory-utilization` | Fraction of GPU memory for this instance; set it below 1.0 when another process, such as another vLLM instance, shares the GPU ([optimization guide](https://docs.vllm.ai/en/stable/configuration/optimization.html)) |
| `--max-model-len` | Limiting the context length reduces memory use ([conserving memory](https://docs.vllm.ai/en/stable/configuration/conserving_memory.html)) |
| `--max-num-seqs` | The maximum number of sequences in one iteration, the maximum batch size; lowering it reduces memory use ([engine arguments](https://docs.vllm.ai/en/stable/configuration/engine_args.html)) |
| `--tensor-parallel-size` | Spreads the model over more GPUs to give more KV cache memory ([optimization guide](https://docs.vllm.ai/en/stable/configuration/optimization.html)) |

To compare 24 GB and 48 GB GPUs for the model weights and the room left over, read [NVIDIA L4 vs L40S for LLM inference](https://www.9owls.com/compare/nvidia-l4-vs-l40s-for-llm-inference/).

## Is the Mamba cache-blocks message the same problem?

It is a different message. With the default Nemotron model, an earlier test logged a line containing `exceeds available Mamba cache blocks`. Setting `--max-num-seqs 16` explicitly removed it: the chat server log had 0 such lines (vLLM v0.32.0, 2026-11-15). The Launchable's Compose file keeps `--max-num-seqs 16` and pins `vllm/vllm-openai:v0.33.0` (read 2026-11-28).

## How do I check that the fix held?

1. List GPU memory per process with `nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv`.
2. Read the chat server log with `docker compose logs --no-color vllm` and search it for `No available memory`.
3. Confirm the chat server answers on port `8000` of the instance, at the path `/v1/models`.
4. Stop and start the instance once, then repeat steps 1 to 3.

To call the server from your own machine, follow [serve an OpenAI-compatible API with vLLM](https://www.9owls.com/guides/serve-an-openai-compatible-api-with-vllm/). For the full Open Notebook stack, read [how to run Open Notebook, a self-hosted NotebookLM alternative](https://www.9owls.com/guides/run-open-notebook-a-self-hosted-notebooklm-alternative/).

## Which sources does this page use?

- [vLLM engine arguments](https://docs.vllm.ai/en/stable/configuration/engine_args.html), read 2026-11-28
- [vLLM optimization and tuning](https://docs.vllm.ai/en/stable/configuration/optimization.html), read 2026-11-28
- [vLLM conserving memory](https://docs.vllm.ai/en/stable/configuration/conserving_memory.html), read 2026-11-28
- 9owls fresh-deploy test records for the Open Notebook on Nemotron Launchable, 2026-11-15 (two runs on AWS g6e.xlarge)
- The Launchable's Compose file, read 2026-11-28

## How was this page made?

9owls published this page. The tested facts come from our own fresh-deploy test records for the [Open Notebook on Nemotron Launchable](https://www.9owls.com/launchables/open-notebook-nemotron/), dated 2026-11-15. The general settings come from the vLLM documentation, read 2026-11-28. We wrote the page from those records; no other site's text was reused. Found an error? Tell us on the [company page](https://www.9owls.com/company/#contact).

## Related pages

- [Open Notebook on Nemotron](https://www.9owls.com/launchables/open-notebook-nemotron/)
- [How to run Open Notebook, a self-hosted NotebookLM alternative](https://www.9owls.com/guides/run-open-notebook-a-self-hosted-notebooklm-alternative/)
- [Serve an OpenAI-compatible API with vLLM](https://www.9owls.com/guides/serve-an-openai-compatible-api-with-vllm/)
- [NVIDIA L4 vs L40S for LLM inference](https://www.9owls.com/compare/nvidia-l4-vs-l40s-for-llm-inference/)

[All guides](https://www.9owls.com/guides/)
