Skip to content

NCCL Error 3: ncclInternalError: Internal check failed

Fix NCCL error 3 (ncclInternalError: Internal check failed) in PyTorch distributed training and vLLM by resolving duplicate libnccl libraries and topology mismatches.

Quick answer

NCCL error 3 (ncclInternalError: Internal check failed) indicates an internal NCCL invariant failed, most commonly caused by duplicate/mismatched libnccl.so versions across LD_LIBRARY_PATH vs PyTorch wheels, heterogeneous NCCL versions across nodes, or broken GPU topology/NVSwitch graphs.

Symptom
ncclInternalError: Internal check failed.
Root cause
Conflicting libnccl.so library versions on LD_LIBRARY_PATH, cross-node version skew, or corrupted NVLink/topology state.
Recommended fix
NCCL_DEBUG=INFO
How Denpex helps
Denpex investigates NCCL Error 3: ncclInternalError: Internal check failed 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.
Networking#nccl#nccl-error-3#ncclInternalError#pytorch#distributed

What this failure is

NCCL returned status code 3 (ncclInternalError), meaning an internal assertion inside libnccl failed during communicator initialization or collective setup.

Live diagnosis, no signup

Is this what broke your run? Paste your log.

You're reading about NCCL Error 3: ncclInternalError: Internal check failed. 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.

training_logs.txt
No log to hand? Try one:

Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.

3 free cloud diagnoses per day

Why it happens (the mechanism)

When a container has both a system libnccl.so (or nvidia-nccl-cu* wheel) and PyTorch's bundled NCCL, or when nodes run differing NCCL/driver builds or fail topology XML parsing, NCCL hits an internal invariant mismatch and aborts with error 3.

What you'll observe

  • Distributed training or inference crashes during init_process_group or first collective with NCCL error 3: internal error
  • Multi-node jobs abort inconsistently depending on LD_LIBRARY_PATH or node image

Common symptoms and what they mean

Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.

SymptomPossible explanation
torch.distributed.DistBackendError: NCCL error ... ncclInternalError: Internal check failedConflicting libnccl.so library versions on LD_LIBRARY_PATH, cross-node version skew, or corrupted NVLink/topology state.
NCCL WARN Internal check failed in ncclCommInitRankConflicting libnccl.so library versions on LD_LIBRARY_PATH, cross-node version skew, or corrupted NVLink/topology state.

Which systems are affected

  • PyTorch DDP, FSDP, Megatron-LM, and DeepSpeed jobs
  • vLLM and SGLang multi-GPU serving clusters

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.

  • ✓Confirm NCCL_DEBUG=INFO reports identical NCCL versions across every rank and completes nccl-tests all_reduce_perf without warnings.

Root cause

  • Conflicting libnccl.so library versions on LD_LIBRARY_PATH, cross-node version skew, or corrupted NVLink/topology state.

The fix and how to prevent it

How to fix it

  • Re-run with NCCL_DEBUG=INFO NCCL_DEBUG_SUBSYS=INIT,GRAPH,ENV to print the exact NCCL version, file path, and assertion line preceding Internal check failed.
  • Compare PyTorch bundled NCCL version (python3 -c "import torch; print(torch.cuda.nccl.version())") against ldconfig -p | grep libnccl and LD_LIBRARY_PATH.
  • Ensure all nodes run identical container images and check nvidia-smi topo -m plus dmesg for NVSwitch/NVLink errors.
  • Remove conflicting custom NCCL_TOPO_FILE or LD_PRELOAD overrides during a clean control launch.

Step-by-step remediation

  1. 1Run with NCCL_DEBUG=INFO to capture the exact NCCL version and internal check file/line.
  2. 2Compare torch.cuda.nccl.version() with ldconfig and LD_LIBRARY_PATH across every node.
  3. 3Check nvidia-smi topo -m and verify nccl-tests passes across all GPUs.

How to prevent it

  • Standardize immutable container images across every worker node
  • Avoid mixing pip nvidia-nccl upgrades separately from the tested PyTorch wheel unless verified

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.

Use your company email, for example alex@yourcompany.com.

Who qualifies?

Company email domains activate the free 30-day Team evaluation (up to 50 diagnoses a day) after an email and domain check, whatever mail provider you use. If we cannot verify your domain automatically, support reviews it: write to support@denpex.com. Free local diagnosis in the editor extension needs no account.

Using a personal email (Gmail, Outlook, Naver, QQ) or solo cluster? Create a free $0 account (no work email required) to save 7-day history and unlock AI fallback, or send a cluster crash log for a live walkthrough.
Already have an account? Sign in

Searchable error signature

search key
ncclInternalError: Internal check failed.
RuntimeError: NCCL error in: ... ncclInternalError: Internal check failed

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 logs

No credit card. Daily allowance follows verified trust tier. Instant access.

Why the recommended fix works

Eliminating duplicate libnccl.so binaries and inspecting NCCL_DEBUG=INFO INIT/GRAPH output exposes version skew or broken topology XMLs cleanly.

Code examples

snippet
python3 -c "import torch; print('torch nccl:', torch.cuda.nccl.version())"
ldconfig -p | grep libnccl
NCCL_DEBUG=INFO NCCL_DEBUG_SUBSYS=INIT,GRAPH,ENV python3 -m torch.distributed.run --nproc_per_node=8 train.py

This snippet illustrates the entry-specific check. Verify the installed versions, permissions, target and workload context before using it. A command or API example is not proof of recovery.

Best practices by model family

Model / StackRecommendationNotes
Duplicate libnccl on LD_LIBRARY_PATHAlign or unset conflicting LD_LIBRARY_PATH NCCL pathsEnsures PyTorch uses one consistent NCCL build.
Multi-node image driftVerify identical container digest on all ranksCross-version communicators trigger internal checks.

With the fix vs without the fix

DimensionWith the fixWithout the fix
Library resolutionSingle verified libnccl.so across all nodesMixed pip + system NCCL throws Error 3
Debug visibilityNCCL_DEBUG=INFO INIT,GRAPHGeneric RuntimeError hides assertion line

Diagnostic note

“Running pip install --upgrade nvidia-nccl-cu12 inside an existing NGC or PyTorch environment is one of the fastest ways to trigger ncclInternalError when C++ symbols or header structs disagree across extensions.”

Diagnose 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 extension

NCCL errors in context

An NCCL error can follow an earlier worker failure. The hub connects documented collective errors with their interpretation limits, worker evidence and configuration checks.

Compare related nccl errors

Frequently asked questions

Questions engineers and on-call staff commonly ask about this failure.

What is NCCL error 3?
NCCL status code 3 is ncclInternalError (Internal check failed), indicating an unexpected internal state such as mismatched NCCL library versions, invalid topology graphs, or cross-node build skew.
Can mixed container versions across two nodes cause ncclInternalError?
Yes. Always run the exact same PyTorch, CUDA, and NCCL container digest on every participating node.

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.