Flutter GUI not displaying on HDMI when running in container on Verdin iMX8MP (Mallow Carrier)

Hi Toradex Team,

I am new to Toradex and currently working with a Verdin iMX8MP module on a Mallow carrier board.

Setup Overview

torizon@verdin-imx8mp-15678843:~$ cat /etc/os-release
ID=torizon
NAME=“TorizonCore”
VERSION=“6.8.0-devel-202409+build.26 (kirkstone)”
VERSION_ID=6.8.0-devel-202409-build.26
PRETTY_NAME=“TorizonCore 6.8.0-devel-202409+build.26 (kirkstone)”
DISTRO_CODENAME=“kirkstone”
BUILD_ID=“26”
ANSI_COLOR=“1;34”
VARIANT=“Docker”

Current Status

I have successfully:

  • Installed all required tools using VS Code

  • Set up the hardware correctly

  • Developed a Flutter GUI

When I run the Flutter application locally, the GUI works perfectly.

Issue Description

However, when I launch the debug container on the Toradex device, I face the following issues:

  • The container starts and appears to be running

  • The HDMI screen remains completely blank

  • There is no output or error when running docker logs

  • It seems like the container may be crashing silently

I also tried running the Flutter container on top of the Weston compositor image:

torizon/weston-vivante:3

The Weston container runs (uptime looks normal), but:

  • Nothing is displayed on the HDMI screen (Visible - Grey screen and Terminal of Vivante Container)

  • No useful logs are generated

What I’m Looking For

I would like to better understand:

  • How a Flutter GUI container is expected to run on Torizon

  • How Flutter interacts with Weston and the display stack

  • Any recommended base images, configurations, or examples for running Flutter on Verdin iMX8MP

  • Common pitfalls that might cause a blank screen or silent container crash

Any guidance greatly appreciated.

Thank you for your support.

Best regards,

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Flutter on Torizon Setup Guidance

Thank you for sharing your detailed setup information. Based on your configuration with Verdin iMX8MP on TorizonCore 6.8.0, I can provide guidance on running Flutter applications.

Flutter Architecture on Torizon

Flutter applications on embedded Linux require a specific setup with the Wayland compositor (1). The Flutter architecture consists of application-specific code, common source files, and platform-specific adaptation through an embedder layer (1).

For Torizon, the eLinux embedder has proven to be easier to set up than Meta-Flutter (1). The same Flutter application can work across different platforms including web and embedded systems (1).

Required Container Setup

1. Weston Compositor Container

First, you need to run the appropriate Weston container for your iMX8MP hardware. For i.MX8 modules, use (2):

# 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

(2)

2. Flutter Application Container

The Flutter container needs to communicate with Weston through Unix socket files. The Weston container creates these socket files typically in the /tmp/1000-runtime-dir directory (2). By bind mounting /tmp into your Flutter container, the Wayland client application can access the Wayland compositor (2).

Container Communication

The key to successful Flutter deployment is ensuring proper communication between containers (2). The Wayland client application (your Flutter app) communicates with Weston through the Unix socket file to coordinate drawing the window to the output screen (2).

Docker Compose Example

Here’s the structure for running multiple containers with Docker Compose (1):

services:
  weston:
    image: torizon/weston-imx8:4
    # Required to get udev events from host udevd via netlink
    network_mode: host
    volumes:
      - type: bind
        source: /tmp
        target: /tmp
      - type: bind
        source: /dev
        target: /dev
      - type: bind
        source: /run/udev
        target: /run/udev
    cap_add:
      - CAP_SYS_TTY_CONFIG
    # Add device access rights through cgroup...
    device_cgroup_rules:
      # ... for tty0
      - 'c 4:0 rmw'
      # ... for tty7
      - 'c 4:7 rmw'
      # ... for /dev/input devices
      - 'c 13:* rmw'
      # ... for /dev/dri devices
      - 'c 226:* rmw'
      # ... for /dev/galcore device
      - 'c 199:0 rmw'
      # ... for /dev/dma_heap device
      - 'c 253:* rmw'

(2)

Troubleshooting Steps

1. Verify Weston is Running

Check that Weston starts properly and creates the necessary socket files:

# docker logs weston

(2)

2. Container Execution

Use docker exec to run commands inside the Weston container to verify functionality (2):

# docker exec weston weston-terminal

