igneum/proto-cuda/build.sh
igneum-labs ff263245ac Igneum: design docs, Metal lottery-hash prototype, CUDA test pack, finality simulation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 15:06:01 +00:00

26 lines
935 B
Bash
Executable file

#!/usr/bin/env bash
# Build igneum-bench-cuda for one program pack (Linux).
# Usage: ./build.sh [pack] [arch]
# pack directory name under packs/ (default igneum-genesis)
# arch nvcc -arch value (default sm_120 = RTX 50 series / Blackwell, needs CUDA 12.8 or newer;
# use "native" to let nvcc pick the installed GPU's architecture)
set -euo pipefail
cd "$(dirname "$0")"
PACK="${1:-igneum-genesis}"
ARCH="${2:-sm_120}"
if ! command -v nvcc >/dev/null 2>&1; then
echo "nvcc not found. Install CUDA Toolkit 12.8 or newer and put its bin/ on PATH (usually /usr/local/cuda/bin)." >&2
exit 1
fi
if [ ! -f "packs/$PACK/kernel.cu" ]; then
echo "no pack at packs/$PACK (expected kernel.cu, program.h, vectors.h)" >&2
exit 1
fi
nvcc --version | tail -n 2
set -x
nvcc -O3 -std=c++17 -arch="$ARCH" -I "packs/$PACK" -o "igneum-bench-cuda-$PACK" host.cu "packs/$PACK/kernel.cu"
set +x
echo "built ./igneum-bench-cuda-$PACK"