-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CUDAToolkit_ROOT #33
Conversation
CMakeLists.txt
Outdated
@@ -11,9 +11,11 @@ set(USE_ORT_EXT 0) # "Build with Onnxruntime Extensions tokenizer support" | |||
|
|||
# Checking if CUDA is supported | |||
include(CheckLanguage) | |||
check_language(CUDA) | |||
if (CMAKE_CUDA_COMPILER) | |||
find_package(CUDAToolkit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't use "find_package" for CUDA. The usage is deprecated.
See: https://cliutils.gitlab.io/modern-cmake/chapters/packages/CUDA.html.
If you want to use FindCUDAToolkit , at least you should keep the original line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use FindCUDAToolkit to find a variety of useful targets and variables even without enabling the CUDA language.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is from the link you sent me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not "Replaced the check_language(CUDA) ". See the link I provided above.
This pull request primarily involves changes to the CUDA toolkit configuration in the
win-gpu-x64-build.yml
GitHub workflow and theCMakeLists.txt
file. The changes ensure that the CUDA toolkit is correctly downloaded and its location is properly defined for subsequent use in the build process.Key changes include:
.github/workflows/win-gpu-x64-build.yml
: AddedCUDAToolkit_ROOT
environment variable to store the location of the CUDA toolkit..github/workflows/win-gpu-x64-build.yml
: Modified theDownload cuda
job to download the CUDA toolkit to the workspace directory and added a newVerify Cuda SDK
job to print the CUDA toolkit location for verification..github/workflows/win-gpu-x64-build.yml
: Modified thecmake
command in thebuild
job to include theCUDAToolkit_ROOT
environment variable, ensuring that the build process correctly locates the CUDA toolkit.CMakeLists.txt
: Replaced thecheck_language(CUDA)
command withFindCUDAToolkit
to find the CUDA toolkit during the configuration process, and added a status message when CUDA is not found.