-
Notifications
You must be signed in to change notification settings - Fork 182
sha2 crate = runtime error #207
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
Comments
Hi @brandonros , sha2 has a lot of optimizations on the CPU, i.e. AVX2 etc. so these kinds of crates are not available for direct use in CUDA kernel. If we would like to directly use these kinds of crates in the CUDA kernel, we need to write an implementation in these crates and gate by a CUDA alike feature flag. |
I would have guessed the compiler would be able to tell AVX2 was not available and not try to include them. I believe even with this non-AVX2 implementation (soft) the issue still occurs: https://github.com/RustCrypto/hashes/blob/master/sha2/src/sha512/soft.rs https://github.com/RustCrypto/hashes/blob/master/sha2/src/sha512.rs#L2-L4 Any suggestions on how to debug exactly what the problem is or tell the compiler those options aren't available? Are you saying |
The error shown here happens at runtime, so I'm assuming that your GPU crate compiled successfully with the nvvm codegen. If so, then there shouldn't be an issue with the use of the SHA crate. You are however using cudarc, which is a different crate then the one we maintain here and is where the error originates in. While in theory, these should be identical bindings to the cuda driver api, and the ptx generated should be loadable by any program that can load and launch kernels, I've only every used the bindings provided through cust to launch kernels compiled by the nvvm backend. If this issue is in how cudarc launches the kernel, then it might be better to open an issue with them so they can help pinpoint why the kernel is failing to launch, and if it has something to do with the ptx generated from our backend. If you have the same issue launching the kernel with cust, I can look further. |
cudarc replaced with cust: brandonros/ed25519-vanity-rs@2b04c7e _compact functions work (sha2), non-compact do not PTX:
|
Thanks for the extra context. I'll look further. |
Thanks again for all the reports. I won't have as much availability to look into this as I thought but will asap. Or someone else can feel free to look further. |
https://github.com/RustCrypto/hashes/blob/master/sha2/Cargo.toml vs https://github.com/brandonros/rust-ed25519-compact
The text was updated successfully, but these errors were encountered: