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
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
53cfd4a
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
0316086
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
5d76248
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
88c815c
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
5505cf8
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
d9d00d3
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
31e4e98
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
4ab0a6a
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
9f36534
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
d23eeb2
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
8e93216
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
5c59598
Fix CUDAToolkit_ROOT
jchen351 Jan 24, 2024
9b9a0ef
set CUDAToolkit_ROOT
jchen351 Jan 24, 2024
b9812e3
set CUDAToolkit_ROOT
jchen351 Jan 24, 2024
607b7d8
set CUDAToolkit_ROOT
jchen351 Jan 24, 2024
36983f0
set CUDAToolkit_ROOT
jchen351 Jan 24, 2024
cff8ce6
Set CMAKE_CUDA_COMPILER
jchen351 Jan 24, 2024
14d6775
Set CMAKE_CUDA_COMPILER
jchen351 Jan 24, 2024
7fed7a3
Merge branch 'main' into Cjian/fix-linux-gpu
jchen351 Jan 24, 2024
5be930b
fix yml error
jchen351 Jan 24, 2024
3e97f2f
fix yml error
jchen351 Jan 24, 2024
e2f74a8
fix yml error
jchen351 Jan 24, 2024
352b83b
fix yml error
jchen351 Jan 24, 2024
52d2265
fix yml error
jchen351 Jan 24, 2024
960bd4a
fix yml error
jchen351 Jan 25, 2024
b757f1b
fix yml error
jchen351 Jan 25, 2024
ba2b75f
Disable linux build for now.
jchen351 Jan 25, 2024
11e2c2a
Try to remove -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=TRUE
jchen351 Jan 25, 2024
a30bb35
Adding check language CUDA back
jchen351 Jan 25, 2024
c557c2e
changing CMAKE_CUDA_COMPILER
jchen351 Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/win-gpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
ort_dir: "onnxruntime-win-x64-gpu-1.16.3"
ort_zip: "onnxruntime-win-x64-gpu-1.16.3.zip"
ort_url: "https://github.com/microsoft/onnxruntime/releases/download/v1.16.3/onnxruntime-win-x64-gpu-1.16.3.zip"
CUDAToolkit_ROOT: "${{ github.workspace }}\\cuda_sdk\\v12.2"

jobs:
Windows-CUDA-12-Build:
Expand All @@ -25,7 +26,13 @@ jobs:
architecture: 'x64'

- name: Download cuda
run: azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v12.2" cuda_sdk
run: |
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v12.2" ${{ github.workspace }}\cuda_sdk

- name: Verify Cuda SDK
if: always()
run: |
echo "${{ env.CUDA_TOOLKIT_ROOT_DIR }}"

- name: Download OnnxRuntime
run: |
Expand All @@ -47,7 +54,7 @@ jobs:
run: |
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 .. -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=TRUE
cmake -G "Visual Studio 17 2022" -A x64 .. -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=TRUE -DCUDAToolkit_ROOT=${{ env.CUDAToolkit_ROOT }}
cmake --build . --config Release --parallel

- name: Verify Build Artifacts
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

if (CUDAToolkit_FOUND)
set (CUDA_FOUND TRUE)
else()
message(STATUS "CUDA not found")
endif()

if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9)
Expand Down
Loading