Hi guys I need small help with drawing OSD on jetson orin
thanks for any help
NVIDIA Jetson Orin Nano Engineering Reference Developer Kit Super
R35 (release), REVISION: 6.4, GCID: 43803471, BOARD: t186ref, EABI: aarch64, DATE: Tue Jan 27 08:01:21 UTC 2026
deepstream-app version 6.3.0
DeepStreamSDK 6.3.0
CUDA Driver Version: 11.4
CUDA Runtime Version: 11.4
TensorRT Version: 8.5
cuDNN Version: 8.6
libNVWarp360 Version: 2.0.1d3
CUDA device count: 1
Device 0: Orin
SMs: 8
Memory: 7451 MB
what I try to do
// init
cudaError_t CUerr = cudaSuccess;
CUerr = cudaSetDevice(0); // TODO move to params
if (CUerr != cudaSuccess) {
throw std::runtime_error("cudaSetDevice failed");
}
_nvosdContext = nvll_osd_create_context();
// draw
cudaError_t CUerr = cudaSuccess;
CUerr = cudaSetDevice(0);
if (CUerr != cudaSuccess) {
throw std::runtime_error("cudaSetDevice failed");
}
CUerr = cudaFree(0);
if (CUerr != cudaSuccess) {
throw std::runtime_error("cudaFree failed");
}
NvOSD_FrameRectParams frame_rect_params;
memset(&frame_rect_params, 0, sizeof(frame_rect_params));
frame_rect_params.mode = MODE_GPU; // in case MODE_CPU all work perfect
frame_rect_params.buf_ptr = nullptr;
frame_rect_params.num_rects = _arrRectCount;
frame_rect_params.rect_params_list = _arrRect;
if (NvBufSurfaceFromFd(dma_buf_fd, (void**)&frame_rect_params.surf) != 0) {
throw std::runtime_error("Failed to get NvBufSurface from FD");
}
if (NvBufSurfaceMap(frame_rect_params.surf, -1, -1, NVBUF_MAP_READ_WRITE)) {
throw std::runtime_error("Failed NvBufSurfaceMap");
}
if (NvBufSurfaceSyncForDevice(frame_rect_params.surf, -1, -1)) {
throw std::runtime_error("Failed NvBufSurfaceSyncForDevice");
}
int res = nvll_osd_draw_rectangles(_nvosdContext, &frame_rect_params);
if (NvBufSurfaceSyncForCpu(frame_rect_params.surf, -1, -1)) {
throw std::runtime_error("Failed NvBufSurfaceSyncForCpu");
}
if (NvBufSurfaceUnMap(frame_rect_params.surf, -1, -1)) {
throw std::runtime_error("Failed NvBufSurfaceSyncForCpu");
}
if (res != 0) {
fprintf(stderr, "OSD Apply failed with error: %d\n", res);
}
no errors appear but still no rectangles on frame
and all fine with MODE_CPU so all setup looks fine