Black screen after booting sometimes in the Apalis imx8 board

Hi,

I have an Apalis baord iMX8QM 8GB, with ixora carrier board, and 8 inch lcd (1024x768) / hdmi. My os is: “TorizonCore 6.2.0+build.2 (kirkstone)”, I built my application with Qt/QML.

In about 10% of boot cases, I get a black screen as if the screen isn’t working, but my app is working because I see Can bus packets appearing. The screen will only work if I disconnect and reconnect the HDMI cable, or restart the board.

I tried changing the HDMI cable, and I tried changing the screen, but the result was the same.

How can I solve this problem, please?

Note that the system will be on a car and the car cannot be turned off and restarted when this problem occurs.

Best regards,

Tarek

Hi, I’m the Toradex AI Assistant.

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


Based on your description, this intermittent black screen issue on your Apalis iMX8QM with Ixora carrier board appears to be related to a known HDMI initialization problem that can occur with certain displays and HDMI configurations.

Troubleshooting Steps

1. Verify HDMI Configuration

The Apalis iMX8 supports HDMI output natively (1). Ensure you’re using the correct device tree overlay for HDMI:

For Apalis iMX8 QuadMax, you should use the apalis-imx8_hdmi_overlay.dtbo overlay (1).

2. Check Weston Container Configuration

Since you’re running TorizonCore 6.2.0, there’s a known issue with Weston and HDMI displays that can cause intermittent black screens (2). Try running the Weston container with the atomic mode disabled:

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" \
    -e WESTON_DISABLE_ATOMIC=1 torizon/weston-imx8:4 \
    --developer

(2)

3. HDMI Hot Plug Detection

The Apalis iMX8 includes HDMI Hot Plug Detect (HPD) functionality (3). The intermittent black screen could be related to HPD signal issues. The HPD signal is available on pin 232 (HDMI1_HPD) (3).

4. Display Resolution and Timing

Ensure your 8-inch LCD (1024x768) is properly supported. The default HDMI overlay provides 1920x1080 resolution (1). You may need to create a custom device tree overlay with the correct timing parameters for your specific display.

5. Power Management

Since this occurs in automotive applications, consider that power fluctuations during startup might affect HDMI initialization. The issue happening in ~10% of boots suggests a timing-related problem during the display subsystem initialization.

Recommended Solution

  1. Update to newer TorizonCore version: Consider upgrading to TorizonCore 6.5+ or Torizon OS 7.x, which have improved HDMI stability (2)

  2. Implement the Weston workaround: Use the WESTON_DISABLE_ATOMIC=1 environment variable as shown above (2)

  3. Create a systemd service: Set up automatic container restart with the corrected Weston configuration to ensure consistent behavior on boot (2)

  4. Monitor HDMI status: You can add monitoring scripts to detect when HDMI output fails and automatically restart the display subsystem

The workaround with WESTON_DISABLE_ATOMIC=1 has been confirmed to resolve similar intermittent HDMI black screen issues on Torizon OS (2).

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 ,

Applying this flag:

WESTON_DISABLE_ATOMIC=1

Solved my black screen issue. I also added this rule: c 10:223 rmw which wasn’t previously in my Weston container, perhaps related to the solution.

Thanks a lot
Tarek

Excellent! I’m glad the WESTON_DISABLE_ATOMIC=1 flag resolved your black screen issue with the Apalis iMX8.

Understanding the Solution

The WESTON_DISABLE_ATOMIC=1 environment variable disables atomic mode setting in the DRM (Direct Rendering Manager) subsystem (1). This is particularly helpful for resolving intermittent HDMI display initialization issues on i.MX 8 series modules (1).

The device cgroup rule c 10:223 rmw that you added provides access to the uinput device, which can be important for proper input handling in containerized environments (1).

Complete Working Configuration

For reference, here’s the complete Weston container command that’s now working for your setup:

