cuda.bindings._v2.driver.mem_import_from_shareable_handle#

cuda.bindings._v2.driver.mem_import_from_shareable_handle(
intptr_t os_handle,
int sh_handle_type,
) → uint64_t#

Imports an allocation from a requested shareable handle type.

If the current process cannot support the memory described by this shareable handle, this API will error as CUDA_ERROR_NOT_SUPPORTED. If sh_handle_type is CU_MEM_HANDLE_TYPE_FABRIC and the importer process has not been granted access to the same IMEX channel as the exporter process, this API will error as CUDA_ERROR_NOT_PERMITTED.

Parameters:
  • os_handle (intptr_t) – Shareable Handle representing the memory allocation that is to be imported.

  • sh_handle_type (MemAllocationHandleType) – handle type of the exported handle CUmemAllocationHandleType.

Returns:

CUDA Memory handle for the memory allocation.

Return type:

uint64_t

Note

Importing shareable handles exported from some graphics APIs(VUlkan, OpenGL, etc) created on devices under an SLI group may not be supported, and thus this API will return CUDA_ERROR_NOT_SUPPORTED. There is no guarantee that the contents of handle will be the same CUDA memory handle for the same given OS shareable handle, or the same underlying allocation.

See also

cuMemImportFromShareableHandle