Fix: cudnn-sys Windows build include paths#366
Open
CharryWu wants to merge 3 commits intoRust-GPU:mainfrom
Open
Fix: cudnn-sys Windows build include paths#366CharryWu wants to merge 3 commits intoRust-GPU:mainfrom
CharryWu wants to merge 3 commits intoRust-GPU:mainfrom
Conversation
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cudnn-sysWindows cuDNN detection to support modern CUDA Toolkit include paths underC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\….vX.Ydirectories (e.g.v10.6,v12.1,v13.0) under both the legacy cuDNN root and the CUDA Toolkit root.vX.Ydirectory-name matching logic and that multiple Windows CUDA/cuDNN versions are discovered correctly.This change is related to my earlier comment on issue #204, where cuDNN headers could not be found when using newer CUDA/cuDNN layouts.
Details
Windows include path discovery
C:/Program Files/NVIDIA/CUDNN/v9.x/includeC:/Program Files/NVIDIA/CUDNN/v8.x/includeC:/Program Files/NVIDIA/CUDNNC:/Program Files/NVIDIA GPU Computing Toolkit/CUDAvX.Y[.Z…](all numeric components) as a candidate version and add<base>/vX.Y/includeto the search list.cudnn.handcudnn_version.his selected.Helper functions
CudnnSdk::is_vxy_dir_nameto encapsulate thevX.Ypattern check.CudnnSdk::collect_windows_cudnn_include_pathsto gather include paths from one or more base directories.Tests
is_vxy_dir_name_accepts_valid_versionsandis_vxy_dir_name_rejects_invalid_versionsensure the matcher behaves correctly for valid/invalid names.collect_windows_cudnn_include_paths_discovers_multiple_versionscreates a temporary directory structure with:v10.6/include,v12.1/include,v13.0/include(with stubcudnn.handcudnn_version.h),and asserts that only the valid
vX.Y/includedirectories are discovered.Rationale
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\includeand similar, which the previous hard-coded paths did not cover.vX.Ydirectory under the known NVIDIA roots makescudnn-sysmore robust across:Testing
cargo check -p cudnn-syson Windows with:CUDNN_INCLUDE_DIRunset,v13.0CUDA Toolkit install,v12.1,v10.6underC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA.cargo test -p cudnn-sys(Windows):crates/cudnn-sys/build/cudnn_sdk.rspass.Attribution
This bugfix was implemented with the help of Cursor.