-
Notifications
You must be signed in to change notification settings - Fork 191
llvm 19 support #227
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
llvm 19 support #227
Conversation
i'm on the fence about renaming i think it might not actually be needed and i might put it back |
@LegNeato my measuring stick here is does could you tell me if I'm close or if I'm actually missing something huge like a mountain of work I'm not seeing? |
pain |
I don't know, llvm is an area of the project I have not touched. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should stay the same, right? The newer support should be optional / only enabled when
crates/rustc_codegen_nvvm/build.rs
Outdated
static PREBUILT_LLVM_URL: &str = | ||
"https://github.com/rust-gpu/rustc_codegen_nvvm-llvm/releases/download/LLVM-7.1.0/"; | ||
|
||
static REQUIRED_MAJOR_LLVM_VERSION: u8 = 7; | ||
static REQUIRED_MAJOR_LLVM_VERSION: u8 = 19; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The requirement doesn't bump unless targeting a higher arch? So the logic is:
- 7 if targeting arch supported by 7 and 19
- 19 if targeting arch not supported by 7
We should probably break this down, seeing as neither of us understand this space. First, we should probably add various values for arch and stuff to enums on the rust side. Some of these might need to be gated if on 7 vs 19. Then, we should get switching between 7 and a stubbed out / non working 19 via target arch. Then, we should systematically fix each issue and refactor common code on the way. |
ok... kind of a strange remark... i'm just going to work on my local branch and make kernels compile with 19.1 then i was going to work backwards and "make it upstream worthy"... |
i rented some powerful big aws spot VM in the cloud and built it's helping find issues more than a typical llvm release build fyi, just a little tip i'd share i have the "shaved yaks" opinionated way to get that instance if you want, cost me about $3 total |
6b5fd6b
to
3cac1eb
Compare
@LegNeato i'm on the fence about having two rustc_codegen_nvvm_v{{version}} crates 85% copy and pasted but.... i got this to work. vecadd is working at least, going to see if ed25519_vanity_rs compiles later proof: |
@LegNeato i've read multiple conflicting things from multiple "official nvidia sources/documentation" that the new cuda 12.9 toolkit is based on/adds support for either llvm 18, llvm 19, or llvm 20. i can see in their i also question if we need this. this might sound dumb but... what if we used a simple official rust target like riscv64gc-unknown-none-elf, use official rust compiler (no custom nightly, no custom codegen llvm integration) to spit out llvm ir, and then patch it to work with cuda... i totally agree with you/the project's view on "use nvvm to compile llvm ir to ptx" https://github.com/brandonros/vanity-miner-rs/pull/8/files i haven't had a chance to test it yet (working on it) but in terms of thinking outside the box, i was for sure able to get nvvm to accept llvm ir and make what seems to be a "valid ptx" |
i got this working for blackwell a different way. this branch/pr/LLVM v19 integration might work just fine but it's kind of a lot to maintain if there's an "easier" (albeit hackier) way to solve this https://github.com/brandonros/vanity-miner-rs/actions/runs/15809309968/job/44558442212 Build Pipeline
let me know if you actually want this/to put time into it, otherwise blackwell+ might be able to avoid cuda_builder or i'd need to make a cuda_builder that makes this super opinionated rust -> cubin pipeline i made |
potentially addresses all of:
Update rustc_llvm_wrapper to optionally support LLVM v19 #226 (Updates rustc_llvm_wrapper)
GitHub Codespaces/VSCode Devcontainer support #224 (Adds Codespaces, optional, we could remove)
sha2 crate = runtime error #207 (if LLVM v19 will compile and not have same issues as LLVM v7)
CUDA 12.8.1 and LLVM 18.1.8 #197 (we can put this behind a feature flag to optionally support Blackwell+)