docker run -e ACCEPT_FSL_EULA=1 -d --rm --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 13:* rmw' \
    --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
    --device-cgroup-rule='c 10:223 rmw' \
    -e WESTON_DISABLE_ATOMIC=1 \
    torizon/weston-vivante:$CT_TAG_WESTON_VIVANTE --developer \
    --tty=/dev/tty7

(1)

This solution should provide reliable HDMI output for your automotive application, eliminating the need for manual cable reconnection or system restarts when the display initialization issue occurs.

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.

1 Like

@ToradexAI ,

After applying the solution that you suggested (WESTON_DISABLE_ATOMIC=1), I restarted the board about 25 times and the black screen did not appear. However, two days later, during one of the attempts to start the Apalis board, the problem reappeared.

I updated the system to: “TorizonCore 6.5.0+build.8 (kirkstone)”, but the black screen appeared also after some reboot tries.

So, do you have any other solutions?
Is there a reliable way to detect the black screen programmatically and restart the board?

Best regards,
Tarek

Unfortunately, the WESTON_DISABLE_ATOMIC=1 workaround is not a complete fix and this intermittent HDMI issue can still occur occasionally (1). Since you’re experiencing this in an automotive environment where reliability is critical, here are additional solutions:

Alternative Weston Configuration

There’s a more robust workaround that involves modifying the Weston container’s entry script. Instead of just disabling atomic mode, you can remove the --current-mode parameter from the Weston startup script (1). This approach is considered technically superior to the atomic disable workaround (1).

Programmatic Black Screen Detection

You can implement automatic detection and recovery using these methods:

1. Monitor DRM Output Status

Check the display connection status programmatically:

find /sys/devices -name "edid"

(2)

If no EDID is found, the display is not properly initialized.

2. Monitor Weston Container Health

Set up a monitoring script that checks if Weston is running and responding:

docker logs weston

(3)

Look for DRM disconnect/reconnect messages in the logs, which indicate HDMI state changes (4).

3. Framebuffer Content Detection

Monitor the framebuffer device to detect if it’s actually outputting content or remains black.

Automatic Recovery Implementation

Container Restart Strategy

Instead of rebooting the entire system, implement automatic Weston container restart:

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" \
    -e WESTON_DISABLE_ATOMIC=1 torizon/weston-imx8:4 \
    --developer

(1)

Systemd Watchdog Service

Create a systemd service that monitors display output and automatically restarts the graphics stack when a black screen is detected.

Hardware Considerations

Since this is an automotive application, consider that vibrations and power fluctuations can cause false HDMI disconnect/reconnect events (4). The Apalis iMX8 supports DisplayPort as an alternative to HDMI, which might be more stable for automotive environments (5).

Long-term Solution

For production automotive systems, consider:

  1. Upgrade to Torizon OS 7.x: Newer versions have improved HDMI stability
  2. Use alternative display interfaces: Consider DSI or parallel RGB if your display supports them
  3. Hardware-level monitoring: Implement watchdog circuits that can detect display failures

The automatic container restart approach is typically more reliable than full system reboot and much faster for automotive applications where downtime must be minimized.

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.

my_container_logs.txt (4.6 KB)
weston_log.txt (10.2 KB)

@ToradexAI

At a black screen situation, I tried:
find /sys/devices -name "edid" it gave:
/sys/devices/platform/display-subsystem/drm/card1/card1-HDMI-A-1/edid

Also there are no DRM disconnect/reconnect messages at weston logs

Also I tried:
cat /sys/class/drm/*HDMI*/status it gave:
connected

The logs for weston container and my application container for last boot with black screen are attached.

There are many warnings like this: Warning: Could not create display context: Failed to create a OpenGL context: EGL_BAD_MATCH at my application logs, however, these warnings do not usually affect the screen’s operation, and the screen continues to function despite them.

How to monitor the framebuffer device to detect if it’s actually outputting content or remains black?
Are there any other indicators that point to the appearance of a black screen?

Best regards,
Tarek

