Repository navigation
webgpu: Implement device lost - #32354
Conversation
|
I think I will not deal with |
|
new run: https://github.com/sagudev/servo/actions/runs/9211814858/job/25343380939
|
|
|
|
As a temporary solution for wgpu's deadlocks I added mutex fence before queue_submit and poll_all_devices. |
|
When applying some expectations I get: https://github.com/sagudev/servo/actions/runs/9271180193/job/25507347414
|
da159b6 to
8e5a370
Compare
This is another deadlock in wgpu: gfx-rs/wgpu#5737 (comment) EDIT: but it's still happening so there must be more, likely gfx-rs/wgpu#5807 (comment) |
workaround for wgpu deadlocks
|
I've been blocking this long enough on |
|
Will review tomorrow! |
gterzian
left a comment
There was a problem hiding this comment.
LGTM, but I don't think we need to propagate all the lost reasons.
| device: webgpu::WebGPUDevice, | ||
| queue: &GPUQueue, | ||
| label: String, | ||
| lost_promise: Rc<Promise>, |
There was a problem hiding this comment.
There was a problem hiding this comment.
I am not sure exactly what you meant here, but this promise is created in new, that calls new_inherited.
| pub fn lose(&self, reason: GPUDeviceLostReason, msg: String) { | ||
| let ref lost_promise = *self.lost_promise.borrow(); | ||
| let global = &self.global(); | ||
| let lost = GPUDeviceLostInfo::new(global, msg.into(), reason); |
There was a problem hiding this comment.
Not sure if we necessarily should propagate the message here, see the note in https://gpuweb.github.io/gpuweb/#lose-the-device
In our case we don't even know what is in the message, so we cannot guarantee that it does not leak system info.
There was a problem hiding this comment.
Given the experimental nature of servo (and even more experimental WebGPU support) I chose more (servo/wgpu) developer friendly approach by propagate wgpu error messages.
|
Lifetime of EDIT There is also draft of better GPUDevice cleanup in webgpu project board: WebGPU (view) |
gterzian
left a comment
There was a problem hiding this comment.
LGTM.
we should probably use weakref in hashmap
Add a note before merging?
I opened #32519 and assigned myself as I already have WIP. |
{"fail_fast": false, "matrix": [{"name": "WebGPU CTS", "workflow": "linux", "wpt_layout": "2020", "profile": "production", "unit_tests": false, "wpt_tests_to_run": "_webgpu"}]}
Due to hitting multiple deadlocks in wgpu I added lock to prevent some functions (queue_write_texture, queue_submit) run in parallel with device_poll in poller thread d9d506c (and thus avoiding deadlocks).
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors