vLLM tensor parallelism fails in a container because shared memory is limited to 64 MB
A container gets 64 MB of shared memory by default. PyTorch and NCCL use that space to move data between the worker processes of a tensor-parallel deployment, so a model that runs on one GPU fails to initialise across several, with an error naming shared memory rather than the model.
Run df -h /dev/shm inside the container. If it reads 64 MB, raise the shared memory size or use host IPC; on Kubernetes mount an emptyDir with the memory medium at /dev/shm.
- Symptom
NCCL WARN Error while creating shared memory segment /dev/shm/nccl-vzIpS6 (size 9637888)- Root cause
- Container runtimes mount a small tmpfs at /dev/shm by default, historically 64 MB. That default was chosen for ordinary applications and is unrelated to what collective communication libraries need. Tensor-parallel vLLM moves tensors between worker processes through that space, and NCCL creates segments there during communicator setup.
- Recommended fix
NCCL_DEBUG=INFO- How Denpex helps
- Denpex investigates vLLM tensor parallelism fails in a container because shared memory is limited to 64 MB using the evidence you provide or your connected workload collects. Earlier rank, host or application evidence is needed to distinguish an initiating failure from a downstream report.
What this failure is
A container configuration failure in which the default 64 MB shared memory mount is too small for the inter-process transfers that tensor-parallel vLLM and NCCL perform, preventing the engine from initialising across multiple GPUs.
Is this what broke your run? Paste your log.
You're reading about vLLM tensor parallelism fails in a container because shared memory is limited to 64 MB. Paste your own traceback and relevant evidence for an investigation of your workload, with a next action or a specific missing fact. A reference entry does not establish your cause. No account or card for the free diagnosis. Review data handling before submitting sensitive logs.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
Why it happens (the mechanism)
The shared memory default is a property of the container runtime, chosen without reference to collective communication. vLLM's workers exchange tensors through that mount and NCCL creates segments in it during setup, so a limit that is generous for a web service is far too small here. Because a single-GPU deployment never touches the segment, the constraint stays hidden until the day someone scales across devices.
What you'll observe
- The same image and model work with one GPU and fail with two or more
- The failure occurs during initialisation, before any request is served
- The error names NCCL or a shared memory segment, which does not obviously implicate the container runtime
- The deployment works locally and fails on the orchestrator, or the reverse
Common symptoms and what they mean
Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.
| Symptom | Possible explanation |
|---|---|
| torch.distributed.DistBackendError: NCCL error, unhandled system error, ncclSystemError | Container runtimes mount a small tmpfs at /dev/shm by default, historically 64 MB. That default was chosen for ordinary applications and is unrelated to what collective communication libraries need. |
| NCCL WARN Error while creating shared memory segment /dev/shm/nccl-vzIpS6 | Tensor-parallel vLLM moves tensors between worker processes through that space, and NCCL creates segments there during communicator setup. When the mount is too small the segment cannot be created and initialisation fails with a system error that names the segment rather than the limit, which is why the cause is not obvious from the message. |
| A warning that the object store is using /tmp instead of /dev/shm because /dev/shm has only 67108864 bytes available, which will harm performance | The failure is invisible on a single GPU because nothing needs the shared segment. It appears the first time the deployment is scaled across devices, which is often long after the image was validated. |
| Initialisation hanging at ncclCommInitRank with no further output | Container runtimes mount a small tmpfs at /dev/shm by default, historically 64 MB. That default was chosen for ordinary applications and is unrelated to what collective communication libraries need. |
Which systems are affected
- Docker containers started without --shm-size or --ipc=host, which receive the 64 MB default
- Kubernetes pods, where the default shared memory size is frequently too small for these containers
- Docker Swarm, which does not support the host IPC option at all
- Any tensor-parallel or pipeline-parallel vLLM deployment, since single-GPU serving does not exercise this path
How to confirm this is the problem
Use this checklist to test the hypothesis against a small reproduction. No single line proves the root cause, so preserve the preceding events and compare one variable at a time.
- ✓Run df -h /dev/shm inside the container. A total of 64 MB confirms the default mount is in place and is the limit being hit.
- ✓Start the identical image with tensor parallel size 1. Success on one GPU and failure on more localises the problem to inter-worker communication rather than to the model or weights.
- ✓Re-run with NCCL_DEBUG=INFO and read the first warning. A message naming a shared memory segment points here; one naming peer access points at the transport instead.
Root cause
- Container runtimes mount a small tmpfs at /dev/shm by default, historically 64 MB. That default was chosen for ordinary applications and is unrelated to what collective communication libraries need.
- Tensor-parallel vLLM moves tensors between worker processes through that space, and NCCL creates segments there during communicator setup. When the mount is too small the segment cannot be created and initialisation fails with a system error that names the segment rather than the limit, which is why the cause is not obvious from the message.
- The failure is invisible on a single GPU because nothing needs the shared segment. It appears the first time the deployment is scaled across devices, which is often long after the image was validated.
The fix and how to prevent it
How to fix it
- Start the container with a larger shared memory allocation, for example a size of 16 GB, or grant it access to the host's shared memory with the host IPC option.
- On Kubernetes, mount an emptyDir with the memory medium and an explicit size limit at /dev/shm, since the pod default is generally insufficient.
- On Docker Swarm, use the shared memory size setting rather than host IPC, because Swarm does not support the host IPC option.
- Add the IPC_LOCK capability where GPUDirect RDMA is in use, which vLLM's troubleshooting guide names alongside an unmounted shared memory directory as a cause of communicator initialisation failure.
- If the failure persists with a large and demonstrably free shared memory mount, suspect segment cleanup rather than size: setting RemoveIPC to no in the logind configuration stops systemd deleting segments that are still in use.
- Where initialisation still hangs, re-run with NCCL_DEBUG=INFO to distinguish this from a peer-to-peer transport problem, which on machines without NVLink can be worked around by disabling peer-to-peer.
Step-by-step remediation
- 1Run df -h /dev/shm inside the running container and check whether the total is 64 MB.
- 2Start the identical image with tensor parallel size 1. Working on one GPU and failing on more points at inter-worker communication.
- 3Restart with a shared memory size of 16 GB, or with host IPC where the orchestrator supports it.
- 4On Kubernetes mount an emptyDir with the memory medium at /dev/shm; on Swarm use the shared memory size setting, since host IPC is unsupported.
- 5Re-run with NCCL_DEBUG=INFO, and investigate IPC segment cleanup rather than capacity.
How to prevent it
- Set the shared memory size in the image's run configuration, compose file or pod spec rather than relying on a runtime default that differs between environments.
- Include a multi-GPU start in the deployment test, since single-GPU validation cannot exercise the code path that fails.
- Record the shared memory requirement next to the tensor parallel size, because the two change together.
Save this diagnosis and catch the next crash automatically
All root cause, fix, and prevention steps above are free to read. Create a free account with any email or GitHub to keep your saved diagnosis history across the encyclopedia and run cloud checks, or use a work email below for the 30-day Team evaluation. No card required.
Or start a 30-day free Team trial (work email)
Verified work email unlocks all 14 fleet diagnostic tools, Slack alerts, and team history for 30 days. No card and no automatic charge.
Searchable error signature
NCCL WARN Error while creating shared memory segment /dev/shm/nccl-vzIpS6 (size 9637888)
torch.distributed.DistBackendError: NCCL error: unhandled system error (run with NCCL_DEBUG=INFO for details)
WARNING: /dev/shm has only 67108864 bytes available. This will harm performance! You may be able to free up space by deleting files in /dev/shm.Use this text as a lookup key in logs and upstream issue trackers. It is not presented as a captured customer log. Confirm the cause from your own preceding events, versions, configuration and the cited references.
Diagnose your own log automatically
The root cause and fix steps above stay free. Create a free account to analyze full job logs, attribute the first failed rank, and keep saved incident history.
Sign up free. Analyze your cluster logsNo credit card. Daily allowance follows verified trust tier. Instant access.
Why the recommended fix works
Enlarging the mount, or sharing the host's, gives the segment room to be created, so communicator setup completes and the workers can exchange tensors. It is a configuration change to the container rather than to vLLM, which is why no vLLM flag resolves it and why the same image behaves differently across environments.
Best practices by model family
| Model / Stack | Recommendation | Notes |
|---|---|---|
| Docker, single host | --shm-size=16g or --ipc=host | Either gives the segment room; host IPC shares the host's mount directly. |
| Kubernetes | emptyDir with medium Memory and a sizeLimit at /dev/shm | The pod default is generally too small for these containers. |
| Docker Swarm | Shared memory size setting only | Swarm does not support the host IPC option. |
| GPUDirect RDMA in use | Add the IPC_LOCK capability | Named in vLLM's troubleshooting guide as a cause of communicator initialisation failure. |
With the fix vs without the fix
| Dimension | With the fix | Without the fix |
|---|---|---|
| Where the limit comes from | The container runtime's default mount | Assumed to be a vLLM or model setting |
| When it becomes visible | The first multi-GPU start | Expected during single-GPU validation |
| A large and free mount | Still fails if segments are being cleaned up underneath | Taken as proof shared memory is not the problem |
Diagnostic note
“A large shared memory mount does not always end the investigation. One reported case had 252 GB provisioned through host IPC and verified more than 98 percent free, and still failed during communicator setup when late-joining ranks tried to attach to segments, reporting no such file or directory at size zero. The suspect there was segment cleanup rather than capacity, addressed by stopping systemd from removing IPC segments still in use. Check the size first because it is nearly always the cause, but do not conclude the mount is innocent merely because it is large.”
Visual fingerprint
tensor parallel size 1 worker0 -> GPU0 /dev/shm unused
tensor parallel size 2 worker0 <-> worker1 /dev/shm REQUIRED
via /dev/shm segments
default mount = 64 MB -> segment creation failsDiagnose this failure in VS Code
Select the traceback or open the failed terminal, then run Denpex locally to inspect matched failure patterns, supporting evidence and next checks without uploading the log. Verify recommendations against your workload before changing production.
Install the free VS Code extensionvLLM errors in context
vLLM failures cross request, model, KV cache, worker, kernel and host boundaries. The hub compares common signatures and evidence checks that help distinguish possible causes.
Compare related vllm errorsRelated failures to investigate next
Frequently asked questions
Questions engineers and on-call staff commonly ask about this failure.
Why does it work on one GPU?
Is this a vLLM bug?
I already use --ipc=host and it still fails.
What is the right size?
References
- ↗vLLM troubleshooting guide, covering communicator initialisation and shared memory
- ↗vLLM issue #1710: crash with tensor-parallel-size inside a Docker container
- ↗SGLang issue #4259: documenting shared memory configuration for multi-GPU deployments
- ↗NCCL issue #2190: error while attaching to a shared memory segment
Don't just read the fix, diagnose your run
The encyclopedia explains documented failure patterns. Denpex investigates your logs, configuration and stack, shows the supporting evidence, and asks for missing details when needed.
Related Infrastructure errors
Dual ISP BGP Route Withdrawal Causing Complete GPU Cloud Region Outage
Infrastructure · critical
Routine UPS Maintenance Triggering Cascading Power and Cooling Failure Across GPU Cloud Region
Infrastructure · critical
Remediation Storm Prevention via Circuit Breaker Pattern in AutoClusters
Infrastructure · high
Network Storage Volume Causing Process Hangs on H100 GPU Nodes
Infrastructure · high