Lurker News
I am excited to announce the launch of my e-book on Graphics/WebGPU programming! This project has consumed much of my spare time, during which I developed various tools to facilitate the publishing process, including a code playground and a static site generator that can reference sample codes.

However, I'm feeling burnt out and ready to call it finished, even though it may not feel completely done. Avoiding another abandoned side project has been my primary motivation in reaching this point.

Comments (73) 18 threads

Earlier comments
nickpsecurity1 reply#
Many of us are non-graphics programmers interested in learning to benefit from CUDA-style parallelization. I’ve read they’re mostly incompatible, though. I know there’s vendors supporting OpenCL and Vulkan. I didn’t see many AI projects using them, though. Makes me think cross-platform approaches aren’t great for some reason.

My questions: are there good, native implementations of WebGPU where learning it can replace learning CUDA or ROC for good, GPU utilization? If not, would a book like this teach us enough to easily pick up CUDA etc? Or are they very different to the point we’re better off learning the GPU-specific libraries?

raphlinus#
WebGPU is not yet performance competitive with CUDA, in part because the cooperative matrix multiplication ("tensor cores" in Nvidia-speak) extension is not done yet. That in turn depends on subgroups, which are pretty far along (but not yet shipping).

That said, you can do machine learning in WebGPU, and, if your goal is to ship in a browser, it is viable.
I personally think the performance gap can be closed with some engineering effort, and that WebGPU has the potential to become a real contender, but it's too early to say for sure. Certainly CUDA has a major head-start.

ssahoo#
Great book, thanks for writing it.

Just a low hanging issue. The rendering on mobile viewport especially on Firefox is not ideal. Navigation is broke and content does not scroll well.

kallistisoft#
This is very well polished! Obviously took a lot of hard work and it shows in the results. Well done!

Question: I see the that the code for the examples can be pulled from github, but I don't see anywhere to download the text of the book for offline reading??

danroc2 replies#
Nice work! Thank you for sharing.

I'd like to get excited about WebGPU as well, but I am lacking enough imagination here. Games? 3D animations? What else beyond these obvious applications?
Those who are excited about it: why? what are you planning to build with it?

gizmo#
Webgpu makes sense for anything that needs to render quickly or that needs a lot of control over how things get rendered.

A slideshow program with custom font rendering & line wrapping and nice shader based transitions between slides for instance.
Even something like a terminal/tty is much nicer when it renders at > 60fps with smooth scrolling. Very hard to do with DOM nodes.
Because of the web a generation of programmers has forgotten how fast and responsive applications can be. Webgpu can make the web feel fast again.

beardyw#
I got interested in 3D animation so I took a look at this stuff. I quickly retreated to the safety of three.js!

Load more comments