What happens when you run a CUDA kernel?
mezark
234 points
28 comments
June 29, 2026
Related Discussions
Found 5 related stories in 625.6ms across 14,015 title embeddings via pgvector HNSW
- Reverse-engineering Nvidia's CUDA-checkpoint for faster cold starts ilreb · 18 pts · July 09, 2026 · 53% similar
- Alternative(s) to run CUDA on non-Nvidia hardware alok-g · 131 pts · July 14, 2026 · 48% similar
- AutoKernel: Autoresearch for GPU Kernels frozenseven · 44 pts · March 11, 2026 · 48% similar
- CUDA Released in Basic apples2apples · 29 pts · April 01, 2026 · 46% similar
- CUDA-oxide: Nvidia's official Rust to CUDA compiler adamnemecek · 391 pts · May 11, 2026 · 46% similar
Discussion Highlights (8 comments)
fooblaster
The hardware has some open documentation. You don't actually need to read the kernel source to find some of the method documentation or qmd formats. See https://github.com/NVIDIA/open-gpu-doc/blob/master/classes/c...
einpoklum
First - nice writeup which goes into a lot of nooks and crannies. That said, a lot of the user-space "voodoo" is gone if you don't go through CUDA's "runtime API". If you use the driver API, take your kernel source as a string and compile it with NVIDIA's run-time compiler, you'll have better visibility into a lot (not all) of what's going on. For the "raw" version of this, look at: https://github.com/NVIDIA/cuda-samples/tree/master/cpp/0_Int... but for a much more readable, and still fully transparent modern-C++ API version of the same, try this: https://github.com/eyalroz/cuda-api-wrappers/blob/master/exa... that's a sample program for my CUDA API wrappers (header-only) library.
orliesaurus
There are companies whose whole job right now is to optimize kernels so that things run faster. I wonder if those companies are going to be dethroned by some sort of like open source library that can do that really well (I bet Nvidia could release it any day.).. or if they're going to thrive and be acquired by the big providers as a `moat` to speed up their infrerence.
mschuetz
That was an interesting read. Also enjoyed reading about the semaphores in the default stream. It's great that cuda implicitly handles syncing of commands for users and makes parallel commands optional and opt-in via streams, unlike Vulkan which completely unloads the full complexity of syncing to users right from the start.
kinow
I just finished a master's on HPC where I had to take some classes on CUDA, MPI+CUDA, OpenCL. Reading an article like this before the classes would have been a lot helpful! Especially the part just before and after "What does it mean for a warp to be eligible?".
aberrahmane_b
It's very useful. The doorbell and QMD part were the most useful for me, because it connects the CUDA launch syntax to what actually gets submitted to the GPU. Most explanations stop around kernels, blocks and warps, but this made the CPU to driver to GPU path much easier to follow.
saagarjha
Control codes are a little more complicated than the post describes, they're really a table lookup rather than just bits in the control word.
effnorwood
on barra metal?