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

Using wgpu with GLFW causes system freeze on window close #1570

Closed
caelunshun opened this issue Jun 28, 2021 · 8 comments
Closed

Using wgpu with GLFW causes system freeze on window close #1570

caelunshun opened this issue Jun 28, 2021 · 8 comments
Labels
type: question Further information is requested

Comments

@caelunshun
Copy link

Description
A wgpu application using GLFW instead of winit will occasionally hang my system for ~10 seconds when shutting down. The issue also happens with minifb, and possibly other window management crates.

Additionally, resizing the window freezes the application, and the whole system hangs when I kill the process.

Possibly related to #318, except changing the present mode does not solve the problem.

Repro steps
Run the hello-triangle example ported to GLFW: source here. Then terminate the process with ctrl-C.

Platform
Ubuntu 18.04 running an NVIDIA GPU with driver version 460. The issue happens on the master branch as well as versions 0.9, 0.8, and 0.7. I haven't tested further back.

@cwfitzgerald
Copy link
Member

Is there any way to test where it is hanging? If this is also happening with minifb, this feels like an issue at another layer in the stack (maybe glfw).

@cwfitzgerald cwfitzgerald added the type: question Further information is requested label Jul 2, 2021
@caelunshun
Copy link
Author

Here's the stacktrace in a debugger:
wgpu_stacktrace

@cwfitzgerald
Copy link
Member

So it seems we're literally just waiting for the gpu to finish whatever it is doing. I'm not sure what we can do about that 🤔

@kvark
Copy link
Member

kvark commented Jul 3, 2021

I think this particular wait isn't really needed, since we are at the end of destruction clean-up, and we waited previously before starting it. But it is also deep in the stack (in wgpu-hal/vulkan), and it should be totally valid to do as long as the Vulkan device is not corrupted. Not sure what to do about this.

@caelunshun do you hook up env_logger? I wonder if Vulkan validation says anything.

@caelunshun
Copy link
Author

do you hook up env_logger? I wonder if Vulkan validation says anything.

No validation errors in the logs—the last message that gets printed is

[2021-07-03T20:55:50Z INFO  wgpu_core::hub] Dropping Global

before the program hangs.

@kvark
Copy link
Member

kvark commented Jul 4, 2021

Maybe we are trying to destroy the surface, and GLFW has already deleted the window our surface was created from.
This is related to the concept of Window/Surface API safety - #1463

@teoxoy
Copy link
Member

teoxoy commented Jul 26, 2024

It has been some time, @caelunshun is this still an issue?

@Wumpf
Copy link
Member

Wumpf commented Sep 8, 2024

closing as stale.
Please re-open if more information surfaces

@Wumpf Wumpf closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants