modular/mojo-gpu-puzzles

Learn GPU Programming in Mojo🔥 by Solving Puzzles

What it solves

Traditional textbooks can be passive. Mojo GPU Puzzles offers interactive puzzles where you learn GPU programming by actually writing and running code. It makes massive parallelism accessible while keeping systems-level performance.

How it works

You visit puzzles.modular.com, clone the repo, install a package manager (like pixi or uv), and start solving. Each puzzle provides a problem file with a filled-in solution and a skeleton where you fill in the missing code. The solutions and problems are kept in sync, with checks to ensure the skeleton compiles and matches the solution except for the blank sections. The project supports both NVIDIA and AMD GPUs via package manager flags, and includes development commands to build an mdBook.

Who it’s for

Learners who want hands-on GPU programming experience, especially those familiar with Python-like syntax and wanting to use Mojo. Also developers who want to contribute puzzles or fixes.

Highlights

  • Interactive puzzle-based approach (learning by doing)
  • Python-like syntax with systems-level performance
  • Built-in tensor support and direct hardware access
  • Cross-hardware portability (CPU and GPU)
  • Development tooling: auto-checking of puzzle skeletons, compute sanitizers for debugging, and formatting.

Related

  • Project
  • Dispatch
  • Dispatch
  • Dispatch
  • Dispatch