bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.12k stars 3.56k forks source link

DefaultPlugins on Windows 11 & WSL Ubuntu causes Segmentation fault #3152

Open domhel opened 2 years ago

domhel commented 2 years ago

Bevy version

0.5

Operating system & version

Windows 11 and WSL with Ubuntu 20.04

What you did

  1. install WSL (on Windows 11, no additional configuration is needed in order to display native Linux GUIs)
  2. cargo new bevy_test, cd bevy_test
  3. add bevy="0.5" to Cargo.toml
  4. in src/main.rs, insert the following code:
    use bevy::prelude::*;
    fn main() {
    println!("Hello, world!");
    App::build()
    .add_plugins(DefaultPlugins)
    .run();
    }
  5. cargo run

What you expected to happen

Print "Hello, world!" and exit the program.

What actually happened

"Hello, world!" Segmentation fault

Additional information

Everything works until DefaultPlugins are added. Sadly, I haven't tested this with Windows 10 so I don't know if it was working before.

parasyte commented 2 years ago

AFAIK, it would not work on in WSL on Windows 10 because it doesn't support WSLg at all. I noted a segfault in the Vulkan driver in this issue: https://github.com/gfx-rs/wgpu/issues/2213 It isn't a bug in wgpu (since it happens with the ash examples too) but I did create that issue to track the bug.

willparsons commented 2 years ago

An update on this?

bjorn3 commented 2 years ago

According to https://github.com/gfx-rs/wgpu/issues/2213#issuecomment-979645414 using gles instead of vulkan works.

willparsons commented 2 years ago

I see that for direct use of wpgu, but how can I instruct bevy to use gles?

bjorn3 commented 2 years ago

Using the WGPU_BACKEND=gles env var I believe.

willparsons commented 2 years ago

Still getting a seg fault, unfortunately. Although I do see a window appear for half a second :/

domhel commented 2 years ago

Still getting a seg fault, unfortunately. Although I do see a window appear for half a second :/

Same for me, I'm using bevy 0.6 now but it doesn't change anything.

