Skip to content

Learn GPU Programming in MojošŸ”„ by Solving Puzzles🧩

License

Notifications You must be signed in to change notification settings

modular/mojo-gpu-puzzles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 
Ā 

Repository files navigation

Mojo GPU Puzzles Logo

MojošŸ”„ GPU Puzzles

Learn GPU Programming in MojošŸ”„ Through Interactive Puzzles🧩

Overview • Why Mojo • Getting Started • Development • Community

CI Powered by Mojo Subscribe for Updates Modular Forum Discord

Overview

"For the things we have to learn before we can do them, we learn by doing them." — Aristotle, (Nicomachean Ethics)

Welcome to MojošŸ”„ GPU Puzzles — an interactive approach to learning GPU programming through hands-on puzzle solving. Instead of traditional textbook learning, you'll immediately dive into writing real GPU code and seeing the results.

Start Learning Now šŸ‘‰ https://builds.modular.com/puzzles

šŸ“¬ Subscribe to updates to get notified when new puzzles are released!

Why MojošŸ”„

Mojo represents a revolutionary approach to GPU programming, making massive parallelism accessible while maintaining systems-level performance:

  • šŸ Python-like Syntax with systems programming capabilities
  • ⚔ Zero-cost Abstractions that compile to efficient machine code
  • šŸ›”ļø Strong Type System catching errors at compile time
  • šŸ“Š Built-in Tensor Support with hardware-aware optimizations
  • šŸ”§ Direct Hardware Access to CPU and GPU intrinsics
  • šŸ”„ Cross-Hardware Portability for CPUs and GPUs
  • šŸŽÆ Ergonomic Improvements over traditional C/C++

Getting Started

Prerequisits

You'll need a compatible GPU to run the examples.

  1. Visit https://builds.modular.com/puzzles

  2. Clone this repository

    git clone https://github.com/modular/mojo-gpu-puzzles
    cd mojo-gpu-puzzles
  3. Install a package manager to run the MojošŸ”„ programs:

    Option 1: uv (recommended for users)

    Install:

    curl -fsSL https://astral.sh/uv/install.sh | sh

    Update:

    uv self update

    Create a virtual environment:

    uv venv && source .venv/bin/activate

    Option 2: pixi (recommended for contributors)

    Install:

    curl -fsSL https://pixi.sh/install.sh | sh

    Update:

    pixi self-update
  4. Start solving puzzles!

Development

We use pixi for development as it includes uv and also supports conda packages (like mdbook from the conda-forge channel) needed for development workflows.

# Build and serve the book
pixi run book

# Test solutions on GPU
pixi run tests

# Format code
pixi run format

Contributing

We welcome contributions! Whether it's:

Please feel free to:

  1. Fork the repository
  2. Create your feature branch
  3. Submit a pull request

Community

Subscribe for Updates Modular Forum Discord

Join our vibrant community to discuss GPU programming, share solutions, and get help!

Acknowledgments

License

This project is licensed under the LLVM License - see the LICENSE file for details.

Built with ā¤ļø by the Modular team