DS 6.1.1 - NvBufSurfaceMap - SIGSEGV

• Hardware Platform (Jetson / GPU) ORIN AGX
• DeepStream Version 6.1.1
• JetPack Version 5.0.2

I am trying to port working code from DS 5.1 to DS 6.1.1. The code is doing some custom preprocessing to frame data before SGIE in convert_batch_and_push_to_input_thread method (gstnvinfer.cpp). The problem is that I get SIGSEGV in /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurface.so.1.0.0 everytime I call NvBufSurfaceMap() with &(nvinfer->tmp_surf):

NvBufSurfaceMap (&nvinfer->tmp_surf, -1, -1, NVBUF_MAP_READ)

Example code (based on DeepStream SDK FAQ - #17 by mchi):

...

static gboolean
convert_batch_and_push_to_input_thread (GstNvInfer *nvinfer,
    GstNvInferBatch *batch, GstNvInferMemory *mem)
{

...

  nvtxDomainRangePushEx(nvinfer->nvtx_domain, &eventAttrib);

  NvBufSurface *tmp_surf = &(nvinfer->tmp_surf);
  for (uint32_t bs = 0; bs < tmp_surf->batchSize; bs++) {
      NvBufSurfaceParams *sur = &(tmp_surf->surfaceList[bs]);
      if (sur == NULL)
          break;

      NvBufSurfacePlaneParams *planeParams = &(sur->planeParams);
      for (uint32_t p = 0; p < planeParams->num_planes; p++) {
          if (NvBufSurfaceMap (tmp_surf, bs, p, NVBUF_MAP_READ) != 0) // <- SIGSEGV
              printf("NvBufSurfaceMap failed ===============\n");
          if(tmp_surf->memType == NVBUF_MEM_SURFACE_ARRAY) {
              NvBufSurfaceSyncForCpu (tmp_surf, bs, p);
          }
      }

      for (uint32_t p = 0; p < planeParams->num_planes; p++)
          NvBufSurfaceUnMap (tmp_surf, bs, p);
  }
  
...

}

...

Is it a bug or is there a different approach to access frame data in DS6?

Hi @dominik.zapletal
Will check and get back to you ~

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Hi @dominik.zapletal , Our Deepstream 6.2 GA is available now, we suggest you update to the latest version.
I have added the patch that you used to the nvinfer.cpp in 6.2 GA. It works normally. You can try it.

1 Like

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