Here is my output, running with `RUST_BACKTRACE=1`. ```sh Finished dev [unoptimized + debuginfo] target(s) in 0.07s Running `target/debug/bevy_test` 2022-01-16T18:34:15.687106Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1 2022-01-16T18:34:16.579223Z INFO bevy_render::renderer: AdapterInfo { name: "D3D12 (NVIDIA GeForce GTX 980 Ti)", vendor: 0, device: 0, device_type: DiscreteGpu, backend: Gl } 2022-01-16T18:34:16.645235Z ERROR wgpu_core::device: surface configuration failed: incompatible window kind thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/backend/direct.rs:214:9 stack backtrace: 0: rust_begin_unwind at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5 1: std::panicking::begin_panic_fmt at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:460:5 2: wgpu::backend::direct::Context::handle_error_fatal at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/backend/direct.rs:214:9 3: ::surface_configure at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/backend/direct.rs:921:13 4: wgpu::Surface::configure at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/lib.rs:3267:9 5: bevy_render::renderer::render_device::RenderDevice::configure_surface at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.6.0/src/renderer/render_device.rs:147:9 6: bevy_render::view::window::prepare_windows at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.6.0/src/view/window.rs:150:13 7: core::ops::function::FnMut::call_mut at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:150:5 8: core::ops::function::impls:: for &mut F>::call_mut at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:269:13 9: >::run::call_inner at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.6.0/src/system/function_system.rs:512:21 10: >::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.6.0/src/system/function_system.rs:515:17 11: as bevy_ecs::system::system::System>::run_unsafe at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.6.0/src/system/function_system.rs:442:19 12: bevy_ecs::schedule::executor_parallel::ParallelExecutor::prepare_systems::{{closure}} at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.6.0/src/schedule/executor_parallel.rs:214:30 13: as core::future::future::Future>::poll at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/future/mod.rs:80:19 14: async_executor::LocalExecutor::spawn::{{closure}} at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:376:13 15: as core::future::future::Future>::poll at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/future/mod.rs:80:19 16: async_task::raw::RawTask::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/raw.rs:489:20 17: async_task::runnable::Runnable::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/runnable.rs:309:18 18: async_executor::Executor::try_tick at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:181:17 19: async_executor::LocalExecutor::try_tick at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:405:9 20: bevy_tasks::task_pool::TaskPool::scope::{{closure}} at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.6.0/src/task_pool.rs:223:21 21: std::thread::local::LocalKey::try_with at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/thread/local.rs:399:16 22: std::thread::local::LocalKey::with at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/thread/local.rs:375:9 23: bevy_tasks::task_pool::TaskPool::scope at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.6.0/src/task_pool.rs:169:9 24: ::run_systems at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.6.0/src/schedule/executor_parallel.rs:122:9 25: ::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.6.0/src/schedule/stage.rs:850:17 26: ::build::{{closure}} at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.6.0/src/lib.rs:226:21 27: as core::ops::function::Fn>::call at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/alloc/src/boxed.rs:1650:9 28: bevy_app::app::App::update at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.6.0/src/app.rs:114:13 29: bevy_winit::winit_runner_with::{{closure}} at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_winit-0.6.0/src/lib.rs:504:21 30: winit::platform_impl::platform::sticky_exit_callback at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:753:5 31: winit::platform_impl::platform::x11::EventLoop::run_return at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/x11/mod.rs:293:17 32: winit::platform_impl::platform::x11::EventLoop::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/x11/mod.rs:392:9 33: winit::platform_impl::platform::EventLoop::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:669:56 34: winit::event_loop::EventLoop::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/event_loop.rs:154:9 35: bevy_winit::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_winit-0.6.0/src/lib.rs:171:5 36: bevy_winit::winit_runner_with at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_winit-0.6.0/src/lib.rs:513:9 37: bevy_winit::winit_runner at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_winit-0.6.0/src/lib.rs:211:5 38: core::ops::function::Fn::call at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:70:5 39: as core::ops::function::Fn>::call at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/alloc/src/boxed.rs:1650:9 40: bevy_app::app::App::run at /home/dominik/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.6.0/src/app.rs:130:9 41: bevy_test::main at ./src/main.rs:4:5 42: core::ops::function::FnOnce::call_once at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ```
parasyte commented 2 years ago

This can be fixed by updating Mesa. In short:

$ sudo add-apt-repository ppa:kisak/kisak-mesa
$ sudo apt update
$ sudo apt upgrade

Using the Vulkan adapter (llvmpipe, software rasterization):

bevy_wsl

(Look at those CPUs go! 🔥)

Using GLES (hardware acceleration via DirectX) does not work with Bevy:

2022-01-16T21:45:10.315947Z ERROR wgpu_hal::gles::egl: GLES: [API/Error] ID 1 : GL_INVALID_ENUM in glBindTexture(target = GL_TEXTURE_CUBE_MAP_ARRAY)

That's https://github.com/gfx-rs/wgpu/issues/1746


edit: I was hoping that software rasterization with the GL backend would work better, but it does not. There's a different error:

$ WGPU_BACKEND=gl LIBGL_ALWAYS_SOFTWARE=true cargo run --example lighting
...
2022-01-16T22:15:38.750508Z  INFO bevy_render::renderer: AdapterInfo { name: "llvmpipe (LLVM 13.0.0, 256 bits)", vendor: 0, device: 0, device_type: Cpu, backend: Gl }
...
2022-01-16T22:15:38.882431Z ERROR wgpu_core::device: surface configuration failed: incompatible window kind
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/jay/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/0183e7d/wgpu/src/backend/direct.rs:214:9

This looks like https://github.com/gfx-rs/wgpu/issues/2335 but sadly it is not! That bug is already fixed on the latest main branch, and I used it with a Cargo patch without success.

edit 2: AHA! It is the same bug:

