cuda.bindings._v2.driver.ctx_enable_peer_access#
- cuda.bindings._v2.driver.ctx_enable_peer_access(intptr_t peer_context, unsigned int flags)#
Enables direct access to memory allocations in a peer context.
If both the current context and
peer_contextare on devices which support unified addressing (as may be queried usingCU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING) and same major compute capability, then on success all allocations frompeer_contextwill immediately be accessible by the current context. SeeUnified Addressingfor additional details. Note that access granted by this call is unidirectional and that in order to access memory from the current context inpeer_context, a separate symmetric call toctx_enable_peer_access()is required. Note that there are both device-wide and system-wide limitations per system configuration, as noted in the CUDA Programming Guide under the section “Peer- to-Peer Memory Access”. ReturnsCUDA_ERROR_PEER_ACCESS_UNSUPPORTEDifdevice_can_access_peer()indicates that theCUdeviceof the current context cannot directly access memory from theCUdeviceofpeer_context. ReturnsCUDA_ERROR_PEER_ACCESS_ALREADY_ENABLEDif direct access ofpeer_contextfrom the current context has already been enabled. ReturnsCUDA_ERROR_TOO_MANY_PEERSif direct peer access is not possible because hardware resources required for peer access have been exhausted. ReturnsCUDA_ERROR_INVALID_CONTEXTif there is no current context,peer_contextis not a valid context, or if the current context ispeer_context. ReturnsCUDA_ERROR_INVALID_VALUEifflagsis not 0.- Parameters:
peer_context (intptr_t) – Peer context to enable direct access to from the current context.
flags (unsigned int) – Reserved for future use and must be set to 0.
See also
cuCtxEnablePeerAccess