-
Notifications
You must be signed in to change notification settings - Fork 180
NVVM IR Invalid data layout when building with Cuda 12.0 #175
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
I'm getting the same error with Cuda 12.8. But I saw on another thread you were able to work with 12.8 - is there a workaround you're using? Output of
Output of
Output of Edit: Fixed, there was an old version of Cuda 12.0 hanging around that needed to be purged properly. |
Haven't needed any workarounds for 12.8 as of yet. I've been using LLVM 7.1.0, but unsure if that would make a difference. If you could share the IR, it could help further. I think all you need to do is call I also have a patch I've been sitting on that updates the data layout. I can push that to a branch if you'd like to try that. |
I do not have anything other than Edit:
Got it. use std::env;
use std::path;
use cuda_builder::CudaBuilder;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=kernels");
let out_path = path::PathBuf::from(env::var("OUT_DIR").unwrap());
let builder = CudaBuilder::new("kernels")
.copy_to(out_path.join("kernels.ptx"))
.final_module_path(out_path.join("kernels.ll"))
.build()
.unwrap();
} generates vecadd example: use cuda_std::prelude::*;
#[kernel]
#[allow(improper_ctypes_definitions, clippy::missing_safety_doc)]
pub unsafe fn vecadd(a: &[f32], b: &[f32], c: *mut f32) {
let idx = thread::index_1d() as usize;
if idx < a.len() {
let elem = unsafe { &mut *c.add(idx) };
*elem = a[idx] + b[idx];
}
}
Edit 2: Confirmed not an issue / "fixed" by not using 12.0 but using 12.8 instead even with apt update
apt-get remove --purge 'cuda-12-0*' 'cuda-*12-0*' 'libcublas-12-0' 'libcublas-dev-12-0' cuda-12.0
apt install pkg-config libssl-dev llvm-7 llvm-7-dev llvm-7-tools clang-7 zlib1g-dev cuda-12-8 |
When using CUDA 12.0, verifying the NVVR IR generated fails with the following error:
The format is deprecated but still works with 12.1 and higher. This might be a bug in the verifier in 12.0 that we can ignore. This would be best fixed by using the supported data layout when using CUDA 12 and up.
The text was updated successfully, but these errors were encountered: