-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Off screen window crashes App #12887
Comments
Ah, definitely not related to #12875, as that is rust work spaces, not window compositor workspaces. |
Are you able to reproduce this crash upstream with pure |
Tested the |
Great, sounds like a Bevy problem in some form then. Thanks for investigating. I would test this on #12669 next: there's a chance that this resolves the problem. |
unfortunately no. The crash from that branch is included below Log```
|
Would you mind testing it with #12524? If not, does it work properly when disabling pipelined rendering? App::new()
.add_plugins(
DefaultPlugins.build()
.disable::<PipelinedRenderingPlugin>()
)
.run(); |
It shows the nvidia related warning added in #12542 just before crashing, so it's probably related. |
This branch is worse. The program crashes immediately instead of just when switching windows. I expect this is because is doesn't include the fix from #12542.
Nope.
|
The Consider this commit: Friz64@a2cb2a8. It would massively simplify things. |
No, in fact compiling with wgpu doesn't happen at all. When |
Oops, my fault. You additionally need to tell eframe which windowing server to support. Add the eframe = { version = "0.27.0", default-features = false, features = [
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
"default_fonts", # Embed the default egui fonts.
"wgpu", # Use the glow rendering backend. Alternative: "wgpu".
"x11",
"persistence", # Enable restoring app state when restarting the app.
] } |
@Friz64 Edit: A minor difference from your config, I am on version |
Okay, next observation: The default log level (when |
@Friz64. Identical log on
|
Why is your wgpu falling back to OpenGL? Is your Vulkan driver broken? Please open the app with |
@Friz64 Good question...
|
Oh, turns out the log you posted is just the unrelated output of wgpu also initializing OpenGL. Vulkan is working normally, and gets picked over OpenGL. Everything is normal in that front. Either way. Weird that eframe doesn't experience the surface errors when using wgpu. I'm not sure how to continue debugging from here. Ultimately I still think Bevy should still simply be more lenient with surface errors. |
Though I don't really have much experience with this codebase (or vulkan for that matter), it seems to me that the primary offender is, as @Friz64 points out, some overly strict surface error checks. More specifically, here... bevy/crates/bevy_render/src/view/window/mod.rs Lines 354 to 363 in cab1c57
When swapping workspaces, the window is no longer in view, so a timeout occurs. The only case in which a timeout is allowable in the current context is when running Mesa drivers (I am running proprietary nvidia) due to their quirks(?). I guess the real question is how can we accurately differentiate from valid timeouts (such as in my case) and truly unrecoverable states. In my case, it is simple to just modify this function to also include Nvidia. But then at that point, you are covering Intel, AMD, and Nvidia (so basically all major desktop vendors). bevy/crates/bevy_render/src/view/window/mod.rs Lines 292 to 310 in cab1c57
or just change
from panic! to warn_once!
I have only tested the later, which fixes the crash, but I assume that the prior would also work. I am willing to write a pull request to address the issue if necessary. Perhaps the original authors of the |
Bevy version
0.13.2
Relevant system information
If you cannot get Bevy to build or run on your machine, please include:
cargo:
cargo 1.76.0 (c84b36747 2024-01-18)
os:
Linux EndeavourOS (6.8.2-arch2-1)
AdapterInfo:
{ name: "NVIDIA GeForce RTX 3070 Ti Laptop GPU", vendor: 4318, device: 9440, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "550.67", backend: Vulkan }
windowing:
Wayland
What you did
When running any app with the default rendering plugin, placing the window offscreen causes the program to crash.
Example
What went wrong
On my system, I run hyprland, a tiling window manager for Wayland. While running an app without any real content besides the default plugin, navigating to a new workspace causes the App to crash. This shouldn't happen and the app should continue to run without crash when it is off the currently viewed screen. I am unsure if #12875 is related, as the crash log doesn't really look similar, but perhaps that is the case.
Additional information
Error Log
```The text was updated successfully, but these errors were encountered: