GBM device create fails

Hi,
I am using Linux R35.5.0 (Jetpack 5.1.3) with a custom carrier board, GStreamer and QT 5.12.12 .
My QT app is configured to use the KMS/DRM backend (no windowing system) to render QT graphics using EGLStreams for buffer management. This works most of the time except for this:

  1. the UI render thread sometimes hangs in a call to EGL swapBuffers which gets stuck in pthread_cond_wait in GLIBC library.
  2. the EglStrmAcq thread sometimes has a segmentation fault as per
    Libnvll crash

Above hang and seg fault only seems to happen after a call to gst_nvdrmvideosink_stop. This is a DVR app so one of the six video inputs gets routed to the display per user request hence there is a call to gst_nvdrmvideosink_stop every time the viewed video source is changed.

To get around these issues I am trying to use GBM instead of EGLStreams for my QT renderer. However gbm_create_device() is failing. QT code is doing this:
int fd = drmOpen(“drm-nvdc”, nullptr); //returns fd=5
m_gbm_device = gbm_create_device(fd); //returns 0

Seems correct per https://docs.nvidia.com/jetson/archives/r35.1/DeveloperGuide/text/SD/WindowingSystems/WestonWayland.html:

This code snippet shows how to allocate a buffer using GBM:
drm_fd = open(“/dev/dri/card0”, O_RDWR);
device = gbm_create_device(drm_fd);

I cannot use open() since there is no “/dev/dri” device to get a fd. Is drmOpen
fd not compatible with gbm_create_device()?

Hi,
It may not be compatible. For developing DRM use-cases, we would suggest referring to the sample:

/usr/src/jetson_multimedia_api/samples/08_video_dec_drm/

Is libdrm and libnvll thread-safe since both QT display thread (to DP0) and gstreamer pipeline thread with gstnvdrmvideosink (to DP1) are in the same process/app? I have another QT app rendering to DP1 (no Gstreamer) running concurrently that never has an issue.

Hi,
Do you have DP0 rendering through X and DP1 through DRM? Not quite understand the use-case and please share more information.

There is no windowing system like X11 or Wayland installed.

There are two QT apps running at the same time:
1>QT app #1 using EGL ->KMS/DRM backend to render QT GUI #1 to DP0.
2>QT app #2 using EGL ->KMS/DRM backend to render QT GUI #2 to DP1.

QT app #1 is also running Gstreamer pipelines to render video (from one of 6x MIPI capture sources or playback) via gstnvdrmvideosink to DP1. Changing the GStreamer DP1 render source is what is causing QT app #1 EGL render to randomly hang or crash.

QT app #2 without GStreamer never hangs or crashes.

Hi,
We are not familiar with QT app. It’s not validated and may not work properly. Would suggest follow steps in documents, and base on 08 sample or nvdrmvideosink to develop the use-case.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.