OE4T / tegra-demo-distro

Reference/demonstration distro for meta-tegra
MIT License
73 stars 74 forks source link

L4t graphics demo of EGL image can't display on AGX Orin #260

Closed AlexBu closed 1 year ago

AlexBu commented 1 year ago

Hi,

I cloned the repo and build the demo-image-egl image as the readme instructed. I managed to boot the image on a Jetson AGX Orin devkit 32GB board. However the l4t graphics demos can't get displayed.

Error log:

root@jetson-agx-orin-devkit:/usr/bin/l4t-graphics-demos/egldevice# ./bubble
DRM_CLIENT_CAP_ATOMIC not available.
Could not create the DRM device
<omit program help texts here>

Display_init not yet done[0].
Display_init not yet done[0].

I tried all the demos, they are give the same errors.

The eglstreams-kms-example can't display either with error log:

root@jetson-agx-orin-devkit:/usr/bin# ./eglstreams-kms-example       
GetDrmFd: drmDeviceFile is /dev/dri/card0
ERROR:  not available.

I tried three branches, kirkstone, mickledore and langdale; they all gave the same errors.

madisongh commented 1 year ago

From what terminal are you invoking those programs? The lack of framebuffer console support in L4T R35.x makes the demo-image-egl images less useful, so they haven't been very well tested. There might be a way (using, say, openvt) to fire up those applications in a way that EGL can find the display to use, but I haven't really explored that option. I wouldn't expect that running them from a serial console or ssh terminal to work, though.

AlexBu commented 1 year ago

Hi, I used the debug uart to access the terminal and the image provided a default shell, /bin/sh.

I actually was testing the Boot to Qt distribution and would like some references; and this distro is the only one I can find that uses EGL by default.

I can run a demo from mesa called "kmscube", but the display had flaw, the same as in this post: https://forums.developer.nvidia.com/t/rendering-issue-with-gbm-kms-dri-on-jetson-agx-orin-devkit/235788

For the programs built with Qt framework, they all failed to run.

If I choose backend "eglfs_kms", the error will be "Could not create surface with EGL_NATIVE_VISUAL_ID", as in this post: https://forums.developer.nvidia.com/t/eglfs-kms-could-not-create-surface/248340 If I choose backend "eglfs_kms_egldevice", the error will be "EGL Error : Could not create the egl surface: error = 0x321c", as in this post: https://forums.developer.nvidia.com/t/display-port-dp/247999

To me it seems that the display driver on Orin has some problems when using EGL related functions. I wonder is that true? I can see from the meta layer that start from Orin the "tegra-drm" is replaced by "nvidia-drm".

BTW: the wayland-egl backend is OK, the Qt program can run in a window inside the default weston desktop.

ichergui commented 1 year ago

Hey @AlexBu Any updates about this issue ?

AlexBu commented 1 year ago

Well, I turned to Boot 2 Qt image on AGX Orin and didn't follow this case after that. But I did have some progress after all.

The l4t demos under the egldevices platform on the boot 2 qt image did run correctly, though I had no idea why.

I somehow compared the initialization steps between one of the l4t demo and the qt program. And there are two differences. One is setting a default framebuffer id, which is already been patched on qt5 in meta-tegra layer. The other is setting a valid display attribute.

The display is OK after applying these two changes, under egldevices, of course. GBM platform still has problems, kmscube demo still has texture defects on screen. Something needs to be updated in the display driver, probably.

ichergui commented 1 year ago

@AlexBu Sorry for the late reply Can I close this ticket ?