Live data from Hacker News

WebGPU – All of the cores, none of the canvas

surma.dev

91–100 of 137 posts

Re: WebGPU – All of the cores, none of the canvas

#91

If I'm already familiar with Rust, how is WebGPU as an introduction to graphics programming if you aren't already familiar with any of the backends that it wraps? Should I try just learning Vulcan first? Is the abstraction layer just going to introduce additional confusion for a newbie?

Unless you live in windows ONLY, start with wgpu (a Rust library that supports WebGPU). It'll work with Metal/Vulkan/Web.

WebGPU is very similar to Vulkan, near a 1:1 in concepts. A lot of the new libraries (Metal, DirectX) are similar in fact, so learning WebGPU will get you extremely prepared for any of those.

Re: WebGPU – All of the cores, none of the canvas

#92

Earlier quoted context omitted.

Since you mentioned FFT, I wondered whether GPU-based computation would be useful for audio DSP. But then, lots of audio DSP operations run perfectly well even on a low-end CPU. Also, as one tries to reduce latency, the buffer size decreases, thus reducing the potential to exploit parallelism, and I'm guessing that going to the GPU and back adds latency. Still, I guess GPU-based audio DSP could be useful for batch pr…

Yes. Probably the single most effective use of the GPU for audio is convolutional reverb, for which a number of plugins exist. However, the problem is that GPUs are optimized for throughput rather than latency, and it gets worse when multiple applications (including the display compositor) are contending for the same GPU resource - it's not uncommon for dispatches to have to wait multiple milliseconds just to be sche…

Already on it! https://github.com/webonnx/wonnx - runs ONNX neural networks on top of WebGPU (in the browser, or using wgpu on top of Vulkan/DX12/..)

Re: WebGPU – All of the cores, none of the canvas

#93
post #27

For those looking for a complete 3D engine already supporting WebGPU and with a WebGL fallback if needed, there is BabylonJs (you'll need the 5.0 version still in the release candidate state) : https://doc.babylonjs.com/advanced_topics/webGPU/webGPUStatu... ThreeJs is alwo working on its WebGPU renderer

luma.gl is also working on a new version to support WebGPU: https://luma.gl/docs/v9-api

Re: WebGPU – All of the cores, none of the canvas

#94
If anyone wants to play with webgl/webgl2/webgpu/high-perf js, we're looking for a graphics engineer for all sorts of fun viz scaling projects (graphs used by teams tackling misinfo, global supply chains, money laundering, genomics, etc.): https://www.graphistry.com/careers

Agreed with other folks here: We see opportunities to advance over what we did with WebGL (opengl es 2.0 from 10-20 years ago)... but as far as we can tell, still a puzzle to work around missing capabilities relative to what we do with modern opencl/cuda on the server. So definitely an adventure!

Re: WebGPU – All of the cores, none of the canvas

#95

Earlier quoted context omitted.

Hmm the UI is super unresponsive for me. As in, I try to move a slider, I can't tell where it's moving to... then I let go and it's somewhere I didn't expect. Latest Firefox, Windows 10, Radeon RX 6700XT 16GB.

Do other WebGL 2 demos work well for you? Does it work in Chromium? I haven't tested the code extensively so I'm sure it's broken in some configurations. It's just a proof of concept demo for now.

Ah sorry - disregard. I had a background process gobbling up GPU, and now I can use it in Firefox or Edge.

I do find it confusing, as I can put in numbers that get me well below a 3% withdrawal rate, but still have only 40% success rate. But I'm probably misunderstanding some of the mortgage sliders.

Re: WebGPU – All of the cores, none of the canvas

#96

Earlier quoted context omitted.

Do other WebGL 2 demos work well for you? Does it work in Chromium? I haven't tested the code extensively so I'm sure it's broken in some configurations. It's just a proof of concept demo for now.

Ah sorry - disregard. I had a background process gobbling up GPU, and now I can use it in Firefox or Edge. I do find it confusing, as I can put in numbers that get me well below a 3% withdrawal rate, but still have only 40% success rate. But I'm probably misunderstanding some of the mortgage sliders.

Yeah, it's confusing for sure. One day hopefully I'll have time to put a real UI on it. Right now it's assuming you buy a house with a mortgage (and property tax and yearly maintenance costs) at the same time as you retire. Put the house price to zero to eliminate all that. Also the expenses slider is before tax, so the tax rate slider influences how large your withdrawals actually are. The total withdrawal per year is displayed near the bottom.

Re: WebGPU – All of the cores, none of the canvas

#98

If I'm already familiar with Rust, how is WebGPU as an introduction to graphics programming if you aren't already familiar with any of the backends that it wraps? Should I try just learning Vulcan first? Is the abstraction layer just going to introduce additional confusion for a newbie?

Unless you live in windows ONLY, start with wgpu (a Rust library that supports WebGPU). It'll work with Metal/Vulkan/Web. WebGPU is very similar to Vulkan, near a 1:1 in concepts. A lot of the new libraries (Metal, DirectX) are similar in fact, so learning WebGPU will get you extremely prepared for any of those.

I don't see why you wouldn't also use wgpu on Windows

Re: WebGPU – All of the cores, none of the canvas

#99

Earlier quoted context omitted.

If I was developing a new browser today, my graphics abstraction would be WebGPU and all other graphics would be built on it. WebGL, Canvas 2D, SVG, and even DOM rendering would be unprivileged libraries on top and only WebGPU would be able to touch the actual hardware. I wouldn't be surprised if some browsers moved that way in the long term.

I find your ideas intriguing and I wish to subscribe to your newsletter. More seriously, yes, if you were starting a browser completely from scratch, this would probably be a good approach. There are some subtleties, but probably nothing that couldn't be solved with some elbow grease. If anyone is seriously interested in exploring this direction, one thing that would be very interesting is a port of piet-gpu to run o…

By "work with somebody", do you mean your team at Google is hiring for this, or are you looking for community contributors?
Post reply on HN