NvEGLImageFromFd(egl_display, render_fd) Failure

Hello.

On tx2 4g, when I try to use eglRender to display an image, I always received error report NvEGLImageFromFd: Failed to create EGLImage from dma-buf fd (1828717595).
Can you help to check what was wrong in my code?main_1.c (10.2 KB)

compile command is :
aarch64-linux-gnu-gcc -o main main_1.c -I/home/nvidia/tegra_multimedia_api/include/ -lX11 -lEGL -lGLESv2 -lnvbuf_utils -L/usr/lib/aarch64-linux-gnu/tegra/ -L/usr/lib/aarch64-linux-gnu -Xlinker -rpath-link="/usr/lib/aarch64-linux-gnu/tegra"

Best regards
Hoover

Hi,
Please try

egl_image = NvEGLImageFromFd(egl_display, dmabuf_fd);

Need to set EGLDisplay.

Same error is reported with egl_image = NvEGLImageFromFd(egl_display, dmabuf_fd);

However, error is gone when I set color Format to something other than ABGR32
, such as NvBufferColorFormat_xRGB32
input_params.colorFormat = NvBufferColorFormat_ABGR32;

maybe egl does not support abgr32? but the output is empty(black screen) with xRGB32 or ARGB32

any updates?

Hi,
NvBufferColorFormat_ABGR32 is the format widely used in jetson_multimedia_api samples and we don’t observe the issue. Have you set EGLDisplay and try?

Yes we did try replacing NULL with EGLDisplay. but it still report
NvEGLImageFromFd: Failed to create EGLImage from dma-buf fd

Hi,
We don’t observe issue in running the sample:

Although it requires the patch: