cuda.core.VirtualMemoryResourceOptions#

class cuda.core.VirtualMemoryResourceOptions(
allocation_type: ~cuda.core.typing.VirtualMemoryAllocationType = VirtualMemoryAllocationType.PINNED,
location_type: ~cuda.core.typing.VirtualMemoryLocationType = VirtualMemoryLocationType.DEVICE,
handle_type: ~cuda.core.typing.VirtualMemoryHandleType = VirtualMemoryHandleType.POSIX_FD,
granularity: ~cuda.core.typing.VirtualMemoryGranularityType = VirtualMemoryGranularityType.RECOMMENDED,
gpu_direct_rdma: bool = False,
addr_hint: int | None = 0,
addr_align: int | None = None,
peers: ~typing.Iterable[int] = <factory>,
self_access: ~cuda.core.typing.VirtualMemoryAccessType = VirtualMemoryAccessType.READ_WRITE,
peer_access: ~cuda.core.typing.VirtualMemoryAccessType = VirtualMemoryAccessType.READ_WRITE,
)#
A configuration object for the VirtualMemoryResource

Stores configuration information which tells the resource how to use the CUDA VMM APIs

allocation_type#

Controls the type of allocation.

Type:

VirtualMemoryAllocationType | str

location_type#

Controls the location of the allocation.

Type:

VirtualMemoryLocationType | str

handle_type#

Export handle type for the physical allocation. Use "posix_fd" on Linux if you plan to import/export the allocation (required for cuMemRetainAllocationHandle). Use None if you don’t need an exportable handle.

Type:

VirtualMemoryHandleType | str

gpu_direct_rdma#

Hint that the allocation should be GDR-capable (if supported).

Type:

bool

granularity#

Controls granularity query and size rounding.

Type:

VirtualMemoryGranularityType | str

addr_hint#

A (optional) virtual address hint to try to reserve at. Setting it to 0 lets the CUDA driver decide.

Type:

int

addr_align#

Alignment for the VA reservation. If None, use the queried granularity.

Type:

int

peers#

Extra device IDs that should be granted access in addition to device.

Type:

Iterable[int]

self_access#

Access flags for the owning device.

Type:

VirtualMemoryAccessType | None | str

peer_access#

Access flags for peers.

Type:

VirtualMemoryAccessType | None | str