Using the https://docs.nvidia.com/jetson/l4t-multimedia/l4t_mm_12_camera_v4l2_cuda.html. I can create a dma buffer generated using NvBufferCreateEx so the v4l2 driver can use to capture images. Now if I wanted to access this data in cuda kernel the provided sample uses egl image to do so, is it possible to access the dma buffer pointer without the use of EGL image.
Hi,
The case is not supported. For accessing DAM buffer(NvBuffer), it has to be mapped to EGLImage and then get CUDA pointer. If using DAM buffer is not a hard requirement in you ruse-case, you can allocate CUDA buffer for capturing frame data. This is demonstrated in
I saw the sample provided which uses the MMAP and UserPtr memory methods.
Since I want to reduce the memory copy from the driver image capture to Cuda kernels, I am opting to use the DAM buffer.
Do you think, It’s better to use DMA method rather than using MMAP then copy the memory to Gpu space ?
if that’s the case, is it possible to create EGLImageKHR without a Egldisplay using : NvEGLImageFromFd(NULL, DMA_buf_fd);
Thank you for your response, I was wondering if you have any idea why I get the following error : “nvbuf_utils: dmabuf_fd 0 mapped entry NOT found” in “egl_image = NvEGLImageFromFd(EGL_NO_DISPLAY, buf_fd);”
P.S : The Buf_fd corresponds to one of the camera buffers (NvBufferTag_CAMERA) and not a renderer buffer like the one used in 12_camera_v4l2_cuda example.
How do you run the 12_camera_v4l2_cuda in headless mode ?
and if I run this sample when export DISPLAY=:0 is not set I get the same error of my current code : nvbuf_utils: dmabuf_fd 0 mapped entry NOT found and nvbuf_utils: Can not get HW buffer from FD ... Exiting...