Open-source project
NVIDIA/nvshmem avatar
NVIDIA/nvshmem

NVSHMEM: GPU-initiated communication across a partitioned global address space

NVIDIA NVSHMEM is a parallel programming interface for NVIDIA GPUs based on OpenSHMEM. NVSHMEM can significantly reduce multi-process communication and coordination overheads by allowing programmers to perform one-sided communication from within CUDA kernels and on CUDA streams.

585 stars109 forksC++Apache-2.0

At a glance

What is it?
NVSHMEM puts OpenSHMEM-style one-sided transfers, atomics and collectives inside CUDA kernels, so a GPU thread can move data to another GPU without bouncing through the host. It is a cluster-scale tool with a hardware floor: two data center GPUs and a working process launcher before anything runs.
Who is it for?
Adopt NVSHMEM if you already run multi-GPU, multi-node NVIDIA workloads and your bottleneck is host-mediated coordination, and if you can meet the prerequisites: Linux, a supported driver and CUDA Toolkit, two data center GPUs, and a launcher such as Open MPI, Hydra or Slurm. Do not adopt it for a single-GPU application, for a heterogeneous cluster where the GPU set is not uniform, or as a general replacement for MPI collectives that already meet your latency budget.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 19 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The host round trip NVSHMEM is built to remove

In a conventional multi-GPU job, a kernel finishes, the CPU notices, the CPU posts a message, and another GPU eventually receives it. The GPU compute units sit idle during that coordination. NVSHMEM targets exactly that gap. The README frames the goal as reducing multi-process communication and coordination overheads by letting programmers perform one-sided communication from within CUDA kernels and on CUDA streams. The intended reader is someone writing CUDA code for a cluster of NVIDIA data center GPUs, not someone tuning a single card. The README's prerequisite list makes the audience concrete: a Linux system, an NVIDIA driver and CUDA Toolkit supported by the current release, two NVIDIA data center GPUs, and a compatible process launcher. That second GPU is not a suggestion. A one-sided put needs a remote endpoint, so the interface is meaningless on one device. If your work lives inside a single GPU, or if your inter-GPU traffic is already dominated by bulk copies that saturate the link, NVSHMEM addresses a problem you do not have.

Symmetric memory, PEs, and where the calls can be issued from

The mechanism is a partitioned global address space across NVIDIA GPUs, exposed through symmetric memory. Symmetric means every processing element (PE) allocates the same region at the same logical offset, so a PE can compute the address of a remote buffer without asking the remote side for it. On top of that addressing model the README lists one-sided transfers, atomics, signaling, synchronization, and collective operations. The unusual part is where those operations are legal. NVSHMEM provides host, CUDA kernel, and CUDA stream interfaces, so either a CPU thread or a GPU thread can initiate communication. That is the architectural break from an MPI-plus-CUDA design, where the communication calls sit on the host side of the kernel boundary. A device-initiated put is issued by a thread that is already resident on the GPU, which is what removes the host round trip. The cost is a programming discipline: symmetric allocations, PE-relative addressing, and an explicit application lifecycle. The README points to the Using NVSHMEM guide for the programming model, application lifecycle, compilation, and launch requirements, which is a fair signal that the lifecycle is not something you infer from an example. The put-block example at examples/put-block.cu is described as a complete CUDA program and is the shortest path to seeing the shape of a correct one.

Installing from a package or building from the devel branch

Two install paths exist. The first is a downloaded package from the NVSHMEM product page, followed by the installation guide, with NVSHMEM_PREFIX pointing at the install directory and the loader path extended accordingly:

export NVSHMEM_PREFIX=/path/to/nvshmem export LD_LIBRARY_PATH="$NVSHMEM_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

The second is a source build with CMake, which the README gives in full:

git clone https://github.com/NVIDIA/nvshmem.git cd nvshmem export NVSHMEM_PREFIX="$PWD/install" cmake -S . -B build -DNVSHMEM_PREFIX="$NVSHMEM_PREFIX" -DCMAKE_INSTALL_PREFIX="$NVSHMEM_PREFIX" cmake --build build --parallel cmake --install build

Note the branch warning in the README: the development branch may be newer than the latest published release and its documentation, and a release-aligned build means checking out the corresponding branch or tag before running CMake. Since the default branch is devel, a plain clone lands you on the moving target. For consumption, installed packages provide imported CMake targets, and the README shows linking nvshmem::nvshmem_host and nvshmem::nvshmem_device. Applications that use only host-side or stream-ordered APIs can link only the host target, which keeps the device library out of builds that never issue a device-side call.

Verifying the install with shmem_put_bw under three launchers

