cuda.bindings._v2.driver.multicast_bind_mem_v2#

cuda.bindings._v2.driver.multicast_bind_mem_v2(
uint64_t mc_handle,
int dev,
size_t mc_offset,
uint64_t mem_handle,
size_t mem_offset,
size_t size,
unsigned long long flags,
)#

Bind a memory allocation represented by a handle to a multicast object.

Binds a memory allocation specified by mem_handle and created via cuMemCreate to a multicast object represented by mc_handle and created via cuMulticastCreate. The binding will be applicable for the device dev. The intended size of the bind, the offset in the multicast range mc_offset as well as the offset in the memory mem_offset 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 mem_offset should be aligned to the granularity of the memory allocation(see cuMemGetAllocationGranularity) or to the value returned by cuMulticastGetGranularity with the flag CU_MULTICAST_GRANULARITY_RECOMMENDED. The size + mem_offset cannot be larger than the size of the allocated memory. Similarly the size + mc_offset cannot be larger than the size of the multicast object. On systems with Rubin+ (SM_107+) GPUs, mem_offset 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 + mem_offset 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 mem_offset 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. The memory allocation must have beeen created on one of the devices that was added to the multicast team via cuMulticastAddDevice. 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 the multicast object for attachment.

  • mem_handle (uint64_t) – Handle representing a memory allocation.

  • mem_offset (size_t) – Offset into the memory for attachment.

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

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

See also

cuMulticastBindMem_v2