Good analysis! Your testing confirms that the HDMI connection is physically detected correctly (EDID present and status “connected”), but the display pipeline isn’t working properly. This suggests the issue is deeper in the graphics stack.

Framebuffer Content Monitoring

To monitor if the framebuffer is actually outputting content, you can use these methods:

1. DRM/KMS Status Check

Use the modetest utility to check the actual display pipeline status (1):

apt update && apt install libdrm-tests
modetest -M imx-drm

(1)

This will show you the current mode, whether the CRTC (display controller) is active, and if there are any connected planes.

2. Check Active Display Mode

Verify if Weston has actually set a display mode:

modetest -M imx-drm -c

(1)

Look for the HDMI connector and check if it shows an active mode or if it’s in a disconnected state despite the physical connection.

3. Monitor Weston’s DRM Backend

Check if Weston’s DRM backend is functioning properly by examining the compositor state:

docker exec weston weston-info

(2)

This should show active outputs and their current modes.

Additional Diagnostic Indicators

4. Check GPU/Display Controller Status

Since you’re seeing OpenGL context creation failures, check the GPU status:

cat /sys/kernel/debug/dri/1/clients
cat /sys/kernel/debug/dri/1/gem_names

5. Monitor Display Controller Registers

For the i.MX8, you can check if the display controller is actually outputting:

cat /sys/kernel/debug/clk/clk_summary | grep -i display

This shows if the display clocks are running.

Automated Detection Script

Based on your findings, here’s a detection approach that combines multiple indicators:

#!/bin/bash
# Check if display pipeline is working
EDID_EXISTS=$(find /sys/devices -name "edid" | wc -l)
HDMI_CONNECTED=$(cat /sys/class/drm/*HDMI*/status)
WESTON_RUNNING=$(docker ps --filter "name=weston" --filter "status=running" -q)

# Check if modetest shows active display
ACTIVE_MODE=$(modetest -M imx-drm -c 2>/dev/null | grep -c "HDMI.*connected.*[0-9]x[0-9]")

if [ "$EDID_EXISTS" -gt 0 ] && [ "$HDMI_CONNECTED" = "connected" ] && [ -n "$WESTON_RUNNING" ] && [ "$ACTIVE_MODE" -eq 0 ]; then
    echo "Black screen detected - restarting Weston"
    docker restart weston
fi

Root Cause Analysis

From your logs and the fact that EDID is present but no display output occurs, this appears to be a timing issue in the display pipeline initialization (3). The OpenGL context warnings you mentioned are likely symptoms, not the cause.

Alternative Solutions

1. Force Mode Setting

Try explicitly setting the display mode in your Weston configuration:

[output]
name=HDMI-A-1
mode=1024x768@60

(2)

2. Use Software Rendering

As a fallback, you can force software rendering to bypass GPU issues:

docker run ... -e WESTON_DISABLE_ATOMIC=1 -e WESTON_USE_PIXMAN=1 ...

(2)

3. Delayed Weston Startup

Add a delay before starting Weston to ensure the display subsystem is fully initialized:

sleep 5 && docker run ...

The most reliable detection method for your case would be checking if modetest shows an active display mode, as this directly indicates whether the display pipeline is functioning regardless of physical connection status.

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 ,

1- I installed libdrm-tests at my container, and I run: modetest -M imx-drm at black screen state and normal boot state, both was identical.

2- Also the results for: modetest -M imx-drm -c was identical in both cases.

3- I attached the weston-info results at black screen state:
weston-info results.txt (10.5 KB)

4- cat /sys/kernel/debug/dri/1/clients at black screen state gave:
command pid dev master a uid magic seatd 1231 1 y y 0 0 dizaynVIPVanSys 1339 129 n n 1000 0

and cat /sys/kernel/debug/dri/1/gem_names gave at black screen state:
name size handles refcount