(2)

3. Hardware Access

Ensure your Flutter container has the necessary hardware access through the device cgroup rules and volume mounts (2). The arguments in the Weston command make sure the container can access the necessary hardware (display controller, GPU and input devices) and be notified about hardware changes (2).

Common Issues

Based on community feedback, there can be stability issues with rapid HDMI connect/disconnect scenarios that may cause crashes (3). Ensure your setup handles display events gracefully.

The blank screen you’re experiencing suggests the Flutter container may not be properly connecting to the Weston compositor. Verify that:

  1. Both containers share the /tmp directory
  2. The Weston container is fully started before launching Flutter
  3. Your Flutter application is configured to use the Wayland backend

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hey @sahilbluai ,

Can you share the Terminal logs from VSCode when you try and run the flutter application on the module?

-Eric

Hi Eric,

Thank you for your response.

Below are the requested VS Code terminal logs and a summary of what we have tested so far.

System Information

Module: Verdin iMX8MP

Carrier: Mallow

OS: TorizonCore 6.8.0-devel-202409+build.26 (kirkstone)

What Happens When Running Debug Container

From VS Code, the Flutter build completes successfully:

“Building an eLinux application with wayland backend in debug mode for arm64 target…”

After that, the Docker compose build is triggered. The container builds and starts without explicit runtime errors.

Observed Behavior on Target:

  • Weston container starts successfully (healthy status)

  • HDMI screen shows grey Weston background and terminal (Vivante container running)

  • Flutter debug container appears running

  • No visible GUI output

  • No output in docker logs

  • In earlier attempts, Flutter crashed with SIGSEGV in:

    flutter::SurfaceBase::ResourceContextMakeCurrent()

What We Have Already Tested

  1. Wayland Socket Verification

    • Verified /run/user/1000/wayland-0 exists on host

    • Verified it is visible inside Flutter container

    • Confirmed:

      WAYLAND_DISPLAY=wayland-0

      XDG_RUNTIME_DIR=/run/user/1000

  2. GPU Device Access

    • Verified /dev/dri/card0, /dev/dri/renderD128

    • Verified /dev/galcore

    • Confirmed device_cgroup_rules for 199 and 226

    • Devices visible inside container

  3. Version Alignment

    Initially:

    • Flutter container base did not match Weston version

    • Caused EGL-related segmentation fault

    • Updated Weston to torizon/weston-vivante:4

    • Updated debug container base to torizon/wayland-base-imx8:4

    • Ensured linux/arm64 platform explicitly set in Dockerfile

torizon@verdin-imx8mp-15678836:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 22578c8e3fab localhost:5002/quiktest-debug:arm64 “/usr/sbin/sshd -D” 36 seconds ago Up 35 seconds torizon-quiktest-debug-1 9b8ae20aa40d torizon/weston-vivante:3 “/usr/bin/entry.sh -…” 11 minutes ago Up 11 minutes (healthy) torizon-weston-1 torizon@verdin-imx8mp-15678836:~$ docker logs 22578c8e3fab torizon@verdin-imx8mp-15678836:~$

Current Status

  • No more immediate build failures

  • Containers start successfully

  • HDMI still blank except Weston grey screen

  • Flutter GUI does not render

  • No crash logs

  • No visible error output

At this point, the container stack appears correct (Wayland + DRM + render node + matching container versions), but the Flutter GUI still does not display.

Any further guidance would be greatly appreciated.

Best regards,

Sahil

Hey Sahil,

Are you able to start a new flutter project and see if the default demo application works? I was just able to make it work on my imx8mp verdin (verdin dev + HDMI).

-Eric

Eric Singer
Toradex

Hey Sahil,

Are you able to start a new flutter project and see if the default demo application works? I was just able to make it work on my imx8mp verdin (verdin dev + HDMI).

Eric

Eric Singer
Toradex

Hey Sahil,

It looks like you are still on Torizon 6. The Flutter container template came after for Torizon 7. Is there a reason why you are on 6, are you able to update the OS to torizon OS 7?

Eric Singer
Toradex

1 Like

Thank you! The issue was successfully resolved after updating the OS from version 6 to version 7.

Regards

Sahil

Hey @sahilbluai ,

Fantastic, glad version updated was the solution. Let us know if you have any topics you would to discuss.

-Eric