Blackout droping fps

I developed one plugins that access frame buffer and make certain region zeros in image.
This drops the fps from 120 to 30.
I accomplished this task using the following steps:

  1. Access buffer from GPU to CPU
  2. Convert RGBA to BGR using opencv
  3. Made a mask of ROI and multiply to BGR image using opencv
  4. Convert the BGR to RGBA
  5. Copy buffer from CPU to GPU
    Only few steps impacting a lot.

Is it possible to access GPU buffer directly and possible to make some region zeros?
Please suggest the optimize way.

Have you checked Deepstream sample code snippet ?

I checked the examples basicall dsexample. That not helping. could you suggest how I can make all pixels value to zero directly to GPU buffer.

which memory type are u using? could you share your setup info also?

Hi
using the memory of type NVBUF_MEM_CUDA_UNIFIED.
Is there way to draw rectangular region on image? Also make all pixels to that region to zero.

You can use CudaMemset2D https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g120112b2bd627c7a896390efadc4d2c1