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: Update wgpu to 0.19 #31995

Merged
merged 5 commits into from
Apr 26, 2024
Merged

webgpu: Update wgpu to 0.19 #31995

merged 5 commits into from
Apr 26, 2024

Conversation

sagudev
Copy link
Member

@sagudev sagudev commented Apr 4, 2024

Instead of using 0.19, we use even newer version that removed IdentityFactories completely (also needed for #32008). I implemented proper drops for GPU* structs that are analogues to Cleanup functions in firefox.

Relevant FF commit: mozilla/gecko-dev@62af8e7

try run: https://github.com/sagudev/servo/actions/runs/8820854175/job/24217313911 (crashes on webgpu:shader,execution,expression,* are #31397, timeouts are due too same problem as in #32008)


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes WebGPU CTS

@sagudev sagudev added the A-content/webgpu The WebGPU implementation. label Apr 4, 2024
@sagudev sagudev changed the title [WIP] webgpu: Update to wgpu 0.19 webgpu: Update to wgpu 0.19 Apr 5, 2024
@sagudev
Copy link
Member Author

sagudev commented Apr 5, 2024

Weird crash on _webgpu/webgpu/cts.https.html?q=webgpu:api,validation,queue,destroyed,texture:writeTexture:*:

Texture[Id(1,1,vk)] does not exist (thread WGPU, at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.19.3/src/storage.rs:113)
2024-04-05T05:38:36.3419584Z          0: servoshell::backtrace::print
2024-04-05T05:38:36.3419696Z          1: servoshell::main::{{closure}}
2024-04-05T05:38:36.3419926Z          2: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
2024-04-05T05:38:36.3420387Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/alloc/src/boxed.rs:2021:9
2024-04-05T05:38:36.3420532Z             std::panicking::rust_panic_with_hook
2024-04-05T05:38:36.3420847Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:735:13
2024-04-05T05:38:36.3421011Z          3: std::panicking::begin_panic_handler::{{closure}}
2024-04-05T05:38:36.3421326Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:609:13
2024-04-05T05:38:36.3421505Z          4: std::sys_common::backtrace::__rust_end_short_backtrace
2024-04-05T05:38:36.3421862Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys_common/backtrace.rs:170:18
2024-04-05T05:38:36.3421964Z          5: rust_begin_unwind
2024-04-05T05:38:36.3422271Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:597:5
2024-04-05T05:38:36.3422387Z          6: core::panicking::panic_fmt
2024-04-05T05:38:36.3422691Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:72:14
2024-04-05T05:38:36.3423010Z          7: wgpu_core::storage::Storage<T,I>::get
2024-04-05T05:38:36.3423154Z          8: wgpu_core::registry::Registry<I,T>::get
2024-04-05T05:38:36.3423431Z          9: wgpu_core::device::queue::<impl wgpu_core::global::Global<G>>::queue_write_texture
2024-04-05T05:38:36.3423528Z         10: webgpu::WGPU::run
2024-04-05T05:38:36.3423720Z         11: std::sys_common::backtrace::__rust_begin_short_backtrace
2024-04-05T05:38:36.3423899Z         12: core::ops::function::FnOnce::call_once{{vtable.shim}}
2024-04-05T05:38:36.3424151Z         13: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2024-04-05T05:38:36.3424452Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/alloc/src/boxed.rs:2007:9
2024-04-05T05:38:36.3424679Z             <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
2024-04-05T05:38:36.3424979Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/alloc/src/boxed.rs:2007:9
2024-04-05T05:38:36.3425139Z             std::sys::unix::thread::Thread::new::thread_start
2024-04-05T05:38:36.3425477Z                    at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/sys/unix/thread.rs:108:17
2024-04-05T05:38:36.3425563Z         14: <unknown>
2024-04-05T05:38:36.3425646Z         15: <unknown>

@sagudev
Copy link
Member Author

sagudev commented Apr 13, 2024

Crash is from https://bugzilla.mozilla.org/show_bug.cgi?id=1860958

Need to recheck all drop/destroy.

@sagudev

This comment was marked as resolved.

@sagudev
Copy link
Member Author

sagudev commented Apr 22, 2024

Encoder timeouts are another example of #32008 (if poll is done on every iteration of loop everything works correctly). So I will update expectations as they are now, so we can get this moving.

@sagudev sagudev force-pushed the wgpu019 branch 2 times, most recently from d3e07a1 to 1671378 Compare April 24, 2024 17:32
@sagudev
Copy link
Member Author

sagudev commented Apr 24, 2024

Useful patch when you want results of wpt run: 1671378

@sagudev sagudev changed the title webgpu: Update to wgpu 0.19 webgpu: Update wgpu to https://github.com/gfx-rs/wgpu/commit/32e70bc1635905c508d408eb1cf22b2aa062ffe1 (0.19) Apr 24, 2024
@sagudev sagudev changed the title webgpu: Update wgpu to https://github.com/gfx-rs/wgpu/commit/32e70bc1635905c508d408eb1cf22b2aa062ffe1 (0.19) webgpu: Update wgpu to 0.19 Apr 24, 2024
@mrobinson
Copy link
Member

Useful patch when you want results of wpt run: 1671378

Maybe we should disable the dashboard for all try runs.

@sagudev sagudev marked this pull request as ready for review April 24, 2024 19:33
@sagudev sagudev requested a review from gterzian April 24, 2024 19:43
Copy link
Member

@gterzian gterzian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with this short-term, but I think we need to re-design the lifecyle management of all these objects, because now there is too much back and forth over IPC and also I think we want to forbid Drop for dom objects, and also because I think by the time something drops it's not clear if we are shutting down or if it's just that objects that is dropped.

This needs more work on the details, but I think we should do something like desribed in #32148

components/script/dom/identityhub.rs Outdated Show resolved Hide resolved
components/webgpu/lib.rs Show resolved Hide resolved
components/script/dom/gpuadapter.rs Show resolved Hide resolved
@sagudev sagudev removed this pull request from the merge queue due to a manual request Apr 26, 2024
@sagudev sagudev enabled auto-merge April 26, 2024 06:36
@sagudev sagudev added this pull request to the merge queue Apr 26, 2024
Merged via the queue into servo:main with commit 4af413c Apr 26, 2024
9 checks passed
@sagudev sagudev deleted the wgpu019 branch April 26, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/webgpu The WebGPU implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants