Loading...
Searching...
No Matches
CudaVmmAllocator.hpp File Reference

BAR1-mappable GPU memory allocator using the CUDA VMM API. More...

Detailed Description

BAR1-mappable GPU memory allocator using the CUDA VMM API.

Allocates GPU memory that is addressable from third-party DMA engines (NIC, capture card with GPUDirect-RDMA support). The resulting CUdeviceptr is the canonical handoff target for:

  • Rivermax rmx_register_memory() — NIC writes RTP payloads directly into the registered GPU range, no host transit.
  • AJA DMABufferLock(buf, inMap=false, inRDMA=true) — when paired with AJA_RDMA=1 driver build + nvidia_peermem kernel module.
  • Ximea xiSetParam(XI_PRM_TRANSPORT_DATA_TARGET=GPU_RAM) — industrial-camera GPUDirect capture.

Mechanism (from Rivermax's gpu.cpp:cudaAllocateMmap):

cuMemGetAllocationGranularity(&gran, &prop, RECOMMENDED) round size up to multiple of gran cuMemCreate(&handle, size, &prop, 0) // physical alloc cuMemAddressReserve(&dptr, size, ...) // VA range cuMemMap(dptr, size, 0, handle, 0) // bind VA to phys cuMemSetAccess(dptr, size, &access, 1) // grant R/W

Tear-down is symmetric: unmap, address-free, release. The handle itself can be released early (after Map+SetAccess); the mapping holds an internal reference.

Requires CUDA driver 10.2+ (CudaFunctions::vmmSupported == true); on an older driver this class refuses to construct, leaving the consumer to fall back to cuMemAlloc plus host-staged transfers.

Go to the source code of this file.

Classes

class  score::gfx::interop::CudaVmmAllocation
 
class  score::gfx::interop::CudaVmmAllocator
 

Namespaces

namespace  score
 Base toolkit upon which the software is built.
 
namespace  score::gfx
 Graphics rendering pipeline for ossia score.