SHA256 Compute Shader (Kernel) Written in Rust
... with application to Validating the Bitcoin Blockchain
The project consists of two primary goals: 1) implement kernels that validate several blocks' SHA256 hash in the Bitcoin Blockchain in parallel, and 2) investigate using the open-source Vulkan standard as an alternative to CUDA. When compared to an equivalent sequential program run on the CPU, the open source tools were approximately 5 times slower than the sequential algorithm, and the proprietary CUDA was approximately 2 times as fast as the sequential algorithm.
SHA256 on GPU
SHA256 algorithm itself is primarily a sequential algorithm. However, for a variety of applications being able to hash many items in a parallel fashion can be quite beneficial. As an example, we specifically looked at validating the bitcoin blockchain as a benchmark. We compared the Vulkan/Rust API with a CUDA/C implementation.
Read the Full Report.
WebGPU, Vulkan, and Rust-GPU
To see more details, visit the vulkan directory.
Compile the code
Build the C / CPU, CUDA code
make -C c
Build the Rust / Vulkan code
cd vulkan && cargo build --release && cd ..
Generate a plot yourself
This project contains several files directly copied from the OpenSSL project (https://github.com/openssl/openssl), which is under the Apache 2.0 Licence.
The files in question are: