cuda.bindings._v2.driver.mem_map#
- cuda.bindings._v2.driver.mem_map(
- uint64_t ptr,
- size_t size,
- size_t offset,
- uint64_t handle,
- unsigned long long flags,
Maps an allocation handle to a reserved virtual address range.
Maps bytes of memory represented by
handlestarting from byteoffsettosizeto address range [addr,addr+size]. This range must be an address reservation previously reserved withcuMemAddressReserve, andoffset+sizemust be less than the size of the memory allocation. Bothptr,size, andoffsetmust be a multiple of the value given viacuMemGetAllocationGranularitywith theCU_MEM_ALLOC_GRANULARITY_MINIMUMflag. Ifhandlerepresents a multicast object,ptr,sizeandoffsetmust be aligned to the value returned bycuMulticastGetGranularitywith the flagCU_MULTICAST_MINIMUM_GRANULARITY. For best performance however, it is recommended thatptr,sizeandoffsetbe aligned to the value returned bycuMulticastGetGranularitywith the flagCU_MULTICAST_RECOMMENDED_GRANULARITY. Whenhandlerepresents a multicast object, this call may fail if the devices added viacuMulticastAddDevicedo not belong to the same clique. Whenhandlerepresents a multicast object, this call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly. Please note callingcuMemMapdoes not make the address accessible, the caller needs to update accessibility of a contiguous mapped VA range by callingcuMemSetAccess. Once a recipient process obtains a shareable memory handle fromcuMemImportFromShareableHandle, the process must usecuMemMapto map the memory into its address ranges before setting accessibility withcuMemSetAccess.cuMemMapcan only create mappings on VA range reservations that are not currently mapped.- Parameters:
ptr (uint64_t) – Address where memory will be mapped.
size (size_t) – Size of the memory mapping.
offset (size_t) – Offset into the memory represented by.
handle (uint64_t) – Handle to a shareable memory.
flags (unsigned long long) – flags for future use, must be zero now.
See also
cuMemMap