Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.09 KB

File metadata and controls

58 lines (41 loc) · 1.09 KB

Setup

This project needs an NVIDIA GPU and the CUDA Toolkit. It targets Linux, WSL2, or a CUDA-enabled remote machine (cloud GPU instances work well).

Requirements

  • NVIDIA GPU with CUDA support
  • CUDA Toolkit 12.x with nvcc
  • CMake 3.20 or newer
  • A C++17-capable host compiler
  • Optional: Nsight Compute, available as ncu

Check the environment:

./scripts/check_cuda_env.sh

Build

Pick the CUDA architecture for your GPU:

GPU family CMake value
Turing / RTX 20-series 75
Ampere / RTX 30-series 86
Ada / RTX 40-series 89
Hopper / H100 90

Then build:

cmake -S . -B build -DCMAKE_CUDA_ARCHITECTURES=86
cmake --build build -j

Validate

ctest --test-dir build --output-on-failure
./build/matmul --test

Run

./build/matmul --kernel 2 --size 1024
./build/matmul --bench --output benchmarks/results.csv

For large benchmark sizes, CPU reference timing and verification can take a while. For quick iteration on one GPU kernel, use smaller sizes first:

./build/matmul --kernel 2 --size 256