Cannot get EGL_IMAGE from gstreamer

Hello,

I am trying the get an image GPU accessible pointer for processing the image with cuda kernel,
i keep getting NvEGLImageFromFd: Failed to create EGLImage from dma-buf fd (1027)
using the following code (from Dsexample).
even when compiling and running the pipline

gst-launch-1.0 nvcamerasrc ! dsexample ! fakesink

I still get the error message, what can be the problem?

if (USE_EGLIMAGE) {
    static EGLDisplay egl_display = EGL_NO_DISPLAY;
    EGLImageKHR egl_image;

    // Init egl_display if not initialized
    if (egl_display == EGL_NO_DISPLAY) {
      egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
      if (egl_display == EGL_NO_DISPLAY) {
        flow_ret = GST_FLOW_ERROR;
        goto done;
      }
    }

    // Create an EGLImage from the FD
    egl_image = NvEGLImageFromFd (egl_display, dsexample->conv_dmabuf_fd);
    if (!egl_image) {
      flow_ret = GST_FLOW_ERROR;
      goto done;
    }

    // Use interop APIs cuGraphicsEGLRegisterImage and
    // cuGraphicsResourceGetMappedEglFrame to access the buffer in CUDA

    // Destroy the EGLImage
    NvDestroyEGLImage(egl_display,egl_image);
  }

Hi,
dsexample plugin is includedd in DeepStream SDK. We have DS1.5 for TX2 and DS3.0 for Jetson Xavier. It seems not right if you can run it on TX1. Do you run DS1.5 on r28.2/TX1?

well yes.
i am using DS1.5 on TX1, so far most of the functionality worked fine…

Hi,
You may refer to
https://devtalk.nvidia.com/default/topic/1037450/jetson-tx2/use-gstreamer-or-tegra_multimedia_api-to-decode-video-would-be-more-efficient-and-increase-throughput-/post/5270860/#5270860

For your usecase, you can launch ‘nvcamerasrc ! appsink’