Install & Compatibility
Where this runs
tested against v0.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 11.9s · import 0.000s · 527MB
552MB installed
● package 552MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
init
✓ from nvshmem import init
✗ from nvshmem import init
Initialize NVSHMEM, allocate symmetric GPU memory, perform put/get, and barrier.
import os
import cupy as cp
from nvshmem import init, barrier, my_pe_n, n_pes
# Initialize NVSHMEM (must be called after MPI_Init or similar)
init()
rank = my_pe_n()
nranks = n_pes()
# Allocate symmetric memory on GPU
buf = cp.empty(1024, dtype=cp.float32)
# Barrier to synchronize
barrier()
print(f"Rank {rank}/{nranks} ready.", flush=True)
# Example: send data from rank 0 to rank 1 (if nranks > 1)
if nranks > 1:
if rank == 0:
buf[:] = 1.0
nvshmem.putmem(buf.data.ptr, 1, 0, 1024 * 4) # put to rank 1
elif rank == 1:
nvshmem.getmem(buf.data.ptr, 0, 0, 1024 * 4) # get from rank 0
barrier()
print(f"Rank {rank} finished.", flush=True)
Upgrade
Version history
0.3.1latest on PyPI · released Jun 11, 2026
Audit
Dependencies
cupy-cuda12xrequiredRequired for GPU array operations and device memory management.
mpi4pyoptionalRequired for parallel process initialization (e.g., MPI.COMM_WORLD).