Issues Running QT and Pyside Template

I’m playing around with displaying GUIs on my iMX8M-Mini for the first time with the Verdin Development board and the 10" LVDS display. I’ve been able to get a few of the VSCode templates to run correctly like the Avalonia one, but the QT and the Pyside templates both fail.

I have not modified anything and they both give the same errors. Am I missing a required step to set these templates up? I am trying to run these with the task runner run-container-torizon-release-arm64.

 ✔ Container torizon-weston-1  Recreated                                                                                                              6.3s 
 ✔ Container torizon-qt-1      Created                                                                                                                0.1s 
Attaching to qt-1
qt-1  | Failed to create wl_display (No such file or directory)
qt-1  | qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
qt-1  | This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
qt-1  | 
qt-1  | Available platform plugins are: eglfs, wayland-egl, vkkhrdisplay, offscreen, wayland, linuxfb, minimal, xcb, minimalegl, vnc.
qt-1  | 
qt-1 exited with code 133
Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.54-7.1.0-g3493ccd66900 #1-Torizon SMP PREEMPT Tue Dec 17 21:04:41 UTC 2024
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/28c6117959abbf7185a98daaa9ef3bef7020fdd7ea6dbaa0701fc0e45f2a38a2/0
Distro name:              NAME="Torizon OS"
Distro version:           VERSION_ID=7.1.0-build.4
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-imx8mm-07276450
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Mini WB on Verdin Development Board
Toradex version:          0055 V1.1E
Serial number:            07276450
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello there!

It sounds like you’re having some trouble running Qt and PySide templates on your Verdin iMX8M-Mini. The error you’re encountering suggests that the Wayland display server, managed by the Weston container, isn’t available. Let’s go through some steps to help you resolve this:

  1. Ensure Weston is Running: The Weston container must be active as it serves as the graphics server. You can start it with the following command:

    docker run -d --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG \
    -v /dev:/dev -v /tmp:/tmp -v /run/udev:/run/udev \
    torizon/weston
    

    This command will initiate the Weston container, which is essential for running graphical applications using Wayland.

  2. Verify Qt Container Setup: Make sure your Qt container is configured to use the Wayland display server. It should be based on the correct Qt Debian image, such as qt6-wayland-vivante for your hardware.

  3. Check Docker Configuration: Confirm that your Docker setup is using the correct architecture (linux/arm64) and image names suitable for the iMX8M-Mini.

  4. Use Visual Studio Code Properly: If you’re using the Visual Studio Code Torizon IDE Extension, ensure your project configuration includes the Weston container as a dependency. This can be done by adding it to your docker-compose.yml file.

  5. Re-run Your Application: Once you’ve confirmed the Weston container is running, try running your Qt or PySide application again using the task runner.

By following these steps, you should be able to get your Qt and PySide templates up and running smoothly.

If you have any more questions or need further assistance, feel free to ask.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Boot2Qt & Qt Creator Alternative.

That command does not produce a running container. However if I use this command I get a working Weston container.

docker container run -d --name=weston --net=host \
    --cap-add CAP_SYS_TTY_CONFIG \
    -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
    --device-cgroup-rule="c 4:* rmw" --device-cgroup-rule="c 253:* rmw" \
    --device-cgroup-rule="c 13:* rmw" --device-cgroup-rule="c 226:* rmw" \
    --device-cgroup-rule="c 10:223 rmw" --device-cgroup-rule="c 199:0 rmw" \
    torizon/weston-imx8:4 \
    --developer

With the above container running, I now get this error.

 ✔ Container torizon-weston-1  Created                                                                                                                0.0s 
 ✔ Container torizon-qt-1      Created                                                                                                                0.4s 
Attaching to qt-1
qt-1  | qt.qpa.wayland: Failed to initialize EGL display 3001
qt-1  | Hello Torizon!
qt-1  | QRhiGles2: Failed to create temporary context
qt-1  | QRhiGles2: Failed to create context
qt-1  | Failed to create RHI (backend 2)
qt-1  | Failed to initialize graphics backend for OpenGL.
qt-1 exited with code 133

Greetings @dleberfinger,

I see you are running Torizon OS 7.1.0 on your device. Our templates still need to be updated to work on this version of the OS. Some templates have been migrated for use on Torizon OS 7.X and are available on the pre-release version of our IDE extension as announced here: Pre-Release Torizon OS 7 Support / VS Code / Torizon Templates / Development Tools

Please be aware that not all templates have been migrated to be compatible on Torizon OS 7.X and some have been deprecated.

So if you’re not already using the pre-release version of the extension then I would suggest you do so, if you want to keep developing on Torizon OS 7.X. You’ll probably need to re-create/update your project using the updated template. Furthermore, keep in mind these are still in a “pre-release” state so some issues may be expected, feedback is welcome.

Best Regards,
Jeremias

@jeremias.tx

Thank you that worked. I am leaning towards Avalonia given the steep cost of QT. I think ideally I would use framebuffer to reduce the load on the board as I only need a single full screen app. However, I am having a hard time figuring out how to debug that locally on my linux development VM. Is there an easy option to debug that locally?

Is there an easy option to debug that locally?

On quick inspections I see that the Avalonia Framebuffer template does not have a debug configuration for local debugging: vscode-torizon-templates/dotnetAvaloniaFrameBuffer/.vscode/launch.json at dev · torizon/vscode-torizon-templates · GitHub

Compared to something like the QML template which does have a “Local AMD64” debug configuration: vscode-torizon-templates/cppQML/.vscode/launch.json at dev · torizon/vscode-torizon-templates · GitHub

I would take this to mean there is some technical blocker or challenge for Avalonia Framebuffer to have a local debug option. Though I can double-check with our IDE extensions team to be sure.

Best Regards,
Jeremias

Just to give some feedback. My hunch was correct, there is no local debug option for the Avalonia Framebuffer template, but the GTK Avalonia template does have such an option.

Best Regards,
Jeremias

Hi @dleberfinger ,

All set here? You chose a framework?

best,

Hello @michael.tx,

At this point I think we are going to go with the Avalonia route. We have some existing C# programs for Windows that we are actively converting to Avalonia for some experience, so if all goes well there we will continue with that tech stack on this project.