cuda.core._memory._ipc.VirtualMemoryFabricBufferDescriptor#

class cuda.core._memory._ipc.VirtualMemoryFabricBufferDescriptor#

Plain-data descriptor of a VirtualMemoryBuffer exported with fabric handles.

Each physical allocation contributes one opaque 64-byte handle, in address order. Plain pickle, multiprocessing, or a transport of your own can carry these bytes. Use from_handles() to rebuild a descriptor received outside cuda.core, then Buffer.from_ipc_descriptor() to import it. handle_type is always "fabric".

Nothing is pinned: unlike a file descriptor, a fabric descriptor parked in a queue does not retain the memory. The exporter must keep the buffer alive until every importer has imported it. After import, the imported allocation holds its own driver references and is independent of the exporter. Importing a stale or forged handle fails with a driver error.

Sharing is supported on one node; multi-node sharing is untested. Fabric handles require an NVLink fabric and an accessible IMEX channel. Treat handles and sizes received from another process as untrusted and import only through Buffer.from_ipc_descriptor().

Methods

__init__(*args, **kwargs)#
classmethod from_handles(
cls,
handles: Iterable[bytes],
sizes: Iterable[int],
*,
size: int | None = None,
owner_uuid: str | None = None,
) → VirtualMemoryFabricBufferDescriptor#

Build a descriptor from fabric handles received through a transport of your own.

Parameters:
  • handles (Iterable[bytes]) – One opaque 64-byte handle per physical allocation, in address order.

  • sizes (Iterable[int]) – One positive allocation size per handle, in the same order.

  • size (int, optional) – Buffer size, between zero and the sum of sizes; the sum by default.

  • owner_uuid (str, optional) – Exporting device’s UUID, used to identify the owner in error messages.

Raises:

ValueError – If counts differ, a handle is not 64 bytes, an allocation size is not a positive integer, or the buffer size is outside the allocation sizes.

Attributes

handle_type#

VirtualMemoryHandleType

The export handle type; the importing resource must use the same type.

Type:

_VirtualMemoryDescriptor.handle_type

handles#

tuple[bytes, …]

One opaque 64-byte fabric handle per allocation, in address order.

owner_uuid#

str | None

The exporting device’s UUID, if supplied by the exporter.

size#

int

Type:

IPCBufferDescriptor.size

sizes#

tuple[int, …]

Size of each physical allocation, in address order; the sum is at least size.

Type:

_VirtualMemoryDescriptor.sizes