Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ jobs:
- run: cd rust && cargo install cargo-lipo
- build_project
- compile_tests

# SupraSeal pulls in a C++ code base, make sure everything compiles properly.
build_linux_supraseal:
executor: golang
resource_class: medium
working_directory: ~/go/src/github.com/filecoin-project/filecoin-ffi
steps:
- configure_environment_variables
- prepare
- run:
name: Build project with `FFI_USE_CUDA_SUPRASEAL=1`
command: FFI_BUILD_FROM_SOURCE=1 FFI_USE_CUDA_SUPRASEAL=1 make

publish_linux_x86_64_staticlib:
executor: golang
resource_class: medium
Expand Down Expand Up @@ -173,6 +186,7 @@ workflows:
- build_and_test_aarch64_linux_cgo_bindings:
run_leak_detector: false
- build_darwin_cgo_bindings
- build_linux_supraseal
- publish_linux_x86_64_staticlib:
filters:
tags:
Expand Down Expand Up @@ -209,7 +223,12 @@ commands:
condition: << parameters.linux >>
steps:
- run: sudo apt-get update
- run: sudo apt-get install --no-install-recommends -y valgrind ocl-icd-opencl-dev libssl-dev libhwloc-dev nvidia-cuda-toolkit
- run: sudo apt-get install --no-install-recommends -y valgrind ocl-icd-opencl-dev libssl-dev libhwloc-dev nvidia-cuda-toolkit g++-10
- run:
name: Downgrade to GCC 10, as CUDA 11 doesn't play nice with GCC 11
command: |
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-10 10
sudo update-alternatives --set c++ /usr/bin/g++-10
- when:
condition: << parameters.darwin >>
steps:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ rm .install-filcrypto \

CUDA for GPU support is now enabled by default in the proofs library. This feature can optionally be replaced by OpenCL by using `FFI_USE_OPENCL=1` set in the environment when building from source. Alternatively, if the CUDA toolkit (such as `nvcc`) cannot be located in the environment, OpenCL support is used instead. To disable GPU support entirely, set `FFI_USE_GPU=0` in the environment when building from source.

There is experimental support for faster C2 named "SupraSeal". To enable it, set `FFI_USE_CUDA_SUPRASEAL=1`. It's specific to CUDA and won't work with OpenCL.

```shell
rm .install-filcrypto \
; make clean \
Expand Down
12 changes: 8 additions & 4 deletions install-filcrypto
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,15 @@ build_from_source() {
# Check if GPU support is disabled.
if [ "${FFI_USE_GPU}" == "0" ]; then
gpu_flags=""
elif [ "${FFI_USE_CUDA_SUPRASEAL}" == "1" ]; then
# If SupraSeal is enabled, just use the `cuda-supraseal` eature and
# nothing else GPU related.
gpu_flags=",cuda-supraseal"
else
# If not, default to CUDA support where possible.
# First ensure that nvcc (as part of the CUDA toolkit) is
# available -- if it's not warn that we are defaulting GPU to
# OpenCL instead.
# If GPUs are enabled and SupraSeal is not, default to CUDA support
# where possible.
# First ensure that nvcc (as part of the CUDA toolkit) is available --
# if it's not warn that we are defaulting GPU to OpenCL instead.
gpu_flags=",cuda"

# Unless OpenCL support is specified or we're building on Darwin.
Expand Down
Loading