Skip to main content

Module ipc

Module ipc 

Source
Expand description

cuIpcGetMemHandle / cuIpcOpenMemHandle / cuIpcCloseMemHandle wrappers (gated cuda-ipc).

IPC mem handles let one CUDA process expose a device allocation to another for zero-copy sharing. The 64-byte payload is opaque; ship it via your application’s IPC channel (Unix socket, shared file, gRPC, etc.) and reopen it on the destination.

Lifecycle notes:

  • Both processes must use the same CUDA driver and a peer-capable GPU pair.
  • OpenedMem owns the lifetime of the imported pointer; Drop calls cuIpcCloseMemHandle.
  • The exporter must outlive the importer’s use of the handle — freeing the source allocation while the importer still holds an open handle is undefined.

Structs§

IpcMemHandle
Cross-process IPC handle for a memory range. 64 bytes of opaque payload — interpret only by re-opening on the destination.
OpenedMem
Imported memory handle. Drop releases the mapping via cuIpcCloseMemHandle. Cloning is not supported — only one OpenedMem may exist per import to keep the Drop semantics straightforward.

Functions§

get_mem_handle
Export an IPC handle for a device allocation.
open_mem_handle
Open a previously-exported IPC handle.