Sharing webgpu resources across render processes

120 views
Skip to first unread message

Robert Conde

unread,
Apr 23, 2020, 11:26:50 AM4/23/20
to Dawn Graphics
A quick task manager inspection on windows shows that multiple render processes share a single GPU process. Therefore it seems possible in principal that webgpu resources could be shared between render processes. This might be useful in an electron or electron-like scenarios where multiple browser-window/render-processes may comprise a single application. On the other hand, this is probably a security issue for the general use case. Is there any possibility of having this functionality in chrome, maybe behind a command line switch? I guess the other piece is there would need to be a way to create the reference to the shared resource.

Thanks,
Rob

Kai Ninomiya

unread,
Apr 23, 2020, 1:58:21 PM4/23/20
to Robert Conde, Dawn Graphics
We discussed this further on chat, but to summarize:

- We do indeed internally take advantage of that sharing - it's necessary for composition of multiple renderer process contents into a single browser window.
- In Chromium we're not very interested in doing work just for the sake of Electron, but we are interested in doing work to make the web platform more powerful (which benefits Electron).
- A version of this can be done in a secure, standardizable way. There are already ways to make multiple JS contexts (workers, iframes, popups) that can freely communicate with each other. Sharing GPUDevices across windows may not be significantly different from sharing across workers.
- SharedWorker will probably get WebGPU support (but not sure whether the GPUDevice will be shareable with other JS contexts).
- As a proxy argument, for any two contexts between which you can share a SharedArrayBuffer, you should also theoretically be able to share a GPUDevice. (Though I don't know if all the theoretically-possible ways to share SharedArrayBuffers exist today or not.)

--
You received this message because you are subscribed to the Google Groups "Dawn Graphics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dawn-graphic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dawn-graphics/72ed1035-0016-4e38-98ef-e22e823541a1%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages