This repository contains the libraries aimed to provide GPU acceleration for cryptography used in ZKsync project.
In order to work with the workspace, you'll need.
For Bellman CUDA, clone it to a directory of your choice:
git clone [email protected]:matter-labs/era-bellman-cuda.git
Optionally also build it with the following commands (otherwise it will be built automatically while building the gpu-ffi
crate):
cmake -Bera-bellman-cuda/build -Sera-bellman-cuda/ -DCMAKE_BUILD_TYPE=Release
cmake --build era-bellman-cuda/build/
Then add the following variable to your config (.bashrc
/.zshrc
):
export BELLMAN_CUDA_DIR=<PATH_TO>/era-bellman-cuda
Alternatively, if you can't or don't want to install the CUDA toolkit or Bellman CUDA, you can compile the crates in this workspace without a CUDA toolkit installation and Bellman CUDA.
Doing so will result in stubs replacing calls to CUDA API and any GPU device code. The code will compile but any call to one of the stubs will result in an error during runtime.
To compile in this mode, either include the rucstc cfg
flag named no_cuda
, for example by setting the RUSTFLAGS
environment variable to --cfg no_cuda
, or by setting the environment variable ZKSYNC_USE_CUDA_STUBS
to 1
or true
or yes
in any capitalization.
- boojum-cuda
- criterion-cuda
- cudart
- cudart-sys
- cudart-sys-bindings-generator
- gpu-ffi
- gpu-ffi-bindings-generator
- gpu-prover
- shivini
- wrapper-prover
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.