Repository navigation
feat: support NVLink switch multicast - #606
Merged
Merged
Conversation
Signed-off-by: David Holtz <[email protected]>
cuMulticast* only exists in CUDA 12.1+ headers, and cuda-bindings binds whatever the host cuda.h declares, so building against a CUDA 12.0 toolkit failed to compile all of cuda-core. A small build-script probe (mirroring cuda-bindings' cuda_has_cuEventElapsedTime_v2 pattern and its toolkit discovery) emits cuda_has_multicast, and the multicast surface of vmm compiles out without it; multicast_supported keeps a uniform probe-and-skip contract by answering false on pre-12.1 toolkits. Verified both directions: a real 13.3 toolkit (cfg on, two-GPU test skips gracefully on non-NVLS hardware) and a stripped cuda.h simulating 12.0 (cfg off, cuda-core compiles cleanly). Also: drivers older than 12.1 answer CUDA_ERROR_INVALID_VALUE for the multicast-support attribute; that now reads as "not supported" instead of panicking the probe-and-skip callers, and the multicast VA reservations pass the team granularity as their alignment instead of relying on the driver default.
nihalpasham
force-pushed
the
nvls-multicast
branch
from
August 1, 2026 13:56
1c3555f to
7bcc410
Compare
nihalpasham
approved these changes
Aug 1, 2026
meefs
pushed a commit
to meefs/cuda-oxide
that referenced
this pull request
Sep 30, 2026
…A#202) * feat(cuda-core): port the CUDA VMM wrappers from cuda-oxide RAII wrappers for the virtual memory management driver API: PhysicalAllocation (cuMemCreate/cuMemRelease), VirtualReservation (cuMemAddressReserve/cuMemAddressFree), Mapping (cuMemMap/cuMemUnmap), plus set_access and granularity helpers. VMM separates physical allocation, VA reservation, and mapping so physical memory from one device can be mapped into another device address space, the foundation for P2P symmetric heaps. Ported from cuda-oxide cuda-core, which is migrating onto this crate. The integration test exercises the full single-GPU lifecycle, alignment edge cases, a data roundtrip through the mapping, and leak-free teardown. The GPU runner executes the target, and the implementation uses the bindings layout helper for CUmemLocation. Signed-off-by: nihalp <[email protected]> * feat(cuda-core): NVLink switch multicast wrappers Safe RAII wrappers for the cuMulticast driver API within this crate CUDA 13.2+ toolkit floor: MulticastObject builds an NVLink SHARP team, add_device registers each GPU, bind_mem attaches per-GPU physical memory, and Mapping::new_multicast maps the team into a device address space so multimem instructions operate on all bound copies. Support and granularity queries allow probe-and-skip on systems without an NVLink switch. Ported from cuda-oxide PR NVIDIA#606, validated end to end on an 8x B200 HGX system there. The two-GPU integration test establishes and tears down the full team plumbing and skips gracefully off NVLS hardware. The shared GPU runner now executes the test. Signed-off-by: David Holtz <[email protected]> Co-authored-by: nihalp <[email protected]> Signed-off-by: nihalp <[email protected]> --------- Signed-off-by: nihalp <[email protected]> Co-authored-by: David Holtz <[email protected]> Co-authored-by: Melih Elibol <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hi thank you for this very exciting project!!
this pr adds nvlink switch multicast support to cuda-core to enable multi-gpu work on nvls systems
the example requires at least two multicast-capable gpus on an nvlink switch system and can be run like:
and outputs the following on a machine with 8x B200s
please let me know if any changes should be made, I'm happy to split anything out if this is too much for one pr or adjust the feature in any other way!