Use NvBufSurface together with a custom cuda kernel

I am writing a custom plugin that needs t run an algorithm in a cuda kernel.
I use the NvBufSurface API for getting a hold of the NVMM (a frame buffer from nvarguscamerasrc) without copying it. I now would like to use that same buffer with a cuda kernel.
Is there an API for this?
Is there example code?

Here is a patch for getting CUDA pointer:
How to create opencv gpumat from nvstream? - #18 by DaneLLL

Please take a look and give it a try.

Ok thank you @DaneLLL . When I have mapped an egl image.
How can I use it with a custom kernel?
In the patch you posted, the eglImage gets converted using opencv and unfortunately not a custom cuda kernel.


This should be resolved per
SIGSEGV when accessing CUeglFrame pPitch data - #4 by elhe

1 Like