SIGSEGV when accessing CUeglFrame pPitch data

Hi,

I mapped an CUeglFrame from a NvBufSurface as described here.
I have verified that the frameType is CU_EGL_FRAME_TYPE_PITCH and that cuFormat is CU_AD_FORMAT_UNSIGNED_INT8. This brings me to the conclusion, that I need to get the data from pPitch as uint8_t.

I want to access the pPitch data, but I get a SIGSEGV as soon as I try to access it.

This is the code to access it egl_current_frame is the CUeglFrame variable used here:

  g_print("Data 0: %d\n", static_cast<uint8_t *>(egl_current_frame.frame.pPitch[0])[0]);

Is there more documentation on how to access this data?
My goal is to use this data in a custom cuda kernel to do calculations on.

Hi,
Please move the CUDA code to another file and compile it with nvcc. We have the samples in jetson_multiemdia_api:

/usr/src/jetson_multimedia_api/samples/common/algorithm/cuda

It is based on NvBuffer. NvBufSurface is similar. Please refer to it for the implementation.

Hi. For documentation purposes. This works exactly as described in the example.

I only compiled the cuda kernel with nvcc as shared object and linked it with g++ to the gstreamer plugin.

1 Like