This repository provides a Halo2 prover and verifier with CUDA acceleration on the prover path. The main crate is halo2-axiom-gpu.
gitrustupwith the repo toolchain fromrust-toolchain.toml- An NVIDIA GPU with a working driver
- CUDA toolkit 12.8 or later available on
PATH; verify with:
nvidia-smi
nvcc --versionThis repository builds CUDA code as part of the main crate, so cargo check,
cargo build, and cargo test require a CUDA-capable environment.
The benchmark harness may also need:
wgetto download KZG SRS files viascripts/trusted_setup_s3.shcargo openvmfor rebuilding benchmark guest programssolc0.8.19 for EVM verification flowssamplyand Linuxperffor Firefox profiler traces- NVIDIA Nsight Systems,
nsys, for GPU profiling
halo2-axiom-gpu: The Halo2 proving and verifying crate.benchmarks: End-to-end prove benchmark (fibonacci) with samply and nsys profiling harnesses.
Tests require the same CUDA-capable environment as builds. The CI test command
uses cargo nextest and runs tests single-threaded to avoid oversubscribing GPU
memory:
cargo nextest run --workspace --no-fail-fast --test-threads=1For a standard Cargo test run, use:
cargo test --workspaceThe benchmark and proving flows that need BN254 KZG SRS files use OpenVM's
default params directory, ~/.openvm/params. Download the default range of
params with:
bash ./scripts/trusted_setup_s3.shTo choose a custom directory or range:
bash ./scripts/trusted_setup_s3.sh --params-dir /path/to/params --min-k 5 --max-k 24The benchmark harness runs the Fibonacci guest proving benchmark and writes
metrics to metrics.json:
./benchmarks/run.shTo collect a Firefox profiler trace with samply:
./benchmarks/run.sh --samplyTo collect an NVIDIA Nsight Systems profile:
./benchmarks/run.sh --nsysThe harness uses the checked-in Fibonacci guest ELF at
benchmarks/guest/fibonacci/elf/fibonacci.elf. Rebuild that guest with
cargo openvm when the benchmark guest or its OpenVM dependency state changes.
Dual-licensed under Apache-2.0 or MIT at the user's option.
This codebase builds on prior open-source work:
- ZCash
halo2_proofs: The original implementation that this fork chain descends from. - Privacy Scaling Explorations: The KZG-backed fork that this branch inherits from.
halo2curves: The elliptic-curve and field arithmetic used by this crate.- Supranational
sppark: The Pippenger MSM kernels and several curve/field-arithmetic primitives derive from sppark.