Skip to content
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

Merged
merged 30 commits into from
Jan 25, 2024
Merged

Fix CUDAToolkit_ROOT #33

merged 30 commits into from
Jan 25, 2024

Conversation

jchen351
Copy link
Contributor

@jchen351 jchen351 commented Jan 24, 2024

This pull request primarily involves changes to the CUDA toolkit configuration in the win-gpu-x64-build.yml GitHub workflow and the CMakeLists.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: Added CUDAToolkit_ROOT environment variable to store the location of the CUDA toolkit.
  • .github/workflows/win-gpu-x64-build.yml: Modified the Download cuda job to download the CUDA toolkit to the workspace directory and added a new Verify Cuda SDK job to print the CUDA toolkit location for verification.
  • .github/workflows/win-gpu-x64-build.yml: Modified the cmake command in the build job to include the CUDAToolkit_ROOT environment variable, ensuring that the build process correctly locates the CUDA toolkit.
  • CMakeLists.txt: Replaced the check_language(CUDA) command with FindCUDAToolkit to find the CUDA toolkit during the configuration process, and added a status message when CUDA is not found.

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)
Copy link
Member

@snnn snnn Jan 24, 2024

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

snnn
snnn previously requested changes Jan 24, 2024
Copy link
Member

@snnn snnn left a 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.

@snnn snnn dismissed their stale review January 25, 2024 00:52

Thanks!

@jchen351 jchen351 merged commit 5824bf1 into main Jan 25, 2024
8 checks passed
@jchen351 jchen351 deleted the Cjian/fix-linux-gpu branch January 25, 2024 01:02
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.

2 participants