Weston on IMX8MP

Hi , can you help me to check whats the issue in weston on IMX8Mp

root@verdin-imx8mp-15460278:~# SYSTEMD_LOG_LEVEL=debug systemctl status weston
Bus n/a: changing state UNSET -> OPENING
sd-bus: starting bus by connecting to /run/systemd/private...
Bus n/a: changing state OPENING -> AUTHENTICATING
Successfully forked off '(pager)' as PID 1213.
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
sd_pid_get_owner_uid() failed, enabling pager secure mode: No data available
Pager executable is "less", options "FRSXMK", quit_on_interrupt: yes
Showing one /org/freedesktop/systemd1/unit/weston_2eservice
Bus n/a: changing state AUTHENTICATING -> RUNNING
Sent message type=method_call sender=n/a destination=org.freedesktop.systemd1 path=/org/freedesktop/systemd1/unit/weston_2eservice interface=org.freedesktop.DBu>
Got message type=method_return sender=org.freedesktop.systemd1 destination=n/a path=n/a interface=n/a member=n/a  cookie=1 reply_cookie=1 signature=a{sv} error->
Sent message type=method_call sender=n/a destination=org.freedesktop.systemd1 path=/org/freedesktop/systemd1/unit/weston_2esocket interface=org.freedesktop.DBus>
Got message type=method_return sender=org.freedesktop.systemd1 destination=n/a path=n/a interface=n/a member=n/a  cookie=2 reply_cookie=2 signature=v error-name>
Considering root directory '/run/log/journal'.
Root directory /run/log/journal added.
Considering directory '/run/log/journal/1e19f81dbfe74fd3a8249f57e465944f'.
Directory /run/log/journal/1e19f81dbfe74fd3a8249f57e465944f added.
Journal effective settings seal=no keyed_hash=yes compress=ZSTD compress_threshold_bytes=8B
File /run/log/journal/1e19f81dbfe74fd3a8249f57e465944f/system.journal added.
File /run/log/journal/1e19f81dbfe74fd3a8249f57e465944f/system@10c78808f5ad48dab26f19c2b138fa83-00000000000001fa-00064713da300030.journal added.
File /run/log/journal/1e19f81dbfe74fd3a8249f57e465944f/system@10c78808f5ad48dab26f19c2b138fa83-0000000000000001-00062b35f382c61e.journal added.
Considering root directory '/var/log/journal'.
Journal filter: (_BOOT_ID=13b5d26265d54a47af7962de55eafcec AND ((OBJECT_SYSTEMD_UNIT=weston.service AND _UID=0) OR (UNIT=weston.service AND _PID=1) OR (COREDUMP>
mmap cache statistics: 1724 category cache hit, 33 window list hit, 3 miss, 3 files, 3 windows, 0 unused
Directory /run/log/journal/1e19f81dbfe74fd3a8249f57e465944f removed.
Root directory /run/log/journal removed.
Warning: The unit file, source configuration file or drop-ins of weston.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Bus n/a: changing state RUNNING -> CLOSED
x weston.service - Weston, a Wayland compositor, as a system service
     Loaded: loaded (/usr/lib/systemd/system/weston.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2025-12-29 10:00:43 UTC; 4min 15s ago
TriggeredBy: * weston.socket
       Docs: man:weston(1)
             man:weston.ini(5)
             http://wayland.freedesktop.org/
    Process: 1176 ExecStartPre=/usr/bin/udevadm wait --timeout=30 /dev/dri/card1 (code=exited, status=0/SUCCESS)
    Process: 1179 ExecStartPre=/usr/bin/sh -c ls /dev/dri/by-path/*gpu* &> /dev/null && /usr/bin/udevadm wait --timeout=30 /dev/dri/card1 (code=exited, status=0>
    Process: 1184 ExecStart=/usr/bin/weston --modules=systemd-notify.so (code=exited, status=1/FAILURE)
   Main PID: 1184 (code=exited, status=1/FAILURE)
        CPU: 181ms

Dec 29 10:00:34 verdin-imx8mp-15460278 systemd[1]: Starting Weston, a Wayland compositor, as a system service...
Dec 29 10:00:43 verdin-imx8mp-15460278 systemd[1]: weston.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 10:00:43 verdin-imx8mp-15460278 systemd[1]: weston.service: Failed with result 'exit-code'.
Dec 29 10:00:43 verdin-imx8mp-15460278 systemd[1]: Failed to start Weston, a Wayland compositor, as a system service.

Hi, I’m the Toradex AI Assistant.

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


I’d be glad to help troubleshoot your Weston issue! To provide the most accurate guidance, could you let me know which OS and version you’re running on your Verdin iMX8MP? You can use the tdx-info command to get this information - more details at tdx-info.

Initial Troubleshooting Steps

Based on the systemd logs, Weston is failing to start with exit code 1. Here are some diagnostic steps:

1. Check Weston Logs

First, let’s get more detailed error information:

journalctl -u weston.service -f

2. Reload Systemd Configuration

The warning message indicates unit files have changed:

systemctl daemon-reload

3. Manual Weston Start

Try starting Weston manually to see specific error messages:

weston --modules=systemd-notify.so

4. Check Display Hardware

Verify your display hardware is properly detected:

ls -la /dev/dri/
cat /sys/class/drm/card*/status

Platform-Specific Considerations

For Torizon OS with iMX8, the typical Weston container approach would be(1):

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

However, since you’re running Weston as a system service, this suggests you might be using a Yocto-based BSP rather than Torizon OS.

Please share your OS version and the output from the manual Weston start so I can provide more targeted assistance.

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.

@ToradexAI I am on mainline kernel 6.17

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.17.0-00001-g1864bd4099fe-dirty #50 SMP PREEMPT Mon Dec 29 13:33:49 IST 2025
Kernel command line:      root=PARTUUID=4c9bdd04-02 ro rootwait console=tty1 console=ttymxc2,115200
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=7.2.0-devel-20250312062116-build.0
Distro variant:           -
Hostname:                 verdin-imx8mp-15460278
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus on Verdin Development Board
Toradex version:          0063 V1.1B
Serial number:            15460278
Processor arch:           aarch64
------------------------------------------------------------

Weston Issue on Verdin iMX8MP with Mainline Kernel

Based on your setup with TDX Wayland with XWayland 7.2.0-devel and mainline kernel 6.17, you’re running a Yocto-based BSP rather than Torizon OS. This is important because the troubleshooting approach differs.

Understanding Your Kernel Setup

Your system is using a mainline/upstream Linux kernel(1). Starting with BSP 6.0, Toradex provides mainline kernel support for better upstream compatibility(2).

Troubleshooting Steps

1. Get Detailed Weston Error Logs

Run Weston manually to see the specific error messages:

weston --modules=systemd-notify.so

2. Check Display Hardware Detection

Verify your display hardware is properly detected:

ls -la /dev/dri/
cat /sys/class/drm/card*/status

3. Check GPU and Display Configuration

Since you’re on iMX8MP, verify the GPU and display drivers are loaded:

lsmod | grep -E "(drm|gpu|imx)"
dmesg | grep -E "(drm|gpu|display)"

4. Verify Weston Configuration

Check your Weston configuration:

cat /etc/xdg/weston/weston.ini

Common Issues with Mainline Kernel

With mainline kernels on iMX8MP, display driver initialization can sometimes fail due to:

  • Missing or incorrect device tree configuration
  • GPU driver loading issues
  • Display connector detection problems

Next Steps

Please run the manual Weston command and share the error output. This will help identify whether the issue is related to:

  • EGL/GPU initialization
  • Display output detection
  • Configuration problems
  • Driver compatibility

The specific error messages will guide us to the appropriate solution for your mainline kernel setup.

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.

@ToradexAI

root@verdin-imx8mp-15460278:~# weston --modules=systemd-notify.so
Date: 2025-12-29 UTC
[10:17:48.900] weston 12.0.4
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 10.0.0-1230-gde7f8df4+
[10:17:48.900] Command line: weston --modules=systemd-notify.so
[10:17:48.900] OS: Linux, 6.17.0-00001-g1864bd4099fe-dirty, #50 SMP PREEMPT Mon Dec 29 13:33:49 IST 2025, aarch64
[10:17:48.900] Flight recorder: enabled
[10:17:48.900] fatal: environment variable XDG_RUNTIME_DIR is not set.
Refer to your distribution on how to get it, or
http://www.freedesktop.org/wiki/Specifications/basedir-spec
on how to implement it.
root@verdin-imx8mp-15460278:~# 
root@verdin-imx8mp-15460278:~# 
root@verdin-imx8mp-15460278:~# ls -la /dev/dri/
total 0
drwxr-xr-x  3 root root        120 Dec 29 09:39 .
drwxr-xr-x 17 root root       4780 Dec 29 09:28 ..
drwxr-xr-x  2 root root        100 Dec 29 09:29 by-path
crw-rw----  1 root video  226,   0 Dec 29 09:28 card0
crw-rw----  1 root video  226,   1 Dec 29 09:28 card1
crw-rw-rw-  1 root render 226, 128 Dec 29 09:28 renderD128
root@verdin-imx8mp-15460278:~# cat /sys/class/drm/card*/status
connected
root@verdin-imx8mp-15460278:~# 
root@verdin-imx8mp-15460278:~# cat /etc/xdg/weston/weston.ini
[core]
#use-g2d=true
#repaint-window=16
idle-time=0
xwayland=true
#enable-overlay-view=1

[shell]

[libinput]
enable_tap=true
touchscreen_calibrator=true
calibration_helper=/usr/bin/toradex-save-touchscreen-calibration

[output]
card=/dev/dri/card0
name=HDMI-A-1
mode=800x480@30
#transform=rotate-90

#[output]
#name=HDMI-A-2
#mode=off
#	WIDTHxHEIGHT    Resolution size width and height in pixels
#	off             Disables the output
#	preferred       Uses the preferred mode
#	current         Uses the current crt controller mode
#transform=rotate-90

[screen-share]
command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
start-on-startup=true

Solution: XDG_RUNTIME_DIR Environment Variable Issue

The error is clear - Weston is failing because the XDG_RUNTIME_DIR environment variable is not set(1). This is a common issue when running Weston as a system service or manually.

Fix the Issue

Set the environment variable before starting Weston:

export XDG_RUNTIME_DIR=/run/user/$(id -u)
mkdir -p $XDG_RUNTIME_DIR
chmod 0700 $XDG_RUNTIME_DIR
weston --modules=systemd-notify.so

(1)

For Systemd Service Configuration

For your Yocto-based BSP system, you need to ensure the Weston service has the proper environment. The systemd service should set up the runtime directory(1).

Create or modify the Weston service to include the environment setup. Based on the Toradex documentation for Wayland applications, the service needs this environment configuration(1):

#!/bin/sh
if test -z "$XDG_RUNTIME_DIR"; then
    export XDG_RUNTIME_DIR=/run/user/`id -u`
    if ! test -d "$XDG_RUNTIME_DIR"; then
        mkdir --parents $XDG_RUNTIME_DIR
        chmod 0700 $XDG_RUNTIME_DIR
    fi
fi

# wait for weston
while [ ! -e  $XDG_RUNTIME_DIR/wayland-0 ] ; do sleep 0.1; done
sleep 1

export DISPLAY=:0.0

/path/to/the/application &

(1)

Hardware Status Verification

Your hardware detection looks good:

  • DRI devices are present (/dev/dri/card0, /dev/dri/card1)
  • Display is connected (status shows “connected”)
  • Your Weston configuration appears correct for HDMI output

Next Steps

  1. Reload systemd configuration as suggested earlier:

    systemctl daemon-reload
    
  2. Test manual start with the environment variable set

  3. Update the systemd service to properly set XDG_RUNTIME_DIR for the Weston service

The core issue is the missing runtime directory setup, which is essential for Weston to create its Wayland socket and operate properly(1).

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.

@ToradexAI is it like using latest kernel 6.17 g2d-renderer.so is not loading . I tried in kernel 6.6 weston is working fine and can see UI in display.

Kernel 6.17 vs 6.6 Graphics Driver Compatibility Issue

You’ve identified a critical compatibility issue. The problem you’re experiencing with kernel 6.17 not loading g2d-renderer.so while kernel 6.6 works fine is related to graphics driver compatibility between different kernel versions.

Understanding the Issue

When building kernels from source for some System on Modules (SoMs), the graphical driver deployed can be different from the one built using the Toradex Linux BSP(1). This can cause issues with graphical functionality, and your Verdin iMX8MP is specifically mentioned as an affected SoM(1).

Kernel Version Compatibility

Your observation aligns with Toradex’s upstream strategy. Starting with BSP 6.0, Toradex moved to mainline/upstream Linux kernels when possible(2). However, for iMX 8M Plus based modules, they use an NXP downstream-based kernel even for versions 6.0 and later of the BSP(2).

Graphics Driver Considerations

The issue you’re seeing with g2d-renderer.so not loading in kernel 6.17 is likely because:

  1. Driver Compatibility: The graphics drivers (particularly the Vivante GPU drivers) may not be fully compatible with the newer mainline kernel 6.17
  2. Missing Components: The g2d renderer relies on specific GPU drivers that may not be properly integrated in the mainline kernel build

Recommended Solutions

1. Use Supported Kernel Versions

For consistent graphical behavior on your Verdin iMX8MP, Toradex recommends building the kernel with the Yocto Project using their BSP(1). This ensures proper graphics driver integration.

2. Check Release Matrix

Verify the supported kernel versions in the Embedded Linux Release Matrix to see which kernel versions are officially supported for your BSP version(1).

3. Consider Downstream Kernel

For iMX 8M Plus modules, consider using the NXP downstream-based kernel which typically has better graphics driver support(2).

Next Steps

  1. Verify your BSP version and check which kernel versions are officially supported
  2. Consider downgrading to kernel 6.6 if graphics functionality is critical
  3. Build using Yocto Project with Toradex BSP layers for consistent graphics driver deployment

The graphics driver compatibility issue you’ve identified is a known consideration when using newer mainline kernels with Toradex modules that require specific GPU drivers.

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.

Hi @elgin!

Sorry for the delayed answer.

Were you able to solve the issue? Which kernel version are you using?

Best regards.