$ WGPU_BACKEND=gl LIBGL_ALWAYS_SOFTWARE=true WINIT_UNIX_BACKEND=wayland cargo run --example lighting
...
thread 'main' panicked at 'wayland feature is not enabled', /home/jay/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:593:21

Bevy only enables X11 by default, but wgpu prefers Wayland. We can fix that:

$ WGPU_BACKEND=gl LIBGL_ALWAYS_SOFTWARE=true cargo run --example lighting --features wayland
...
2022-01-16T22:38:46.470309Z  INFO bevy_render::renderer: AdapterInfo { name: "llvmpipe (LLVM 13.0.0, 256 bits)", vendor: 0, device: 0, device_type: Cpu, backend: Gl }
...
2022-01-16T22:38:46.649707Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `pbr_opaque_mesh_pipeline`
    Internal error in FRAGMENT shader: gsamplerCubeArrayShadow isn't supported in textureGrad, textureLod or texture with bias

But we can't fix that easily.

jdygert commented 2 years ago

I get the same error, but when I run a simpler example like window_settings with wayland under either of gl or vulkan, I get no error and yet the app exits quickly without showing a window. I attached both trace level logs, but nothing stands out in them to my untrained eye. vulkan.log gl.log

LaurenteEber commented 2 years ago

I get two errors:

error: failed to run custom build command for `wayland-sys v0.29.4`

Caused by:
  process didn't exit successfully: `/home/eber/rust/my_bevy_game/target/debug/build/wayland-sys-d7529aee7d899372/build-script-build` (exit status: 101)

And

error: failed to run custom build command for `smithay-client-toolkit v0.15.4`

Caused by:
  process didn't exit successfully: `/home/eber/rust/my_bevy_game/target/debug/build/smithay-client-toolkit-8f97c7ef00c3919f/build-script-build` (exit status: 101)

I appreciate any help.

bjorn3 commented 2 years ago
  1. Those should only happen if you explicitly enable wayland support.
  2. The actual error should be above those lines. What does it say?
LaurenteEber commented 2 years ago

Thanks for the answer @bjorn3,

  1. Yes, this happen when I enable wayland support, but when don't I get the following error, and in other posts I find that we'll solve it enabling wayland.

    ❯ cargo run
    Blocking waiting for file lock on package cache
    Finished dev [unoptimized + debuginfo] target(s) in 0.25s
     Running `target/debug/my_bevy_game`
    thread 'main' panicked at 'Failed to initialize any backend! Wayland status: "backend disabled" X11 status: XOpenDisplayFailed', /home/eber/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:619:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  2. These say:

    
    ❯ cargo run
    Compiling wayland-sys v0.29.4
    Compiling smithay-client-toolkit v0.15.4
    error: failed to run custom build command for `wayland-sys v0.29.4`

Caused by: process didn't exit successfully: /home/eber/rust/my_bevy_game/target/debug/build/wayland-sys-d7529aee7d899372/build-script-build (exit status: 101) --- stdout cargo:rerun-if-env-changed=WAYLAND_CLIENT_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=WAYLAND_CLIENT_STATIC cargo:rerun-if-env-changed=WAYLAND_CLIENT_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

--- stderr thread 'main' panicked at 'called Result::unwrap() on an Err value: "pkg-config" "--libs" "--cflags" "wayland-client" did not exit successfully: exit status: 1 error: could not find system library 'wayland-client' required by the 'wayland-sys' crate

