Can't run viewer in Docker container: "Could not find wayland compositor"
A user reported
After updating to 0.13, I now see the following error message. I'm running from a Docker container using Ubuntu 22.04 and also Ubuntu 22.04 on the host machine. Using
WINIT_UNIX_BACKEND=x11does not help.
$ RUST_LOG=debug rerun
[2024-02-13T03:54:40Z DEBUG rerun::run] Detected 20 cores. Using 18 compute threads.
[2024-02-13T03:54:40Z DEBUG re_memory::memory_limit] Setting memory limit to 46.9 GiB, which is 75% of total available memory (62.5 GiB).
[2024-02-13T03:54:40Z DEBUG re_sdk_comms::server] Hosting a SDK server over TCP at 0.0.0.0:9876. Connect with the Rerun logging SDK.
[2024-02-13T03:54:40Z DEBUG eframe] Using the wgpu renderer
Traceback (most recent call last):
File "/usr/local/bin/rerun", line 8, in <module>
sys.exit(main())
RuntimeError: winit EventLoopError: os error at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.9/src/platform_impl/linux/wayland/event_loop/mod.rs:81: Could not find wayland compositor -> os error at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.9/src/platform_impl/linux/wayland/event_loop/mod.rs:81: Could not find wayland compositor
Since 0.12 we've update winit from 0.28.7 to 0.29.9, so this is likely the culprit.
We do enable the wayland feature of eframe.
This seems to happen if libgtk-3-dev is missing. Additionally I needed to install libxkbcommon-x11-0 which isn't in a bare 22.04 docker container and isn't in our trouble-shooting instructions.
Lastly, needed to set export WGPU_BACKEND=gl.
apt-get install libgtk-3-dev libxkbcommon-x11-0
export WGPU_BACKEND=gl
Is there anything we can do to improve the error message and/or install instructions?
libgtk-3-dev is mentioned in https://www.rerun.io/docs/getting-started/troubleshooting but not libxkbcommon-x11-0
WINIT_UNIX_BACKEND has been renamed:
Breaking: WINIT_UNIX_BACKEND was removed in favor of standard WAYLAND_DISPLAY and DISPLAY variables.
(https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md#0292)
Let's update our trouble-shooting guide and then close this
- Fixed in #5191