Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly implement and document cuda feature #1507

Merged
merged 1 commit into from
Sep 29, 2021
Merged

fix: properly implement and document cuda feature #1507

merged 1 commit into from
Sep 29, 2021

Conversation

vmx
Copy link
Contributor

@vmx vmx commented Sep 28, 2021

It's possible to compile rust-fil-proofs to make it run on CUDA instead
of OpenCL. This change also includes the introduction of two new environment
variables. One to control, whether OpenCL or CUDA should be used. The other
to tweak nvcc options.

When the library is built with both CUDA and OpenCL support, you can choose which one to use at run time. Use the environment variable:

```
FIL_PROOFS_GPU_FRAMEWORK=cuda
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting this value on master currently appears to do nothing -- opencl is used in all cases for me unless I specify --features cuda on the command line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's part of this PR.


`FIL_PROOFS_CUDA_NVCC_ARGS="--fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75"`

Note that this environment variable is forwarded to underlying dependencies, which might not be automatically be rebuilt. If you change this variable, best is to start from a clean build.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following cargo clean, running FIL_PROOFS_GPU_FRAMEWORK=opencl cargo test --release --all --features cuda,opencl -- --nocapture --ignored used cuda. Is this expected?

UPDATE: setting BELLMAN_GPU_FRAMEWORK=opencl and NEPTUNE_GPU_FRAMEWORK=opencl does run opencl if added to the above

@cryptonemo cryptonemo mentioned this pull request Sep 29, 2021
10 tasks
It's possible to compile rust-fil-proofs to make it run on CUDA instead
of OpenCL. This change also includes the introduction of two new environment
variables. One to control, whether OpenCL or CUDA should be used. The other
to tweak `nvcc` options.
@cryptonemo
Copy link
Collaborator

Rebased and tested locally -- this works for me. I'll approve if CI is happy.

@cryptonemo cryptonemo merged commit a38bb4f into master Sep 29, 2021
@cryptonemo
Copy link
Collaborator

@vmx please delete the branch when you're ready

@vmx vmx deleted the cuda branch December 19, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants