Couldn't load codegen backend, specified module could not be found
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- rust
调研方向
使用链接的 rust-cuda-basic 项目和 getting started guide 重现该失败,然后检查第 17 行附近的 build.rs 以及 Windows 上加载 rustc_codegen_nvvm DLL 的命令。检查为什么 DLL 路径存在时 LoadLibraryExW 仍报告缺少模块;完成的标准是确定缺少的依赖项或配置,并记录或修正 Windows 构建路径。
由索引模型根据 Issue 内容生成。
描述
Hi,
I'm trying to build the example described in the getting started guide on Windows but I got an error:
> cargo build
Compiling rustc_codegen_nvvm v0.3.0 (https://github.com/rust-gpu/rust-cuda?rev=7fa76f3d717038a92c90bf4a482b0b8dd3259344#7fa76f3d)
Compiling cuda_builder v0.3.0 (https://github.com/rust-gpu/rust-cuda?rev=7fa76f3d717038a92c90bf4a482b0b8dd3259344#7fa76f3d)
Compiling rust-cuda-basic v0.1.0 (D:\workspace\rust-cuda-basic)
error: failed to run custom build command for `rust-cuda-basic v0.1.0 (D:\workspace\rust-cuda-basic)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
process didn't exit successfully: `D:\workspace\rust-cuda-basic\target\debug\build\rust-cuda-basic-11d5ae9c94c06876\build-script-build` (exit code: 101)
--- stdout
cargo::rerun-if-changed=build.rs
cargo::rerun-if-changed=kernels
cargo:rerun-if-changed=D:\workspace\rust-cuda-basic\kernels
--- stderr
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `C:\Users\Carrot\.rustup\toolchains\nightly-2025-08-04-x86_64-pc-windows-msvc\bin\rustc.exe - --crate-name ___ --print=file-names -Zcodegen-backend=D:\workspace\rust-cuda-basic\target\debug\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_75 --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 \\?\D:\workspace\rust-cuda-basic\target\debug\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)
thread 'main' panicked at build.rs:17:10:
called `Result::unwrap()` on an `Err` value: BuildFailed
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/f34ba774c78ea32b7c40598b8ad23e75cdac42a6/library\std\src\panicking.rs:697
1: core::panicking::panic_fmt
at /rustc/f34ba774c78ea32b7c40598b8ad23e75cdac42a6/library\core\src\panicking.rs:75
2: core::result::unwrap_failed
at /rustc/f34ba774c78ea32b7c40598b8ad23e75cdac42a6/library\core\src\result.rs:1852
3: build_script_build::main
4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
But the codegen backend path does exist:
> ls D:\workspace\rust-cuda-basic\target\debug\rustc_codegen_nvvm.dll
Directory: D:\workspace\rust-cuda-basic\target\debug
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 30/11/2025 9:39 am 31755776 rustc_codegen_nvvm.dll
Any idea on what the actual problem is?
I'm using the prebuilt LLVM and CUDA 13.
Repro can be found here.
- 主要语言
- Rust
- 星标
- 5.4k
- 派生
- 249
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Rust-GPU/rust-cuda 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 1/5 1 小时以内 新手友好度 88/100
-
Default NvvmArch::Compute75 silently produces InvalidPtx on pre-Turing GPUs (Pascal/Maxwell/Volta) 未关闭
难度 4/5 3-5 天 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 30/100
-
难度 4/5 3-5 天 新手友好度 55/100
查看 Rust-GPU/rust-cuda 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
bug core
难度 2/5 1-3 小时 新手友好度 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW 未关闭fuzz
难度 2/5 1-3 小时 新手友好度 82/100
ClickHouse/ClickHouse#122114 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
linebender/vello_svg#90 ·
-
难度 2/5 1-3 小时 新手友好度 74/100