You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mahout.apache.org by "andrewmusselman (via GitHub)" <gi...@apache.org> on 2026/05/16 18:21:20 UTC
[I] [Bug] qdp-core does not own its libcudart link directive; build fails on driver-only systems [mahout]
andrewmusselman opened a new issue, #1318:
URL: https://github.com/apache/mahout/issues/1318
### Summary
On Linux systems with the NVIDIA driver installed but without the CUDA Toolkit
(no `nvcc`, no `libcudart.so` — a common setup, since PyTorch ships its own
bundled cudart inside the wheel), `make test_rust` fails with confusing
linker errors like:
```
rust-lld: error: undefined symbol: cudaMemGetInfo
rust-lld: error: undefined symbol: cudaHostAlloc
rust-lld: error: undefined symbol: cudaEventCreateWithFlags
... (12 such symbols)
```
### Root cause
`qdp/qdp-core/src/gpu/cuda_ffi.rs` declares CUDA Runtime API symbols in an
unconditional `unsafe extern "C" { ... }` block, but `qdp-core` itself does
not emit any `cargo:rustc-link-lib=cudart` directive. The only such directive
lives in `qdp/qdp-kernels/build.rs` and is emitted only when `nvcc` is found
on `PATH`.
Build-script `cargo:rustc-cfg` flags are scoped to the crate that emits them.
So when `qdp-kernels`' build script can't find `nvcc`, it sets a
`qdp_no_cuda` cfg **for itself** (correctly stubbing out kernel launchers)
but `qdp-core` has no way to learn about this and keeps declaring extern
references to cudart symbols that nothing links.
`qdp/DEVELOPMENT.md` documents a "no-CUDA build" sanity check using
`cargo build --workspace --lib --release` and `cargo check --workspace --tests`
(emphasis on `check`, not `test`) — so the linker hole is invisible in CI but
trips real users who run the test target.
### Reproduction
On a Linux box with NVIDIA driver but no CUDA Toolkit:
```
make test_rust
```
### Expected
Either the tests link and run (toolkit present), or the build skips them with
a clear message ("CUDA Toolkit required for Rust integration tests").
### Actual
Confusing 50+ line linker error pointing at 12 undefined cudart symbols.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@mahout.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] qdp-core does not own its libcudart link directive; build fails on driver-only systems [mahout]
Posted by "ryankert01 (via GitHub)" <gi...@apache.org>.
ryankert01 closed issue #1318: [Bug] qdp-core does not own its libcudart link directive; build fails on driver-only systems
URL: https://github.com/apache/mahout/issues/1318
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org