Hi, I’m trying to port an existing application to the Jetson Xavier AGX. It currently works in KMS mode. First I tried using tegra-ugm:
# Stop X xerver
sudo service gdm stop;
sudo ln -sf /usr/lib/aarch64-linux-gnu/tegra/libnvgbm.so /usr/lib/aarch64-linux-gnu/libgbm.so.1
sudo modprobe tegra-udrm modeset=1
I am able to open the gdm device, but eglInitialize fails. I also tried the method with drmOpen (which is what nvrenderer.cpp uses), but eglInitialize fails on that as well.
Hi,
Not sure if EGL APIs work, but the following demo code works:
if (ctx->enable_cuda)
{
/* Create EGLImage from dmabuf fd */
ctx->egl_image = NvEGLImageFromFd(ctx->egl_display, fd);
if (ctx->egl_image == NULL)
ERROR_RETURN("Failed to map dmabuf fd (0x%X) to EGLImage",
ctx->render_dmabuf_fd);
/* Pass this buffer hooked on this egl_image to CUDA for
CUDA processing - draw a rectangle on the frame */
HandleEGLImage(&ctx->egl_image);
/* Destroy EGLImage */
NvDestroyEGLImage(ctx->egl_display, ctx->egl_image);
ctx->egl_image = NULL;
}