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

Webgpu dawn crash when calling AdapterGetLimits #1601

Closed
EmilSV opened this issue Aug 4, 2023 · 4 comments
Closed

Webgpu dawn crash when calling AdapterGetLimits #1601

EmilSV opened this issue Aug 4, 2023 · 4 comments
Labels
area-WebGPU bug Something isn't working

Comments

@EmilSV
Copy link

EmilSV commented Aug 4, 2023

Summary

When your are using Dawn and calling AdapterGetLimits get an error and crash
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Steps to reproduce

Comments

I did some investigating and found out that Dawn added a extra field to the WGPULimits sturct called maxBindGroupsPlusVertexBuffers https://dawn.googlesource.com/dawn/+/f3cac0d4538fe7c738cc4380f47f1cbc32c60324

and looks like Wgpu will add it in the future gfx-rs/wgpu#2170 so at this moment they do not have the same size and because of that Dawn will write to protected memory.

@EmilSV EmilSV added the bug Something isn't working label Aug 4, 2023
@Beyley
Copy link
Contributor

Beyley commented Aug 4, 2023

This is probably fixed in master, and on the dev feed, see this page

You should test this with a very recent (if not the latest) build of dawn on master

@EmilSV
Copy link
Author

EmilSV commented Aug 6, 2023

The problem is still on the newest version of silk.net as
https://github.com/dotnet/Silk.NET/blob/main/src/WebGPU/Silk.NET.WebGPU/Structs/Limits.gen.cs
do have the property "MaxBindGroupsPlusVertexBuffers" which the newer version of Dawn uses.

And https://github.com/webgpu-native/webgpu-headers do yet have added "MaxBindGroupsPlusVertexBuffers" to the header file most likely because Wgpu do not have it yet.

@Beyley
Copy link
Contributor

Beyley commented Aug 6, 2023

you should open an issue in the webgpu-headers repo about this, since we bind to the standardized headers, theres not much we can do about Dawn ignoring those and breaking ABI compat, for now i would reccomend using wgpu-native instead, as they are always in-sync with at least some version of the standardized headers, and the wgpu-native builds we publish on nuget always match the headers we bind to

@Perksey
Copy link
Member

Perksey commented Aug 21, 2023

Closing due to this being caused by a non-compliant driver.

@Perksey Perksey closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2023
@Perksey Perksey moved this from Todo to Done in Silk.NET Development Tracker Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-WebGPU bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants