Hi nvidia:
I obtained the device pointer from the nvbufsurface using the EGL method: NvBufSurfaceMapEglImage->cuGraphicsEGLRegisterImage->cuGraphicsResourceGetMappedEglFrame
After completing the CUDA kernel function and performing cudaStreamSynchronize, I immediately placed the nvbuffer into the encoder for H264 encoding. The last few lines of the encoded picture data were damaged and not synchronized.
If I apply remap process: cuGraphicsUnregisterResource-> cuGraphicsEGLRegisterImage ->cuGraphicsResourceGetMappedEglFrame to ensure synchronization and reusability, this process occasionally blocks for a relatively long time. Most of the time it’s 2 milliseconds, occasionally it exceeds 10 milliseconds.
My question is: Is there any efficient way to ensure that the memory Stably synchronized between the mapped device memory and the fd of the nvbuffer can be achieved? Or are there any other methods besides the EGL way to obtain the device memory from the nvbuffer?
My platform is Jetson Xavier AGX. R35.6.0
Thanks,
ernan