Re:Fastplotlib: GPU-accelerated, fast, and interactive plott...
by kushalkolar on Tuesday March 11, 2025 @05:43PM
(#43337367)
This looks cools thanks! Makes me wonder if there's any way to do that with WGPU if WGPU is interfacing with Vulkan, probably not easy if possible I"m guessing.
WGPU has security protections since it's designed for the browser so I'm guessing it's impossible.
Re:Fastplotlib: GPU-accelerated, fast, and interactive plott...
by rossant on Tuesday March 11, 2025 @06:17PM
(#43337689)
Indeed, it doesn't seem to be possible at the moment, see e.g. https://github.com/gfx-rs/wgpu/issues/4067
Re:Fastplotlib: GPU-accelerated, fast, and interactive plott...
by paddy_m on Tuesday March 11, 2025 @05:47PM
(#43337413)
Wow. So are you saying that you can have some array on the GPU that you setup with python via CuPy, then you call to the webbrowser and give it the pointer address for that GPU array, and the browser through WASM/WebGPU can access that same array? That sounds like a huge browser security hole.
Re:Fastplotlib: GPU-accelerated, fast, and interactive plott...
by kushalkolar on Tuesday March 11, 2025 @05:51PM
(#43337447)
Yea the security issue is why I'm pretty sure you can't do it on WGPU, but Vulkan and cupy can fully run locally so it doesn't have the same security concern.
Re:Fastplotlib: GPU-accelerated, fast, and interactive plott...
by rossant on Tuesday March 11, 2025 @06:15PM
(#43337675)
Exactly, this is the sort of thing you can more easily do on desktop than in a web browser.
Re:Fastplotlib: GPU-accelerated, fast, and interactive plott...
by rossant on Wednesday March 12, 2025 @06:11AM
(#43341553)
I published my proof-of-concept here: https://gist.github.com/rossant/517806ea551f4038fd412c23c3d6...
I'm now working on a way for users to wrap a Datoviz GPU buffer as a CuPy array that directly references the Datoviz-managed GPU memory. This should, in principle, enable efficient GPU-based array operations on GPU data without any transfers.
[1] https://datoviz.org/
[2] https://registry.khronos.org/vulkan/specs/latest/man/html/VK...
[3] https://docs.cupy.dev/en/latest/reference/generated/cupy.cud...