Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bevy freezes on Wayland #10546

Open
ColonelThirtyTwo opened this issue Nov 13, 2023 · 6 comments
Open

Bevy freezes on Wayland #10546

ColonelThirtyTwo opened this issue Nov 13, 2023 · 6 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system S-Blocked This cannot move forward until something else changes

Comments

@ColonelThirtyTwo
Copy link

ColonelThirtyTwo commented Nov 13, 2023

Bevy version

Tested both 0.12 and commit 18d001d27ce475388743d9825f2833ce51f5b20d (current main as of writing)

[Optional] Relevant system information

Arch Linux, Hyprland compositor v0.30.0, laptop with AMD / Nvidia hybrid graphics.

What you did

In bevy/examples, run cargo run --example button --features wayland, and attempt to press the button

What went wrong

The button does not highlight on hover or clicking as expected. The cursor is stuck on the "text entry" cursor. The window does not respond to window closing, and must be closed via Ctrl+C from the console.

If I add a simple system that prints on update, the system only prints 5 times before stopping.

Additional information

Removing the wayland feature from bevy fixes the issue.

Output of env RUST_LOG=debug cargo run --example button --features wayland (unfortunately includes coloring escape sequences): log.txt

@ColonelThirtyTwo ColonelThirtyTwo added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 13, 2023
@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in O-Linux Specific to the Linux desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Nov 13, 2023
@badcodecat
Copy link

Same thing happening to me using KDE Wayland, rust 1.76.0, and bevy main.

badcodecat added a commit to badcodecat/bevy_ui_builder that referenced this issue Feb 10, 2024
@WarrenHood
Copy link

WarrenHood commented Mar 17, 2024

Can confirm that this happens for me using Hyprland on Arch using bevy 0.13, with Nvidia 550 drivers. All bevy apps/examples (eg. breakout) completely freeze when enabling the wayland feature. x11 works fine (aside from resizing the window causing a panic when the window surface gets outdated - but that's a different issue issue)

@Friz64
Copy link
Contributor

Friz64 commented Apr 24, 2024

I suspect this is gfx-rs/wgpu#4775 (fixed in gfx-rs/wgpu#4967). I've made a fork of wgpu 0.19 that includes this fix here.

[patch.crates-io]
wgpu = { git = "https://github.com/Friz64/wgpu.git", branch = "v0.19-4967" }
wgpu-types = { git = "https://github.com/Friz64/wgpu.git", branch = "v0.19-4967" }
naga = { git = "https://github.com/Friz64/wgpu.git", branch = "v0.19-4967" }

Adding this to the bottom of bevy's Cargo.toml (or any bevy project's Cargo.toml) should fix the issue. Can anyone confirm this?

@ColonelThirtyTwo
Copy link
Author

I suspect this is gfx-rs/wgpu#4775 (fixed in gfx-rs/wgpu#4967). I've made a fork of wgpu 0.19 that includes this fix here.

[patch.crates-io]
wgpu = { git = "https://github.com/Friz64/wgpu.git", branch = "v0.19-4967" }
wgpu-types = { git = "https://github.com/Friz64/wgpu.git", branch = "v0.19-4967" }
naga = { git = "https://github.com/Friz64/wgpu.git", branch = "v0.19-4967" }

Adding this to the bottom of bevy's Cargo.toml (or any bevy project's Cargo.toml) should fix the issue. Can anyone confirm this?

FWIW the linked bug mentions that NVIDIA has fixed the issue in their drivers causing it. I can run the example just fine without the original issue with driver version 550.76.

@Friz64
Copy link
Contributor

Friz64 commented Apr 24, 2024

Can anyone confirm this?

@AndrewDanial has confirmed that this fixes the issue for him on the discord.

@james7132 james7132 added S-Blocked This cannot move forward until something else changes A-Rendering Drawing game state to the screen and removed S-Needs-Investigation This issue requires detective work to figure out what's going wrong A-Windowing Platform-agnostic interface layer to run your app in labels Apr 24, 2024
@Friz64
Copy link
Contributor

Friz64 commented Jun 19, 2024

This was fixed by #13186 and can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system S-Blocked This cannot move forward until something else changes
Projects
None yet
Development

No branches or pull requests

6 participants