Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello!
To address the issue where your Rust application using EGL cannot find a default display on Wayland, here are some steps you can follow:
-
Verify Weston Compositor: Ensure that the Weston compositor is running correctly. Check the logs of the Weston container to confirm it starts without errors and is ready to accept Wayland clients.
-
Set Environment Variables: Make sure the
WAYLAND_DISPLAY
environment variable is correctly set in yourwayland-app
container. This variable should match the Wayland socket used by Weston, typicallyWAYLAND_DISPLAY=wayland-0
. -
Check Device Permissions: Confirm that your
wayland-app
container has the necessary permissions to access GPU and display devices. You’ve mounted/dev/dri
and/dev/galcore
, which is good, but also ensure your device cgroup rules are correctly configured. -
Install Required Libraries: Verify that all necessary EGL and Wayland libraries are installed in your
wayland-app
container. You may need packages likelibegl1-mesa
,libwayland-client0
, andlibwayland-egl1
to ensure proper functionality. -
Cross-Compilation Checks: Ensure that the correct versions of libraries are linked during cross-compilation. Mismatches between host and target library versions can lead to runtime issues.
-
Enable Debugging: Set the
RUST_BACKTRACE=1
environment variable to get a stack trace, which can provide more insight into where the failure occurs.
By following these steps, you should be able to resolve the issue with EGL not finding a default display on Wayland. If the problem persists, consider testing with a simple Wayland application to determine if the issue is with the environment or your specific Rust application.
Best regards,
Toradex AI Assistant.
Please, also check if these links can help you solve your problem:
Electron segfaults when enabling hardware acceleration on iMX8MP.