For alternative solutions, how to force Mode setting for weston at docker-compose.yml file (I don’t want developer mode for weston)?
and I can’t use software rendering because I have video player and live TVs streaming online. also how to add sleep 5 to weston in docker-compose.yml file?

This is my weston container can you check it and modify it:

This my weston container at docker-compose.yml file:

weston:
image: torizon/weston${GPU}:3 #commontorizon/weston${GPU}:3.3.2 torizon/weston${GPU}:4
environment:
- ACCEPT_FSL_EULA=1
- WESTON_DISABLE_ATOMIC=1
# - ENABLE_RDP=1 # Remote desktop, not needed for local display, and causes issues with hdmi display on imx8mp, sometimes gives black screen on imx8mm, so disabled for now
# 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 tty
- “c 4:* rmw”
# … for /dev/input devices
- “c 13:* rmw”
# … for /dev/galcore
- “c 199:* rmw”
# … for /dev/dri devices
- “c 226:* rmw”
# … for /dev/dma_heap device
- “c 253:* rmw”
- “c 10:223 rmw”
restart: always
command: > #–developer
–tty=/dev/tty7
tty: true

Best regards,
Tarek

The identical modetest results and the fact that weston-info shows proper output configuration indicates that the Weston compositor is working correctly at the protocol level, but there’s likely an issue with the actual display pipeline or GPU rendering (1).

Modified Docker Compose Configuration

Here’s your updated docker-compose.yml with the requested modifications:

weston:
  image: torizon/weston${GPU}:3
  environment:
    - ACCEPT_FSL_EULA=1
    - WESTON_DISABLE_ATOMIC=1
  network_mode: host
  volumes:
    - type: bind
      source: /tmp
      target: /tmp
    - type: bind
      source: /dev
      target: /dev
    - type: bind
      source: /run/udev
      target: /run/udev
    - type: bind
      source: ./weston.ini
      target: /etc/xdg/weston/weston.ini
  cap_add:
    - CAP_SYS_TTY_CONFIG
  device_cgroup_rules:
    - "c 4:* rmw"
    - "c 13:* rmw" 
    - "c 199:* rmw"
    - "c 226:* rmw"
    - "c 253:* rmw"
    - "c 10:223 rmw"
  restart: always
  command: >
    sh -c "sleep 5 && weston --tty=/dev/tty7"
  tty: true

(1)

Weston Configuration File

Create a weston.ini file in the same directory as your docker-compose.yml with forced mode setting (1):

[core]
shell=desktop-shell.so

[output]
name=HDMI-A-1
mode=1024x768@60
transform=normal

[shell]
locking=false

(1)

Key Changes Made

  1. Force Mode Setting: Added a bind mount for a custom weston.ini file that explicitly sets the HDMI output mode to 1024x768@60Hz (1)
  2. Startup Delay: Modified the command to include sleep 5 before starting Weston (1)
  3. Custom Configuration: The bind mount for weston.ini overrides the default configuration without requiring developer mode (1)

Alternative Diagnostic Approach

Since the standard diagnostics show identical results, the issue might be in the GPU rendering pipeline. Try checking if the framebuffer is actually receiving data:

# Check if there's any framebuffer activity
cat /sys/class/graphics/fb0/virtual_size

(2)

Additional Environment Variables

You can also try adding these environment variables to potentially resolve GPU context issues:

environment:
  - ACCEPT_FSL_EULA=1
  - WESTON_DISABLE_ATOMIC=1
  - WESTON_USE_G2D=0
  - EGL_PLATFORM=drm

(1)

