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

thread 'main' attempted to acquire a snatch lock recursively #6378

Open
Tracked by #5572
hakolao opened this issue Oct 7, 2024 · 3 comments
Open
Tracked by #5572

thread 'main' attempted to acquire a snatch lock recursively #6378

hakolao opened this issue Oct 7, 2024 · 3 comments

Comments

@hakolao
Copy link
Contributor

hakolao commented Oct 7, 2024

Description
Device loss can cause lock contention due to lock guards being in scope while trying to write.

thread 'main' panicked at C:\Users\okko-\Programming\wgpu\wgpu-core\src\resource.rs:740:73:
thread 'main' attempted to acquire a snatch lock recursively.
- Currently trying to acquire a write lock at C:\Users\okko-\Programming\wgpu\wgpu-core\src\resource.rs:740:73
- Previously acquired a read lock at C:\Users\okko-\Programming\wgpu\wgpu-core\src\device\queue.rs:1043:55

Probably since #6229

Repro steps
Cause a device is lost error on queue submit.

Device::release_gpu_resources will run into above error when trying to release buffers or others.

Expected vs observed behavior
This lock contention should not occur.

Platform
Trunk + Windows + RTX3080

noticed during investigations of another issue #6279

@hakolao
Copy link
Contributor Author

hakolao commented Oct 7, 2024

I guess generally device loss is rare, so this maybe isn't that big of a deal...

I need to figure out why I'm getting it in the first place

@jimblandy
Copy link
Member

I guess generally device loss is rare, so this maybe isn't that big of a deal...

No, wgpu should handle device loss as gracefully as possible. Thanks for filing this!

@teoxoy
Copy link
Member

teoxoy commented Oct 8, 2024

release_gpu_resources can be removed once we move the registries into the Firefox bindings (#5121) since we can instead clear the registry on device loss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants