Function cudaMemPoolCreate

Source
pub unsafe extern "C" fn cudaMemPoolCreate(
    memPool: *mut cudaMemPool_t,
    poolProps: *const cudaMemPoolProps,
) -> cudaError_t
Expand description

\brief Creates a memory pool

Creates a CUDA memory pool and returns the handle in \p pool. The \p poolProps determines the properties of the pool such as the backing device and IPC capabilities.

To create a memory pool targeting a specific host NUMA node, applications must set ::cudaMemPoolProps::cudaMemLocation::type to ::cudaMemLocationTypeHostNuma and ::cudaMemPoolProps::cudaMemLocation::id must specify the NUMA ID of the host memory node. Specifying ::cudaMemLocationTypeHostNumaCurrent or ::cudaMemLocationTypeHost as the ::cudaMemPoolProps::cudaMemLocation::type will result in ::cudaErrorInvalidValue. By default, the pool’s memory will be accessible from the device it is allocated on. In the case of pools created with ::cudaMemLocationTypeHostNuma, their default accessibility will be from the host CPU. Applications can control the maximum size of the pool by specifying a non-zero value for ::cudaMemPoolProps::maxSize. If set to 0, the maximum size of the pool will default to a system dependent value.

Applications can set ::cudaMemPoolProps::handleTypes to ::cudaMemHandleTypeFabric in order to create ::cudaMemPool_t suitable for sharing within an IMEX domain. An IMEX domain is either an OS instance or a group of securely connected OS instances using the NVIDIA IMEX daemon. An IMEX channel is a global resource within the IMEX domain that represents a logical entity that aims to provide fine grained accessibility control for the participating processes. When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory. If the allocating process does not have access setup for an IMEX channel, attempting to export a ::CUmemoryPool with ::cudaMemHandleTypeFabric will result in ::cudaErrorNotPermitted. The nvidia-modprobe CLI provides more information regarding setting up of IMEX channels.

\note Specifying cudaMemHandleTypeNone creates a memory pool that will not support IPC.

\returns ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorNotSupported

\sa ::cuMemPoolCreate, ::cudaDeviceSetMemPool, ::cudaMallocFromPoolAsync, ::cudaMemPoolExportToShareableHandle, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool