Create contiguous memory via NvBufSurfaceAllocate

Hello,

I am working with a Jetson AGX Orin board with L4T-35.5.0 and create NvBufSurface objects by NvBufSurfaceAllocate.
The filedescriptor of the created NvBufSurface object is given via VIDIOC_QBUF ioctl to a V4L2 driver.
This driver needs contiguous memory.
Sometimes this driver reject the created memory with
“contiguous chunk is too small 2031616/8294400”
My question is, how can I configure NvBufSurfaceAllocate to create contiguous memory.
I have tried to set the isContiguous parameter in the NvBufSurfaceAllocateParams input of NvBufSurfaceAllocate, but without success.

may I know what’s your actual steps to repo this failure?

Hi,
It is not guaranteed to have contiguous memory via NvBufSurfaceAllocate(). You may allocate CPU buffers and copy data into NvBufSurface.

If I have understand the strace log correctly, NvBufSurfaceAllocate uses the NVMAP_IOC_ALLOC ioctl call of the nvmap kernel driver to allocate memory.
This ioctl uses struct nvmap_alloc_handle as input parameter.
In case of nvmap_alloc_handle::flags with set NVMAP_HANDLE_PHYS_CONTIG bit the allocated memeory should be contiguous in ma opinion.
Also the iniput parameter structure of NvBufSurfaceAllocate contains a bool isContiguous member.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.