whatisgithub

What is nccl?

nvidia/nccl — explained in plain English

Analysis updated 2026-06-26

4,702C++Audience · researcherComplexity · 4/5Setup · hard

In one sentence

NCCL is NVIDIA's low-level library that makes multiple GPUs talk to each other at maximum speed, it's the communication backbone that PyTorch and TensorFlow use when training AI models across many GPUs.

Mindmap

mindmap
  root((nccl))
    What it does
      Multi-GPU communication
      Collective operations
      All-reduce and broadcast
    Hardware support
      NVLink
      NVswitch
      PCIe
      InfiniBand
    Use Cases
      AI model training
      Distributed computing
      GPU cluster benchmarking
    Audience
      AI researchers
      ML engineers
      HPC developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Use NCCL as the communication backend when training a large AI model across multiple GPUs in one machine or across many machines in a data center.

USE CASE 2

Benchmark GPU-to-GPU communication bandwidth on your cluster by running the separate NCCL test suite after installation.

USE CASE 3

Build a distributed computing application that needs fast collective operations like all-reduce or broadcast across many GPUs.

What is it built with?

C++CUDANVLinkInfiniBand

How does it compare?

nvidia/ncclmindspore-ai/mindsporemelonds-emu/melonds
Stars4,7024,6904,715
LanguageC++C++C++
Setup difficultyhardhardmoderate
Complexity4/54/52/5
Audienceresearcherresearchergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a multi-GPU machine with CUDA installed, pre-built packages available but source build needs a Makefile setup and matching CUDA version.

So what is it?

NCCL (pronounced "Nickel") is a library from NVIDIA that makes multiple graphics cards talk to each other efficiently. When training large AI models, it is common to spread the work across many GPUs at once, and those GPUs need to constantly share intermediate results with each other. NCCL provides the low-level communication routines that handle this data exchange as fast as possible. The library supports standard collective operations used in distributed computing: all-reduce, all-gather, reduce, broadcast, reduce-scatter, and direct send and receive between any two GPUs. These are the building blocks that AI training frameworks like PyTorch and TensorFlow use under the hood when running across multiple GPUs. NCCL is optimized for the hardware connections that link GPUs together, including PCIe slots, NVLink (NVIDIA's fast direct GPU interconnect), NVswitch (a switching chip for large GPU clusters), and network fabrics like InfiniBand. It works whether your GPUs are all in one machine or spread across many machines in a data center. To use it, you can download pre-built packages from NVIDIA's developer site or compile the source yourself using the provided Makefile. Installation packages are available for Debian, Ubuntu, and Red Hat systems. A separate repository handles the test suite if you want to benchmark communication bandwidth after setup.

Copy-paste prompts

Prompt 1
I'm training a PyTorch model across 4 GPUs using NCCL as the backend. Show me how to initialize the distributed process group and run an all-reduce on my model gradients.
Prompt 2
I want to benchmark NCCL all-reduce bandwidth on my two-GPU machine. Walk me through building the NCCL tests repo and running the all-reduce perf test.
Prompt 3
Explain the difference between NCCL's all-reduce, all-gather, and reduce-scatter operations and when I would use each one in a distributed training setup.
Prompt 4
I have GPUs connected via NVLink and PCIe on the same machine. How does NCCL detect and prefer NVLink paths automatically, and how can I verify which path it is using?

Frequently asked questions

What is nccl?

NCCL is NVIDIA's low-level library that makes multiple GPUs talk to each other at maximum speed, it's the communication backbone that PyTorch and TensorFlow use when training AI models across many GPUs.

What language is nccl written in?

Mainly C++. The stack also includes C++, CUDA, NVLink.

How hard is nccl to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is nccl for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.