The README's verification step is a bandwidth perftest launched across two PEs, one per GPU, and it gives the command for each supported launcher. With Open MPI it is NVSHMEM_BOOTSTRAP=MPI followed by mpirun -np 2 on $NVSHMEM_PREFIX/bin/perftest/device/pt-to-pt/shmem_put_bw with --min_size 8 --max_size 1M --use_smem 0. With Hydra it is NVSHMEM_BOOTSTRAP_PMI=PMI and mpiexec.hydra -n 2 -ppn 2. With Slurm it is NVSHMEM_BOOTSTRAP_PMI=PMI-2 and srun --mpi=pmi2 --nodes=1 --ntasks=2 --gpus-per-task=1. The expected result is stated plainly: both GPUs are reported, put bandwidth is printed across a range of message sizes, and the process exits with status zero. If initialization fails, the README says to rerun with NVSHMEM_DEBUG=INFO and consult the launching guide. That debug variable is the first thing to reach for, because bootstrap failures are the most common early symptom and the default output does not explain them. The bootstrap environment variables are also the detail most likely to be wrong on a first attempt: the variable name differs between the generic MPI path (NVSHMEM_BOOTSTRAP) and the PMI paths (NVSHMEM_BOOTSTRAP_PMI), and the PMI version differs between Hydra and Slurm.

What the prerequisites rule out

The hardware and platform requirements are the sharpest limitation, and they are stated up front rather than buried in a compatibility table. Two NVIDIA data center GPUs are required, which excludes workstations with consumer cards and excludes single-GPU nodes. The driver and CUDA Toolkit must be ones the current release supports, so an older cluster image is a real blocker, not a warning. A process launcher is mandatory: Open MPI, Hydra, or Slurm. If your environment has no MPI and no Slurm, the verification path in the README does not apply to you. There is also a version-alignment trap. The default branch is devel, the README warns that it may be ahead of the published release and its documentation, and the release notes carry the supported platforms, compatibility information, and known issues. A build from devel against an older driver, or a build whose headers do not match the documentation you are reading, produces failures that look like code bugs. Finally, the maintainers direct reproducible bugs and feature requests to GitHub Issues and give a maintainer address at nvshmem@nvidia.com, which is a normal support model for a vendor library but means you are not self-supporting on a cluster-wide rollout.

NVSHMEM versus MPI plus CUDA-aware transfers

The obvious alternative for multi-GPU communication is MPI, often with CUDA-aware transfers, and the difference is where the call is issued. In an MPI program the communication call is made by a host thread, even when the buffer lives in GPU memory; the kernel that produced the data has already retired. NVSHMEM moves the call into the kernel or onto a CUDA stream, using symmetric memory and a partitioned global address space so the issuing thread can address a remote PE's buffer directly. That is a different programming model, not a faster version of the same one. It also means you cannot port an MPI code by swapping function names: the allocation model, the addressing model, and the application lifecycle all change, and the README sends you to the Using NVSHMEM guide for exactly those three topics. A second alternative worth naming is the host-side or stream-ordered subset of NVSHMEM itself. The README states that applications using only those APIs can link just nvshmem::nvshmem_host, which suggests a middle path: keep the symmetric memory and one-sided semantics but issue from the CPU. That path drops the device-initiated property that motivates the project, so it is a migration step rather than the destination.

Release cadence, licence, and the cost of staying current

The release history is dense: v3.7.0-0 in June 2026, v3.7.1-0 in late June, v3.7.2-0 in July, with the last push to the repository in August 2026. Three patch-level releases inside roughly five weeks on a 3.7 line is a cadence to plan around, because each one can move the supported driver and CUDA Toolkit set. A cluster that upgrades NVSHMEM without checking the release notes can end up outside the supported platform matrix. Budget for a pinned version per cluster image and a deliberate upgrade window rather than tracking devel. On licensing, NVSHMEM is Apache-2.0, which is a permissive licence, and the repository accepts contributions under a Developer Certificate of Origin sign-off (git commit -s). Apache-2.0 carries a patent grant and requires that notices be preserved; if you redistribute a binary that links the NVSHMEM libraries, those obligations travel with it. That is a description of the licence text, not legal advice, and anyone shipping a product around it should have counsel read License.txt rather than rely on this summary.

Editorial conclusion

Adopt NVSHMEM if you already run multi-GPU, multi-node NVIDIA workloads and your bottleneck is host-mediated coordination, and if you can meet the prerequisites: Linux, a supported driver and CUDA Toolkit, two data center GPUs, and a launcher such as Open MPI, Hydra or Slurm. Do not adopt it for a single-GPU application, for a heterogeneous cluster where the GPU set is not uniform, or as a general replacement for MPI collectives that already meet your latency budget. Before committing, build from source against a release tag rather than devel, run the shmem_put_bw perftest with your launcher, and read the release notes for the platform matrix and known issues.

Official sources

  1. License: Apache-2.0
  2. NVIDIA/nvshmem on GitHub
  3. Project website
  4. README
  5. Releases
Community notes

Community notes