cuda.bindings._v2.driver.ipc_get_mem_handle#

cuda.bindings._v2.driver.ipc_get_mem_handle(uint64_t dptr)#

Gets an interprocess memory handle for an existing device memory allocation.

Takes a pointer to the base of an existing device memory allocation created with cuMemAlloc and exports it for use in another process. This is a lightweight operation and may be called multiple times on an allocation without adverse effects. If a region of memory is freed with cuMemFree and a subsequent call to cuMemAlloc returns memory with the same device address, cuIpcGetMemHandle will return a unique handle for the new memory. IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling cuapiDeviceGetAttribute with CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED.

Parameters:

dptr (uint64_t) – Base pointer to previously allocated device memory.

Returns:

Pointer to user allocated CUipcMemHandle to

return the handle in.

Return type:

CUipcMemHandle_v1

See also

cuIpcGetMemHandle