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);
}