cuda.bindings._v2.driver.multicast_bind_addr_v2#

cuda.bindings._v2.driver.multicast_bind_addr_v2(
uint64_t mc_handle,
int dev,
size_t mc_offset,
uint64_t memptr,
size_t size,
unsigned long long flags,
)#

Bind a memory allocation represented by a virtual address to a multicast object.

Binds a memory allocation specified by its mapped address memptr to a multicast object represented by mc_handle. The binding will be applicable for the device dev. The memory must have been allocated via cuMemCreate or cudaMallocAsync. The intended size of the bind, the offset in the multicast range mc_offset and memptr must be a multiple of the value returned by cuMulticastGetGranularity with the flag CU_MULTICAST_GRANULARITY_MINIMUM. For best performance however, size, mc_offset and memptr should be aligned to the value returned by cuMulticastGetGranularity with the flag CU_MULTICAST_GRANULARITY_RECOMMENDED. The size cannot be larger than the size of the allocated memory. Similarly the size + mc_offset cannot be larger than the total size of the multicast object. On systems with Rubin+ (SM_107+) GPUs, memptr may be aligned to 256 instead of the value returned by cuMulticastGetGranularity with the flag CU_MULTICAST_GRANULARITY_MINIMUM or CU_MULTICAST_GRANULARITY_RECOMMENDED. In such a case the size + memptr cannot be larger than the size of the allocated memory. Similarly the size + mc_offset + the value returned by cuMulticastGetGranularity with the flag CU_MULTICAST_GRANULARITY_MINIMUM cannot be larger than the size of the than the size of the multicast object. The next available mc_offset for the next bind will be mc_offset + size + the value returned by cuMulticastGetGranularity with the flag CU_MULTICAST_GRANULARITY_MINIMUM. Also note that the ability to accept a memptr that is not aligned to the value returned by cuMulticastGetGranularity with the flag CU_MULTICAST_GRANULARITY_MINIMUM or CU_MULTICAST_GRANULARITY_RECOMMENDED is limited by HW resources and may result in error CUDA_ERROR_MULTICAST_RESOURCE_FULL. For device memory, i.e., type CU_MEM_LOCATION_TYPE_DEVICE, the memory allocation must have been created on the device specified by dev. For host NUMA memory, i.e., type CU_MEM_LOCATION_TYPE_HOST_NUMA, the memory allocation must have been created on the CPU NUMA node closest to dev. That is, the value returned when querying CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID for dev, must be the CPU NUMA node where the memory was allocated. In both cases, the device named by dev must have been added to the multicast team via cuMulticastAddDevice. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this call will return CUDA_ERROR_OUT_OF_MEMORY if there are insufficient resources required to perform the bind. This call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary system software is not initialized or running. This call may fail if the devices added via cuMulticastAddDevice do not belong to the same clique. This call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.

Parameters:
  • mc_handle (uint64_t) – Handle representing a multicast object.

  • dev (int) – The device that for which the multicast memory binding will be applicable.

  • mc_offset (size_t) – Offset into multicast va range for attachment.

  • memptr (uint64_t) – Virtual address of the memory allocation.

  • size (size_t) – Size of memory that will be bound to the multicast object.

  • flags (unsigned long long) – Flags for future use, must be zero now.

See also

cuMulticastBindAddr_v2