cuda-interop
Installation
SKILL.md
CUDA Interop
Overview
ovstream consumes raw video frames as BGRA8 CUDA buffers directly from device memory. No CPU copy, no upload — the SDK reads the GPU pointer you hand it and encodes via NVENC.
The frame descriptor (VideoFrame / ovstream_video_frame_t) holds:
buffer— a CUDA device pointer.width,height— pixel dimensions.pitch_bytes— row stride in bytes (≥width * 4).
Allocate with cudaMallocPitch
NVENC tolerates the buffer being row-padded for DMA alignment. Let CUDA pick the pitch:
Source:
examples/c/basic_stream/main.cusnippetcuda-buffer-alloc
cudaMallocPitch(&buf, &pitch, widthBytes, height) returns a device pointer plus the actual pitch CUDA picked (often width * 4 rounded up to a 256 / 512-byte multiple). Pass that exact pitch into the VideoFrame.pitch_bytes field.