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.
OpenedMemowns the lifetime of the imported pointer;DropcallscuIpcCloseMemHandle.- 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§
- IpcMem
Handle - Cross-process IPC handle for a memory range. 64 bytes of opaque payload — interpret only by re-opening on the destination.
- Opened
Mem - Imported memory handle.
Dropreleases the mapping viacuIpcCloseMemHandle. Cloning is not supported — only oneOpenedMemmay exist per import to keep theDropsemantics straightforward.
Functions§
- get_
mem_ handle - Export an IPC handle for a device allocation.
- open_
mem_ handle - Open a previously-exported IPC handle.