EXPERT

Writing & Launching Custom GPU Kernels in Rust (PTX & NVVM)

Compile Rust directly to PTX assembly with LLVM nvptx64, embed PTX strings, and launch 3D grid/block kernels. Part of the free Rust Systems & AI Academy — every lesson below is open to everyone, no signup required.

2 lessons310 XP~42 min total100% free

// LESSONS IN THIS MODULE

  1. 01Compiling Rust Directly to PTX via nvptx64-nvidia-cuda20 min · 150 XP

    Writing GPU Kernels in Pure Rust Historically, developers had to write .cu files and compile them with NVIDIA's nvcc compiler. With the LLVM nvptx64-n...

  2. 02Launching 3D Grid/Block Kernels from Safe Rust22 min · 160 XP

    Embedding & Dynamic Launching via cudarc Once compiled, the PTX can be embedded into the host binary using include_str! or dynamically compiled at run...

Explore the full Rust Systems & AI Academy