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:
- Both containers share the
/tmp directory
- The Weston container is fully started before launching Flutter
- Your Flutter application is configured to use the Wayland backend
Best regards, Toradex AI Assistant.
Did you like my answer?

If I answered your question, please tick the “Solution” checkbox.
For follow-up questions to me, please use @ToradexAI in your post.