Rust-GPU / Rust-GPU/rust-cuda

Unable do Compile Rust-CUDA because missing CUDNN includes.

Open
#204 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.4k
Forks
249
PR merge metrics
No merged PRs in 30d

Description

Hello everyone,

I am trying to compile Rust-Cuda on Ubuntu 24.04 with Cuda Toolkit 12.8 and driver 550.120. Cargo version is cargo 1.86.0 (adf9b6ad1 2025-02-28). I have just cloned the repository from the main branch.

First, I had problems regarding the Optix SDK. cargo build returned that it could not find the SDK. After digging a bit, I found this line on the optix-sys crate:

const OPTIX_ROOT_ENVS: &[&str] = &["OPTIX_ROOT", "OPTIX_ROOT_DIR"];

So I set OPTIX_ROOT to directory where I placed the SDK, and it worked. But now I got another problem:

error: failed to run custom build command for `cudnn-sys v0.1.0 (/home/npbrust/Rust-CUDA/crates/cudnn-sys)`

Caused by:
  process didn't exit successfully: `/home/npbrust/Rust-CUDA/target/debug/build/cudnn-sys-640a99c44abeadd2/build-script-main` (exit status: 101)
  --- stderr

  thread 'main' panicked at crates/cudnn-sys/build/main.rs:7:42:
  Cannot create cuDNN SDK instance.: "Cannot find cuDNN include directory."
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

So I download the cuDNN (cudnn-linux-x86_64-9.8.0.87_cuda12-archive). After expanding the file, I copied the contents of the include and lib directories into /usr/local/cuda/include and /usr/local/cuda/lib64. cargo build gave me the same error. Then I tried setting the variables CUDNN_INCLUDE_DIR and CUDNN_LIBRARY to the include and lib directories, but that got me nowhere. The question is: how should I point cargo do find the CUDNN includes? Looking at the code for the cudnn_sys crate gave me no directions.

Best Regards.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with crates/cudnn-sys/build/main.rs and reproduce the failure using the reported Ubuntu, CUDA, cuDNN, and cargo versions. Trace how the build script discovers the cuDNN include directory; done means the repository builds with a documented, working include-path configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, ubuntu
Domain
build-system, hpc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.