Skip to content

Error compiling vecadd example #232

Closed
@lmzuccarelli

Description

@lmzuccarelli

First of all thanks for rebooting this project.

I followed the prerequisites but used cuda 12.9 , installed llvm 7.1.0 set the LLVM_CONFIG envar and ensured libnvvm was also set.

I'm getting the following error (undefined symbol)

error: failed to run custom build command for `vecadd v0.1.0 (/home/lzuccarelli/Projects/rust-kernel-cuda)`

Caused by:
  process didn't exit successfully: `/home/lzuccarelli/Projects/rust-kernel-cuda/target/release/build/vecadd-c3ca7fb11c812cab/build-script-build` (exit status: 101)
  --- stdout
  cargo::rerun-if-changed=build.rs
  cargo::rerun-if-changed=kernels
  cargo:rerun-if-changed=/home/lzuccarelli/Projects/rust-kernel-cuda/kernels

  --- stderr
  error: failed to run `rustc` to learn about target-specific information

  Caused by:
    process didn't exit successfully: `/home/lzuccarelli/.rustup/toolchains/nightly-2025-03-02-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names -Zcodegen-backend=/home/lzuccarelli/Projects/rust-kernel-cuda/target/release/deps/librustc_codegen_nvvm.so '-Zcrate-attr=feature(register_tool)' '-Zcrate-attr=register_tool(nvvm_internal)' -Zcrate-attr=no_std -Zsaturating_float_casts=false '-Cllvm-args=-arch=compute_61 --override-libm' --target nvptx64-nvidia-cuda --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
    --- stderr
    error: couldn't load codegen backend /home/lzuccarelli/Projects/rust-kernel-cuda/target/release/deps/librustc_codegen_nvvm.so: undefined symbol: _ZN4llvm6Triple9normalizeB5cxx11ENS_9StringRefE


  thread 'main' panicked at /home/lzuccarelli/Projects/Rust-CUDA/crates/cuda_builder/src/lib.rs:542:10:
  Did not find output file in rustc output

Could you perhaps give me some pointers ? I looked into the cuda_builder crate but to be honest I could not really get to the root of the problem

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions