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

Closing window doesn't end process #11811

Closed
A-Walrus opened this issue Feb 10, 2024 · 13 comments
Closed

Closing window doesn't end process #11811

A-Walrus opened this issue Feb 10, 2024 · 13 comments
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system

Comments

@A-Walrus
Copy link
Contributor

Bevy version

0.12.1, as well as main at time of writing: b6945e5

If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

2024-02-10T16:18:05.493890Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon Graphics", vendor: 4098, device: 5761, device_type: IntegratedGpu, driver: "AMD open-source driver", driver_info: "2024.Q1.1 (LLPC)", backend: Vulkan }
2024-02-10T16:18:05.877320Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux rolling EndeavourOS", kernel: "6.6.16-1-lts", cpu: "", core_count: "8", memory: "30.6 GiB" }

Tested the winit window example and it works fine

What you did

Ran any bevy app, for example the sprite example. Pressed the X button in the top bar of the app.

What went wrong

Process stayed open, had to be killed through Ctrl+C, or through system monitor.

Expected: process closes.

Additional information

This happened both on Wayland and Xorg.

@A-Walrus A-Walrus added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 10, 2024
@Friz64
Copy link
Contributor

Friz64 commented Feb 10, 2024

I think you are using the AMDVLK driver. You might want to try the Mesa Radeon drivers, RADV. They are generally better supported. Try uninstalling the amdvlk package and installing vulkan-radeon instead.

@A-Walrus
Copy link
Contributor Author

Switch to the vulkan-radeon driver and now the process closes, although with a panic

Encountered a panic in system `bevy_render::view::window::prepare_windows`!
thread 'main' panicked at crates/bevy_render/src/pipelined_rendering.rs:49:67:
called `Result::unwrap()` on an `Err` value: RecvError

@Friz64
Copy link
Contributor

Friz64 commented Feb 10, 2024

Interesting, this is probably #11734, although your error message is different. Does this happen on both Wayland and X11?
This is #11734.

@A-Walrus
Copy link
Contributor Author

Happens with xwayland. When running on wayland with wayland feature enabled it works correctly, seems to be the same issue as you said

@Friz64
Copy link
Contributor

Friz64 commented Feb 10, 2024

It's interesting that (apparently/probably) since #11737 got merged, it now panics a second time. This is the full message:

thread 'Compute Task Pool (14)' panicked at crates/bevy_render/src/view/window/mod.rs:368:21:
Couldn't get swap chain texture, operation unrecoverable: The swap chain has been lost and needs to be recreated
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::view::window::prepare_windows`!
thread 'Compute Task Pool (14)' panicked at crates/bevy_render/src/pipelined_rendering.rs:49:67:
called `Result::unwrap()` on an `Err` value: RecvError

That's why I didn't immediately recognize the error.

@Weibye Weibye added A-Windowing Platform-agnostic interface layer to run your app in O-Linux Specific to the Linux desktop operating system and removed S-Needs-Triage This issue needs to be labelled labels Feb 13, 2024
@mwbryant
Copy link
Contributor

I'm seeing the same original problem with the recommended drivers, hangs after closing without panic.

2024-02-19T20:41:39.728702Z  INFO log: Guessed window scale factor: 1.6666666666666667    
2024-02-19T20:41:39.832922Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon Graphics (RADV GFX1103_R1)", vendor: 4098, device: 5567, device_type: IntegratedGpu, driver: "radv", driver_info: "Mesa 24.0.1 - kisak-mesa PPA", backend: Vulkan }
2024-02-19T20:41:40.162962Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 23.10 Ubuntu", kernel: "6.5.0-17-generic", cpu: "AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics", core_count: "8", memory: "27.1 GiB" }
2024-02-19T20:41:44.080514Z  INFO bevy_window::system: No windows are open, exiting
2024-02-19T20:41:44.081244Z  INFO bevy_winit::system: Closing window 0v1```

@grimace87
Copy link

Seeing this same issue on Ubuntu after updating to 0.13 (was not an issue on 0.12.1):

2024-02-22T20:32:44.335631Z  INFO log: Guessed window scale factor: 1.1666666666666667
2024-02-22T20:32:44.405722Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 5700 XT (RADV NAVI10)", vendor: 4098, device: 29471, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 23.2.1-1ubuntu3.1", backend: Vulkan }
2024-02-22T20:32:44.608342Z  INFO log: Gamepad /dev/input/event7 (Microsoft X-Box 360 pad) connected.    
2024-02-22T20:32:44.625949Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 23.10 Ubuntu", kernel: "6.5.0-17-lowlatency", cpu: "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz", core_count: "4", memory: "15.6 GiB" }
2024-02-22T20:32:44.628695Z  INFO bevy_input::gamepad: Gamepad { id: 0 } Connected
2024-02-22T20:32:50.037479Z  INFO bevy_window::system: No windows are open, exiting
2024-02-22T20:32:50.043979Z  INFO bevy_winit::system: Closing window 0v1

After which the process hangs indefinitely until force-quit.

@mochou-p
Copy link

mochou-p commented Mar 1, 2024

gonna throw in my little insight, i have had this issue since 0.13 (on xwayland) as well, panicking when user closes the main window and also on bevy::window::close_on_esc.
however, it does not happen when dependencies are built without optimisation.
it is a graceful shutdown with no opt-level in [profile.dev.package."*"] in Cargo.toml.

@grimace87
Copy link

Can confirm removing the opt-level as @mochou-p described lets it shut down gracefully with Process finished with exit code 0.

@mochou-p
Copy link

mochou-p commented Mar 9, 2024

another thing i just found out: having 2 games open, both with bevy::window::close_on_esc in Update, with both of them being the latest focused windows in the OS, pressing [Escape] will close both, the top one will panic, and the bottom one will shutdown gracefully. (bevy 0.13, xwayland)

@goto40
Copy link

goto40 commented Apr 6, 2024

Same for me... (bevy 0.13.1 and 0.13.2)

@Friz64
Copy link
Contributor

Friz64 commented May 9, 2024

Duplicate of #10260.

@Friz64
Copy link
Contributor

Friz64 commented May 12, 2024

Fixed in #13236, can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-Linux Specific to the Linux desktop operating system
Projects
None yet
Development

No branches or pull requests

8 participants