How to zero-copy between the buffer of NvBufSurface and the allocation of cuMemCreate

Hi, NVIDIA
I use an NvBufSurface as a container of the source data which is from a V4L2-device and the format is YUYV.
In order to share data with another process, I allocate another buffer via cuMemCreate which is going to be a container of RGB format data.
How can I transform the YUV data to the RGB data, is it need another buffer to be the input of cuda kernel function?
PS. I must use NvBufSurface for encoding it and scaling it later.

Hi,
For information, do you need NvBufSurface in the other process? Or need RGB data in CUDA buffer?

HI, I need NvBufSurface in local process, and RGB in CUDA buffer(for sharing purpose).

Hi,

Please check if the below can meet your requirements:

Thanks.

Thank you.The NvSciBuf is refreshing to me. I‘m learning it.

Hi,
A possible solution is to allocate NvSciBuf, and implement CUDA code to convert NvBufSurface YUYV to NvSciBuf RGB. And send NvSciBuf RGB to the other process.

It seems that my key issue becomes that How to place NvBufSurface YUYV data to cuda processors.

Will it works? for example
Call cudaImportExternalMemory to import the fd of NvBufSurface, and then Run CUDA kernel on the dptr of cudaExternalMemoryGetMappedBuffer

Hi,
Please try the function calls:
How can I access to device memory in nvbufsurface? - #4 by AastaLLL

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