--- stderr Package wayland-client was not found in the pkg-config search path. Perhaps you should add the directory containing wayland-client.pc' to the PKG_CONFIG_PATH environment variable No package 'wayland-client' found ', /home/eber/.cargo/registry/src/github.com-1ecc6299db9ec823/wayland-sys-0.29.4/build.rs:10:47 note: run withRUST_BACKTRACE=1environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: failed to run custom build command forsmithay-client-toolkit v0.15.4`

1216892614 commented 1 year ago

What's news? Will WSL be support now?

I still get this error, even after I use WGPU_BACKEND=gles or upadate Mesa.

> WGPU_BACKEND=gles cargo run --example lighting
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/examples/lighting`
2023-04-07T11:29:11.129650Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-04-07T11:29:11.129892Z  WARN winit::platform_impl::platform::x11::util::randr: XRandR reported that the display's 0mm in size, which is certifiably insane    
2023-04-07T11:29:11.130013Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1    
2023-04-07T11:29:11.400053Z  INFO bevy_render::renderer: AdapterInfo { name: "D3D12 (NVIDIA GeForce RTX 3070)", vendor: 0, device: 0, device_type: Other, driver: "", driver_info: "", backend: Gl }
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
2023-04-07T11:29:11.667485Z  WARN bevy_audio::audio_output: No audio device found.
2023-04-07T11:29:11.687360Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 22.04 Ubuntu", kernel: "5.15.90.1-microsoft-standard-WSL2", cpu: "AMD Ryzen 5 5600 6-Core Processor", core_count: "6", memory: "15.6 GiB" }
2023-04-07T11:29:11.724345Z ERROR wgpu_core::device: surface configuration failed: incompatible window kind    
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/nerd/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/wgpu-0.15.1/src/backend/direct.rs:316:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'A system has panicked so the executor cannot continue.: RecvError', crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:194:60
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/nerd/Code/bevy/crates/bevy_tasks/src/task_pool.rs:376:49
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', crates/bevy_render/src/pipelined_rendering.rs:135:45
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/nerd/Code/bevy/crates/bevy_tasks/src/task_pool.rs:376:49
fish: Job 1, 'WGPU_BACKEND=gles cargo run --e…' terminated by signal SIGSEGV (Address boundary error)
Lygaen commented 1 year ago

What's news? Will WSL be support now?

I still get this error, even after I use WGPU_BACKEND=gles or upadate Mesa.

> WGPU_BACKEND=gles cargo run --example lighting
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/examples/lighting`
2023-04-07T11:29:11.129650Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-04-07T11:29:11.129892Z  WARN winit::platform_impl::platform::x11::util::randr: XRandR reported that the display's 0mm in size, which is certifiably insane    
2023-04-07T11:29:11.130013Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1    
2023-04-07T11:29:11.400053Z  INFO bevy_render::renderer: AdapterInfo { name: "D3D12 (NVIDIA GeForce RTX 3070)", vendor: 0, device: 0, device_type: Other, driver: "", driver_info: "", backend: Gl }
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
2023-04-07T11:29:11.667485Z  WARN bevy_audio::audio_output: No audio device found.
2023-04-07T11:29:11.687360Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 22.04 Ubuntu", kernel: "5.15.90.1-microsoft-standard-WSL2", cpu: "AMD Ryzen 5 5600 6-Core Processor", core_count: "6", memory: "15.6 GiB" }
2023-04-07T11:29:11.724345Z ERROR wgpu_core::device: surface configuration failed: incompatible window kind    
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/nerd/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/wgpu-0.15.1/src/backend/direct.rs:316:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'A system has panicked so the executor cannot continue.: RecvError', crates/bevy_ecs/src/schedule/executor/multi_threaded.rs:194:60
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/nerd/Code/bevy/crates/bevy_tasks/src/task_pool.rs:376:49
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', crates/bevy_render/src/pipelined_rendering.rs:135:45
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/nerd/Code/bevy/crates/bevy_tasks/src/task_pool.rs:376:49
fish: Job 1, 'WGPU_BACKEND=gles cargo run --e…' terminated by signal SIGSEGV (Address boundary error)

Hi! I found the answer after some intense searching, we need to add the feature to the cargo file. So change from :

[dependencies]
bevy = "*.**.*"

to :

[dependencies]
bevy = { version = "*.**.*", features = ["wayland"] }

If it still doesn't work, we can force WInit to use wayland :

WINIT_UNIX_BACKEND=wayland cargo run