Torizon custom Qt5 application: Failed to create wl_display

Hello,

I am trying to port my existing Qt5 application to a Verdin iMX8M Plus based device running Torizon Core Linux verdin-imx8mp-07091485 5.4.193-5.7.0+git.f78299297185 #1-TorizonCore SMP PREEMPT.

I have managed to build a docker image that contains my application and based on these instructions Qt Debian Container for Torizon | Toradex Developer Center
I have started the weston compositor in a separate container.
Then I have started the image containing my application with the following command:

docker run -e ACCEPT_FSL_EULA=1 --rm -it --name=qt5
-v /tmp:/tmp
-v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore
–device-cgroup-rule=‘c 199:* rmw’ --device-cgroup-rule=‘c 226:* rmw’
19fae24c75e3
bash

After starting the application with:

$ ./my_app -platform wayland &

I get the following response:


Critical: Failed to create wl_display (No such file or directory) in :0
qt.qpa.plugin Info: Could not load the Qt platform plugin “wayland” in “” even though it was found. in :0
defaultFatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
in :0

Is seems as if my container is not able to find the running weston container.

Any ideas how to solve this problem?

Thanks,
Dusan

I have managed to solve the problem by adding the following two environment variables:

export WAYLAND_DISPLAY=wayland-0
export XDG_RUNTIME_DIR=/tmp/1000-runtime-dir

Would be grateful if someone could clarify the first line.

Thanks,
Dusan

Hi @direttore ,

Glad you managed to solve your issue!

These two environment variables are used by Wayland clients in order to connect them to a Wayland server, in this case Weston, as explained here: weston(1) — Arch manual pages.

Best regards,
Lucas Akira