Documentation Index
Fetch the complete documentation index at: https://mintlify.com/provablehq/snarkvm/llms.txt
Use this file to discover all available pages before exploring further.
Overview
SnarkVM provides CUDA acceleration support for computationally intensive cryptographic operations. By leveraging GPU parallelism, you can significantly improve performance for operations like multi-scalar multiplication (MSM), polynomial operations, and number-theoretic transforms (NTT).Build Requirements
Supported GPUs
- Volta (compute capability 7.0): Tesla V100, Titan V
- Turing (compute capability 7.5): RTX 20 series, GTX 16 series
- Ampere (compute capability 8.0+): RTX 30 series, A100, A40
- Ada Lovelace (compute capability 8.9): RTX 40 series
- Hopper (compute capability 9.0): H100
Enabling CUDA Support
In Your Project
Add SnarkVM with thecuda feature to your Cargo.toml:
Cargo.toml
Building from Source
When building SnarkVM with CUDA support:Running Benchmarks with CUDA
CUDA Implementation Details
The CUDA implementation is located inalgorithms/cuda/ and provides accelerated versions of:
Multi-Scalar Multiplication (MSM)
ComputesΣ(scalar[i] * point[i]) efficiently using GPU parallelism:
Number-Theoretic Transform (NTT)
In-place NTT computation for polynomial operations:domain_size: Must be a power of 2NTTInputOutputOrder:NN,NR,RN, orRR(Normal/Reversed)NTTDirection:ForwardorInverseNTTType:StandardorCoset
Polynomial Multiplication
Accelerated polynomial multiplication for proof generation:Configuration
The CUDA build configuration is managed inalgorithms/cuda/Cargo.toml:
Build Script Configuration
Thebuild.rs script automatically detects CUDA availability:
Performance Considerations
When to Use CUDA
Ideal Use Cases:- Proof generation with large constraint systems
- Batch processing of cryptographic operations
- Mining and puzzle solving operations
- Large-scale MSM computations (>10,000 points)
- Small computations (overhead exceeds benefit)
- Systems without compatible NVIDIA GPUs
- Memory-constrained environments
Performance Gains
Expected speedup compared to CPU implementation:- MSM (10K points): 5-15x faster
- MSM (1M points): 20-50x faster
- NTT operations: 10-30x faster
- Polynomial multiplication: 15-40x faster
Actual performance depends on GPU model, problem size, and memory bandwidth. Smaller problem sizes may see diminished speedup due to kernel launch overhead.
Troubleshooting
NVCC Not Found
If you see “nvcc must be in the path”:Compute Capability Errors
If your GPU is older than sm_70:Out of Memory Errors
For large computations:Platform-Specific Notes
Linux
- Most widely tested platform
- Recommended for production use
- Full support for all CUDA features
Windows
- Requires MinGW or Clang toolchain (MSVC not supported)
- May require additional configuration
- Set
CCandCXXenvironment variables if needed
macOS
CUDA is not supported on macOS (no NVIDIA drivers since macOS 10.14).Feature Flags
Enable CUDA in your workspaceCargo.toml:
Related Topics
- Storage Modes - Optimize data storage for GPU workflows
- Custom Networks - Configure networks for testing CUDA performance