I have some questions about the memory of EGLStream.
I know EGLStream manages memory. But I am wondering what type of memory does it use, CPU memory or GPU memory, pinned memory or unified memory?
How is the image data transferred from the camera device to the user through EGLStream? Is there any memory copy in this process?
If I just want to access the image after the ISP pipeline, I think I can use getImage or similar function to get the address of the memory. Is this address a user space address? Is this address accessible by CPU and GPU or CPU only?
I have some follow up questions. Please correct me if I am wrong.
In this example: Jetson Linux API Reference: 10_camera_recording (libargus capture) | NVIDIA Docs, it mentions “zero-copy output”. That only means I don’t need to copy the buffer out to pass to the consumer. But it doesn’t mean there is no buffer transfer in the stream, especially for CUDA consumer, there must be buffer transfer because EGLStream uses CPU memory, right?
If the application, running in CPU, just wants to copy the image data, it can use “getImage” to get the pointer of the buffer and directly access the image data, right?
If I don’t setup CUDA consumer but I would like to use GPU to process image data output from EGLStream, I have to allocate my own GPU accessible memory and copy the image from the address, got from “getImage” function, to GPU memory, right?
Is it possible that to use unified memory (accessible by both CPU and GPU) in EGLStream or map the address, got from “getImage” funciton, to GPU accessible address to avoid copying?
Hi,
Generally we would suggest use NvBufSurface APIs for further development. So that you can access the frame data though CPU or GPU. And use hardware engines such as converter, encoders. There are APIs for synchronizing the buffer data to CPU/GPU. Please refer to 09 and 10 samples.