docs/torizon.md
Toradex provides Torizon OS a Linux based platform for its embedded devices that packages applications in docker containers.
We provide our demos compiled for Toradex as docker containers with GPU acceleration support.
Note: The Slint demos run directly on the linux/kms and do not require a Weston container.
Our pre-compiled demos are available in multiple variants optimized for different hardware platforms:
torizon-demos-arm64) - Uses software renderingtorizon-demos-arm64-imx8) - Optimized for i.MX8 series with GPU accelerationtorizon-demos-arm64-am62) - Optimized for AM62 series with GPU accelerationtorizon-demos-arm64-imx95) - Optimized for i.MX95 series with GPU accelerationA complete list of all containers can be found at
https://github.com/orgs/slint-ui/packages?q=torizon&tab=packages&q=torizon
Deply the following docker-compose.yaml to launch the home-automation demo.
Note:
Change the image to match your hardware platform:
| Platform | Image |
|---|---|
| ARM64 no GPU | ghcr.io/slint-ui/slint/torizon-demos-arm64:latest |
| i.MX8 w/ GPU | ghcr.io/slint-ui/slint/torizon-demos-arm64-imx9:latest |
| AM62 w/ GPU | ghcr.io/slint-ui/slint/torizon-demos-am62:latest |
| i.MX95 W/ GPU | ghcr.io/slint-ui/slint/torizon-demos-imx95:latest |
services:
slint-demo:
image: ghcr.io/slint-ui/slint/torizon-demos-arm64:latest
restart: unless-stopped
environment:
- ACCEPT_FSL_EULA=1
user: torizon
privileged: true
volumes:
- type: bind
source: /tmp
target: /tmp
- type: bind
source: /dev
target: /dev
- type: bind
source: /run/udev
target: /run/udev
device_cgroup_rules:
# ... for tty
- "c 4:* rmw"
# ... for /dev/input devices
- "c 13:* rmw"
- "c 199:* rmw"
# ... for /dev/dri devices
- "c 226:* rmw"
For i.MX8 series boards:
sudo docker run --rm --privileged \
--user=torizon \
-v /dev:/dev \
-v /tmp:/tmp \
-v /run/udev:/run/udev \
--device-cgroup-rule='c 199:* rmw' \
--device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 4:* rmw' \
ghcr.io/slint-ui/slint/torizon-demos-arm64-imx8
For AM62 series boards with GPU:
sudo docker run --rm --privileged \
--user=torizon \
-v /dev:/dev \
-v /tmp:/tmp \
-v /run/udev:/run/udev \
--device-cgroup-rule='c 199:* rmw' \
--device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 4:* rmw' \
ghcr.io/slint-ui/slint/torizon-demos-arm64-am62
For generic ARM64 devices without GPU acceleration:
sudo docker run --rm --privileged \
--user=torizon \
-v /dev:/dev \
-v /tmp:/tmp \
-v /run/udev:/run/udev \
--device-cgroup-rule='c 199:* rmw' \
--device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 4:* rmw' \
ghcr.io/slint-ui/slint/torizon-demos-arm64
By default, the energy-monitor demo is run. The containers package multiple demo applications:
Run a specific demo by specifying it as a parameter:
# Printer demo on i.MX8 with GPU acceleration
sudo docker run --rm --privileged --user=torizon \
-v /dev:/dev -v /tmp:/tmp -v /run/udev:/run/udev \
--device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 4:* rmw' \
ghcr.io/slint-ui/slint/torizon-demos-arm64-imx8 printerdemo
# Todo demo on AM62 without GPU acceleration
sudo docker run --rm --privileged --user=torizon \
-v /dev:/dev -v /tmp:/tmp -v /run/udev:/run/udev \
--device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 4:* rmw' \
ghcr.io/slint-ui/slint/torizon-demos-arm64 todo
Torizon OS supports automatically starting containers on boot by placing a docker-compose.yml file in /var/sota/storage/docker-compose/ on the device.
How to Autorun an Application With Torizon OS
Step 1: Create docker-compose.yml
Create a file named docker-compose.yml with the following content (adjust the image variant for your platform):
services:
slint-demo:
image: ghcr.io/slint-ui/slint/torizon-demos-arm64-imx8:latest
restart: unless-stopped
environment:
- ACCEPT_FSL_EULA=1
- SLINT_FULLSCREEN=1
- SLINT_BACKEND=linuxkms-skia-opengl
user: torizon
privileged: true
volumes:
- type: bind
source: /tmp
target: /tmp
- type: bind
source: /dev
target: /dev
- type: bind
source: /run/udev
target: /run/udev
device_cgroup_rules:
# ... for tty
- "c 4:* rmw"
# ... for /dev/input devices
- "c 13:* rmw"
- "c 199:* rmw"
# ... for /dev/dri devices
- "c 226:* rmw"
command: home-automation
Step 2: Deploy to Device
Copy the file to your Torizon device:
# Create the directory if it doesn't exist
ssh torizon@<device-ip> "sudo mkdir -p /var/sota/storage/docker-compose"
# Copy the docker-compose.yml file
scp docker-compose.yml torizon@<device-ip>:/tmp/
ssh torizon@<device-ip> "sudo mv /tmp/docker-compose.yml /var/sota/storage/docker-compose/"
# Reboot to start the application automatically
ssh torizon@<device-ip> "sudo reboot"
Platform-specific variants:
ghcr.io/slint-ui/slint/torizon-demos-arm64-imx8:latestghcr.io/slint-ui/slint/torizon-demos-arm64-am62:latestghcr.io/slint-ui/slint/torizon-demos-arm64-imx95:latestghcr.io/slint-ui/slint/torizon-demos-arm64:latestThe demo will automatically start on boot and restart if it crashes. To stop auto-running, remove the file:
ssh torizon@<device-ip> "sudo rm /var/sota/storage/docker-compose/docker-compose.yml && sudo reboot"