Skip to content

Windows: rustc_codegen_nvvm fails to load due to missing nvvm64_40_0.dll in PATH #220

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

Open
stevefan1999-personal opened this issue May 28, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@stevefan1999-personal
Copy link

stevefan1999-personal commented May 28, 2025

I noticed rustc_codegen_nvvm is yapping on Windows:

error: failed to run custom build command for `vecadd v0.1.0 (F:\Git\github.com\rust-gpu\Rust-CUDA\examples\cuda\vecadd)`

Caused by:
  process didn't exit successfully: `F:\Git\github.com\rust-gpu\Rust-CUDA\target\debug\build\vecadd-06fc7e2d750a3fd2\build-script-build` (exit code: 101)
  --- stdout
  cargo::rerun-if-changed=build.rs
  cargo::rerun-if-changed=kernels
  cargo:rerun-if-changed=F:\Git\github.com\rust-gpu\Rust-CUDA\examples\cuda\vecadd\kernels

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

  Caused by:
    process didn't exit successfully: `sccache C:\Users\steve\scoop\persist\rustup\.rustup\toolchains\nightly-2025-03-02-x86_64-pc-windows-msvc\bin\rustc.exe - --crate-name ___ --print=file-names -Zcodegen-backend=F:\Git\github.com\rust-gpu\Rust-CUDA\target\debug\deps\rustc_codegen_nvvm.dll -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 code: 1)
    --- stderr
    error: couldn't load codegen backend \\?\F:\Git\github.com\rust-gpu\Rust-CUDA\target\debug\deps\rustc_codegen_nvvm.dll: LoadLibraryExW failed: The specified module could not be found. (os error 126) (The specified module could not be found. (os error 126)) (retried 5 times)

Then I noticed nvvm64_40_0.dll maybe missing:
Image

Indeed, adding nvvm folder to the PATH env fixed it:

$env:PATH += ";C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9\nvvm\bin"
PS> cargo build
// just works
@LegNeato LegNeato added the bug Something isn't working label May 28, 2025
@LegNeato
Copy link
Contributor

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants