Skip to content

build(cudnn-sys): Add CUDNN_INCLUDE_DIR#213

Merged
LegNeato merged 2 commits intoRust-GPU:mainfrom
giantcow:cudnn-env-var
May 21, 2025
Merged

build(cudnn-sys): Add CUDNN_INCLUDE_DIR#213
LegNeato merged 2 commits intoRust-GPU:mainfrom
giantcow:cudnn-env-var

Conversation

@giantcow
Copy link
Copy Markdown
Contributor

Enables users to specify a non-standard cuDNN install path. This seems to be needed for the newer editions of the CUDA toolkit, as cuDNN isn't included by default (at least in the Fedora repo's, you have to install from a tarball)

Enables users to specify a non-standard cuDNN install path. This seems
to be needed for the newer editions of the CUDA toolkit, as cuDNN isn't
included by default (at least in the Fedora repo's, you have to install
from a tarball)
Copy link
Copy Markdown
Contributor

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and welcome to the project 🍻 !

I think it would be a bit more idiomatic like:

let mut cudnn_paths: Vec<&Path> = CUDNN_DEFAULT_PATHS.iter().map(Path::new).collect();
if let Some(override_path) = env::var_os("CUDNN_INCLUDE_DIR") {
    cudnn_paths.push(Path::new(&override_path));
}

cudnn_paths
    .iter()
    .find(|p| Self::is_cudnn_include_path(p))
    .map(|p| p.to_path_buf())
    .ok_or("Cannot find cuDNN include directory.".into())

@giantcow giantcow requested a review from LegNeato May 20, 2025 06:00
@LegNeato LegNeato merged commit c41862a into Rust-GPU:main May 21, 2025
7 checks passed
@LegNeato
Copy link
Copy Markdown
Contributor

Thanks again for the PR! 🥳

LegNeato pushed a commit to LegNeato/Rust-CUDA that referenced this pull request Jul 12, 2025
* build(cudnn-sys): Add CUDNN_INCLUDE_DIR

Enables users to specify a non-standard cuDNN install path. This seems
to be needed for the newer editions of the CUDA toolkit, as cuDNN isn't
included by default (at least in the Fedora repo's, you have to install
from a tarball)
@CharryWu
Copy link
Copy Markdown
Contributor

This env var is useful for me to supply the latest v13.0 CUDA include path to enable build for cudnn-sys module. The hardcoded windows system default include path is outdated and only supports cuda v8 v9

Enables users to specify a non-standard cuDNN install path. This seems to be needed for the newer editions of the CUDA toolkit, as cuDNN isn't included by default (at least in the Fedora repo's, you have to install from a tarball)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants