Comments (5)
Will need to test if I can embed the Cuda into the Python module without side effects.
^ I would circle back to this in case it really becomes a problem.
from risc0.
This is dependent on making the CUDA libraries late-binding at runtime rather than binding at compile time. It's been on my TODO list for awhile.
from risc0.
just to ask a clarifying question. Do you mean that, for Linux, if the code is compiled with CUDA but later runs on a platform that does not have the cuda library, the executable will fail because: by default, Rust told Linux dynamic linker to load all the dynamic libraries when the program starts (related to rust-lang/rust#89751), so it would try to load lib-cuda even if the code is never going to actually use it.
There are two solutions:
-
see if one can fix the issue by playing with the linker argument to ask Rust to do it differently. The issue here rust-lang/rust#89751 does not seem to be fully resolved with extra linker arg (rust-lang/cargo#7984 a confirmation. a full-fledged linker script is too hacky.
-
otherwise, manually implement lazy loading (i.e., late binding) here. When the CUDA core is on and is going to call some CUDA functions, it finds the CUDA library and tries to load it (or more specifically, load necessary functions). The problem is that this may require certain changes. Currently, RISC0 is using
cust
. Obviously,cust
does not do lazy loading, but asks Rust to tell LLVM to indicate dynamic linkage. One could changecust-raw
so that all calls to the CUDA library would be redirected to an intermediary that does the function translation, but the side effect is that this is not an officialcust
feature. Note that one does not need to feel guilty to forkcust
---the last release is two years ago.
Is that correct? And if so, what is your plan of attack?
Edited
from risc0.
This is on my TODO and we'll get around to it eventually. Is this really a blocker for you now?
from risc0.
Depends on #1025
from risc0.
Related Issues (20)
- [BUG] Do we need LFS for recursion_zkr.zip? HOT 5
- Enforced prove, lift, join benchmarks HOT 2
- [Feature] Suppress `unused` warnings for GCC as well in Zirgen HOT 3
- risc0-main/examples/smartcore-ml/src Fails HOT 8
- [Feature] zkVM: use register `a7` instead of `t0` to identify ecalls
- [Feature] Support for proving the invalidity of a RISC Zero receipt HOT 2
- [Feature] (Bonsai SDK) Missing trait instances for SessionId
- [BUG] Session Docs Link Deprecated
- [Feature] Multi-CUDA support for further lowering the single-segment latency
- [Feature] `cargo risczero deploy` to upload ELF binaries to Bonsai
- [BUG] Do not download recursion_zkr.zip if DOCS_RS = 1
- [Feature] Split benchmarks
- [Feature] Make CUDA contexts fork-safe in Linux HOT 2
- [Feature] request
- [BUG] Reproducible builds fail on macOS (execstack) HOT 4
- [BUG] Links are broken on zkvm crate landing page HOT 1
- [BUG] broken links on landing page for docs.rs zkvm crate HOT 5
- [BUG] `examples/digital-signature` fails with `--features=risc0-zkvm/metal` HOT 3
- [BUG] Building the entire workspace fails (missing req.) HOT 12
- Have `risc0-build` produce a Solidity contract output for image IDs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from risc0.