The startup delay combined with explicit mode setting should help ensure the display pipeline is fully initialized before Weston attempts to configure the output. The custom weston.ini file forces a specific resolution and refresh rate, which can help avoid timing-related initialization issues (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 ,

I applied all the steps, but I got this error:

Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/dizaynvip/dizaynVIPVanSystem/weston.ini" to rootfs at "/etc/xdg/weston/weston.ini": mount /home/dizaynvip/dizaynVIPVanSystem/weston.ini:/etc/xdg/weston/weston.ini (via /proc/self/fd/7), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type, I’m sure that weston.ini file is at same folder of docker-compose.yml

Best regards,
Tarek

The error indicates that Docker is trying to mount a file onto a directory. This happens when the target path in the container expects a file but the source doesn’t exist as a file (1).

Solution: Fix the Bind Mount Configuration

The issue is with the bind mount syntax. Here’s the corrected docker-compose.yml configuration:

weston:
  image: torizon/weston${GPU}:3
  environment:
    - ACCEPT_FSL_EULA=1
    - WESTON_DISABLE_ATOMIC=1
  network_mode: host
  volumes:
    - type: bind
      source: /tmp
      target: /tmp
    - type: bind
      source: /dev
      target: /dev
    - type: bind
      source: /run/udev
      target: /run/udev
    - type: bind
      source: ./
      target: /etc/xdg/weston/
  cap_add:
    - CAP_SYS_TTY_CONFIG
  device_cgroup_rules:
    - "c 4:* rmw"
    - "c 13:* rmw" 
    - "c 199:* rmw"
    - "c 226:* rmw"
    - "c 253:* rmw"
    - "c 10:223 rmw"
  restart: always
  command: >
    sh -c "sleep 5 && weston --tty=/dev/tty7"
  tty: true

(1)

Alternative Approach: Use Directory Mount

Instead of mounting the file directly, mount the directory containing the weston.ini file. This approach is more reliable for configuration files (1).

The corrected bind mount maps your local directory (containing weston.ini) to /etc/xdg/weston/ in the container, which will overwrite the existing configuration (1).

Verify Your File Structure

Make sure your directory structure looks like this:

your-project-folder/
├── docker-compose.yml
└── weston.ini

Create the weston.ini File

Ensure your weston.ini file contains:

[core]
shell=desktop-shell.so

[output]
name=HDMI-A-1
mode=1024x768@60
transform=normal

[shell]
locking=false

(1)

This configuration will force the HDMI output to use your specific resolution and should help resolve the black screen timing issues you’ve been experiencing.

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 applied the change in binding, but now weston container didn’t startup and gave this error many times in logs:

/usr/bin/entry.sh: invalid option -- 'c'

Best regards,
Tarek

The error indicates that the command syntax is incorrect. The issue is with the YAML formatting of the command field in your docker-compose.yml (1).

Fix the Command Syntax

Here’s the corrected docker-compose.yml configuration:

weston:
  image: torizon/weston${GPU}:3
  environment:
    - ACCEPT_FSL_EULA=1
    - WESTON_DISABLE_ATOMIC=1
  network_mode: host
  volumes:
    - type: bind
      source: /tmp
      target: /tmp
    - type: bind
      source: /dev
      target: /dev
    - type: bind
      source: /run/udev
      target: /run/udev
    - type: bind
      source: ./
      target: /etc/xdg/weston/
  cap_add:
    - CAP_SYS_TTY_CONFIG
  device_cgroup_rules:
    - "c 4:* rmw"
    - "c 13:* rmw" 
    - "c 199:* rmw"
    - "c 226:* rmw"
    - "c 253:* rmw"
    - "c 10:223 rmw"
  restart: always
  command: ["sh", "-c", "sleep 5 && weston --tty=/dev/tty7"]
  tty: true

(1)

Alternative Approach Without Sleep

If the command syntax continues to cause issues, you can remove the sleep and just use the standard Weston startup:

weston:
  image: torizon/weston${GPU}:3
  environment:
    - ACCEPT_FSL_EULA=1
    - WESTON_DISABLE_ATOMIC=1
  network_mode: host
  volumes:
    - type: bind
      source: /tmp
      target: /tmp
    - type: bind
      source: /dev
      target: /dev
    - type: bind
      source: /run/udev
      target: /run/udev
    - type: bind
      source: ./
      target: /etc/xdg/weston/
  cap_add:
    - CAP_SYS_TTY_CONFIG
  device_cgroup_rules:
    - "c 4:* rmw"
    - "c 13:* rmw" 
    - "c 199:* rmw"
    - "c 226:* rmw"
    - "c 253:* rmw"
    - "c 10:223 rmw"
  restart: always
  command: --tty=/dev/tty7
  tty: true

(1)

The key change is using the proper array syntax for the command field instead of the YAML multi-line string format. The array format ["sh", "-c", "sleep 5 && weston --tty=/dev/tty7"] is more reliable for complex commands (1).

Your custom weston.ini file should now be properly loaded, forcing the specific display mode and potentially resolving the black screen timing issues.

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 ,

Applying ["sh", "-c", "sleep 5 && weston --tty=/dev/tty7"] makes weston container fail, also modifying weston.ini via binding to a weston.ini file on my system failed.

Now I only applied these 2 flags: - WESTON_USE_G2D=0 - EGL_PLATFORM=drm and it seems that the results are better, I got black screen after 36 reboot tries, so it happens more rarely.

Best regards,
Tarek

Excellent! The additional environment variables WESTON_USE_G2D=0 and EGL_PLATFORM=drm are helping reduce the frequency of the black screen issue (1). This indicates the problem is related to GPU acceleration and EGL context creation (1).

Current Working Configuration

Your current configuration with these improvements is:

weston:
  image: torizon/weston${GPU}:3
  environment:
    - ACCEPT_FSL_EULA=1
    - WESTON_DISABLE_ATOMIC=1
    - WESTON_USE_G2D=0
    - EGL_PLATFORM=drm
  # ... rest of your configuration

(1)

Additional Optimization Options

Since you’re seeing significant improvement, try adding these additional environment variables to further stabilize the display:

environment:
  - ACCEPT_FSL_EULA=1
  - WESTON_DISABLE_ATOMIC=1
  - WESTON_USE_G2D=0
  - EGL_PLATFORM=drm
  - GALLIUM_DRIVER=etnaviv
  - MESA_LOADER_DRIVER_OVERRIDE=etnaviv

(1)

Monitoring and Recovery Strategy

Since the issue is now much rarer (1 in 36 boots), implement a simple monitoring approach:

1. Container Health Check

Add a health check to your docker-compose.yml (2):

weston:
  # ... your existing configuration
  healthcheck:
    test: ["CMD", "ps", "aux", "|", "grep", "weston"]
    interval: 30s
    timeout: 10s
    retries: 3

(2)

2. Automatic Recovery Script

Create a simple monitoring script that restarts only the Weston container when issues are detected (1):

#!/bin/bash
# Check if weston process is running but no display output
if docker ps --filter "name=weston" --filter "status=running" -q > /dev/null; then
    # If weston is running but display appears black, restart container
    docker restart weston
fi

(1)

Alternative Display Interface

For production automotive systems, consider using the native HDMI interface with the proper device tree overlay (3). The Apalis iMX8 QuadMax supports native HDMI output using the apalis-imx8_hdmi_overlay.dtbo overlay (3), which might be more stable than relying on GPU acceleration.

Long-term Recommendation

Since you’ve reduced the occurrence from ~10% to ~3% of boots, and this is for an automotive application, consider:

  1. Upgrade to Torizon OS 7.x: Newer versions have improved graphics stability (4)
  2. Container restart instead of system reboot: Much faster recovery time for automotive applications (4)
  3. Hardware watchdog: Implement a hardware-level display monitoring solution

The combination of WESTON_USE_G2D=0 and EGL_PLATFORM=drm is forcing software rendering and explicit EGL platform selection, which explains the improved stability (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.

Hi Tarek,

Thank you for testing the suggestions from ToradexAI and for sharing the results.

Based on your tests, this does not look like an HDMI connection issue. EDID is present, HDMI stays connected, and modetest shows the same result in both the working and black-screen cases. So the display pipeline appears to be configured correctly.

The more relevant clue is the EGL/OpenGL context error from the application side. That points to a graphics startup timing issue between Weston, the GPU/EGL stack, and the application.

Based on that, please keep the Weston options that improved the behavior:

environment:
  - ACCEPT_FSL_EULA=1
  - WESTON_DISABLE_ATOMIC=1
  - WESTON_USE_G2D=0
  - EGL_PLATFORM=drm

Then add a small startup delay to Weston. Since the Weston container already uses /usr/bin/entry.sh, the delay should run before that entry script, not through the normal command field. Otherwise, options like -c may be passed to entry.sh and cause the error you already saw.

The idea is:

sleep a few seconds
then start /usr/bin/entry.sh with --tty=/dev/tty7

I would also delay the application startup until Weston is actually ready. Do not rely only on Docker Compose depends_on, because it only means the Weston container has started. It does not mean Weston is ready to accept Wayland/EGL clients.

The application should start only after /tmp/wayland-0 exists, and preferably after a few extra seconds of delay.

This focuses on the part that is most likely failing: the graphics rendering startup path, instead of adding more HDMI or EDID checks.

Best Regards,

Hi Diego,

Thank you so much for your support.

After activating these two flags: - WESTON_USE_G2D=0 - EGL_PLATFORM=drm, the black screen appeared only rarely, but today I tested the video: I have MP4 video files, and I have live video stream TV channels, the video started to freeze, squirm, and in some cases a green screen appeared.

Therefore, I need GPU-based video acceleration.

Previously (About a year ago), I conducted many tests and adjustments with Mr. Bruno Mello (from Toradex technical support team) to effectively activate video acceleration on the Apalis imx8 board with minimal CPU usage. The changes were made to both files: docker-compose.yml and Dockerfile:

Dockerfile (20.4 KB)
docker-compose.yml (5.2 KB)

Could you please take a look at these two files?

Do you think these adjustments and changes are the reason for the black screen that sometimes appears?

Best regards,
Tarek

Hi Tarek,

Thank you for sharing the Dockerfile and docker-compose.ymlit helped a lot.

I noticed one important point: your Dockerfile no longer uses the recommended Qt6 Vivante base image. The original lines were:

FROM torizon/qt6-wayland${GPU}:${BASE_VERSION}

but they were replaced by:

FROM torizon/wayland-base-vivante:${BASE_VERSION}

This means Qt6, GStreamer, WebEngine, Vivante GPU libraries, and NXP multimedia plugins are being installed manually. This can work, but it increases the risk of version mismatches in the graphics/video stack, especially between Weston, EGL/GLES, G2D, GStreamer, QtMultimedia, QtWebEngine, and the Vivante driver.

This is relevant to your issue because disabling G2D reduced the black-screen frequency, but caused video freezing/green-screen problems. That points more to a graphics/video buffer-sharing issue than to an HDMI cable, EDID, or display-detection problem.

Please test the following:

  1. Revert both build and deploy stages to the Qt6 Vivante base image:

    FROM torizon/qt6-wayland${GPU}:${BASE_VERSION}
    

With GPU=-vivante, this becomes:

torizon/qt6-wayland-vivante:3

Add only the extra packages your application really needs.

  1. Keep this Weston option:
     WESTON_DISABLE_ATOMIC=1
  1. Do not use this as the final solution if you need accelerated video:

    WESTON_USE_G2D=0
    

It is useful for testing, but it may break or degrade the accelerated video path.

  1. Keep the Weston/app startup ordering fix: start the application only after the Wayland socket exists, plus a few extra seconds of delay.

For recovery in the car, I would avoid rebooting the whole board first. A better recovery action is to restart the display stack:

docker compose restart weston <your-application-container>

This forces Weston and the Qt app to recreate the DRM/Wayland/EGL path and is closer to what happens when reconnecting HDMI.

Also, I recommend this article on our documentation: Qt on Torizon OS

Best regards,