Skip to main content

Module graphics

Module graphics 

Source
Expand description

Graphics-API interop (Runtime API).

Mirrors baracuda_driver::graphics on the Runtime side. Runtime contexts are implicit, so register_* doesn’t take a Context — it uses the current device’s primary context.

For modern Vulkan / D3D12 flows, prefer crate::external::ExternalMemory.

§Workflow

  1. Register the graphics resource (gl::register_buffer, d3d11::register_resource, …) — returns a GraphicsResource.
  2. Call GraphicsResource::map on a stream to hand it to CUDA.
  3. GraphicsResource::mapped_pointer or GraphicsResource::mapped_array → usable device memory.
  4. … compute …
  5. GraphicsResource::unmap releases it back to the graphics API.

Drop unregisters the resource automatically.

Modules§

MapResourceFlags
CUgraphicsMapResourceFlags — map-time access hints.
RegisterFlags
CUgraphicsRegisterFlags — shared register-time flags across GL / D3D / VDPAU / EGL.
d3d9
Direct3D 9 interop (Windows).
d3d10
Direct3D 10 interop (Windows).
d3d11
Direct3D 11 interop (Windows) — the D3D path most still relevant today.
egl
EGL interop — Jetson camera / video pipelines via EGLImage + EGLStream.
gl
OpenGL interop.
nvsci
NvSci interop — query sync-object attributes CUDA expects from NvSciSync signalers / waiters. Feed the resulting NvSciSyncAttrList into libnvsciSync’s reconcile + alloc, then import the resulting object via crate::external::ExternalSemaphore::import with the NvSciSync handle type.
vdpau
VDPAU interop (Linux video-decode pipelines).

Structs§

GraphicsResource
Runtime-side handle to a graphics-API resource. Drop unregisters it.