Windows: rustc_codegen_nvvm fails to load due to missing nvvm64_40_0.dll in PATH
还没有人认领这个 Issue。
评估
调研方向
从 examples/cuda/vecadd 使用 cargo build 重现该故障,并检查其 build.rs 对 rustc_codegen_nvvm 的调用。检查 Windows 进程如何定位 nvvm64_40_0.dll,以及是否预期使用 nvvm/bin PATH workaround。Windows 构建能够可靠地加载后端,且无需未记录的手动环境更改,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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:
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
- 主要语言
- Rust
- 星标
- 5.4k
- 派生
- 251
- 平均合并
- 4 天 15 小时
- 30 天内合并 PR
- 4
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Rust-GPU/rust-cuda 的其他 Issue
-
Default NvvmArch::Compute75 silently produces InvalidPtx on pre-Turing GPUs (Pascal/Maxwell/Volta)未关闭
难度 4/5 3-5 天 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 30/100
-
Array parameters lose alignment metadata and ICE on >16 byte alignments可能已有人在做 @Snehal-Reddy 于 164 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 38/100
查看 Rust-GPU/rust-cuda 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
RustCrypto/SSH#596 ·
-
proxy: SQL-over-HTTP turns empty arrays into [""] or [false], or HTTP 500 for int and float arrays未关闭
难度 2/5 1-3 小时 新手友好度 83/100
neondatabase/neon#12965 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
goauthentik/authentik#26867 ·
维护者通常 1 天内回复
-
Table and code-block right borders are clipped when the TOC panel is resized wider than the default未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
api bug macos maintainer-needed p2 triaged
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复