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 all 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
2 changes: 1 addition & 1 deletion .github/workflows/linux-gpu-x64-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Linux GPU x64 Build"
on: [ workflow_dispatch, pull_request ]
on: [ workflow_dispatch ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/win-gpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ 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"
cuda_dir: "${{ github.workspace }}\\cuda_sdk"
cuda_version: "12.2"

jobs:
Windows-CUDA-12-Build:
Expand All @@ -25,7 +27,8 @@ 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/v${{ env.cuda_version }}" ${{ env.cuda_dir}}

- name: Download OnnxRuntime
run: |
Expand All @@ -42,12 +45,12 @@ jobs:
- name: Git Submodule Update
run: |
git submodule update --init --recursive
# The build machine doesn't have a GPU. So the value of CMAKE_CUDA_ARCHITECTURES doesn't matter.

- name: Build with CMake
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 -T cuda=${{ env.cuda_dir }}\\v${{ env.cuda_version }} .. -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=TRUE
cmake --build . --config Release --parallel

- name: Verify Build Artifacts
Expand Down
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ set(USE_ORT_EXT 0) # "Build with Onnxruntime Extensions tokenizer support"
include(CheckLanguage)
check_language(CUDA)
if (CMAKE_CUDA_COMPILER)
set (CUDA_FOUND TRUE)
message(STATUS "CUDA found CUDAToolkit_VERSION ${CUDAToolkit_VERSION} with CMAKE_CUDA_COMPILER ${CMAKE_CUDA_COMPILER}" )
else()
message(STATUS "CUDA not found")
endif()

if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9)
Expand All @@ -35,7 +37,7 @@ set(PYTHON_ROOT ${PROJECT_SOURCE_DIR}/src/python)

# CUDA Being enabled will make it not a debug build without this option, so all of the C++ headers will complain
# about a mismatch with the actual debug headers and it'll fail to link. I don't know why this happens, or if this is the best fix.
if(USE_CUDA AND CUDA_FOUND AND CMAKE_BUILD_TYPE STREQUAL "Debug")
if(USE_CUDA AND CMAKE_CUDA_COMPILER AND CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(_DEBUG=1)
endif()

Expand All @@ -58,7 +60,7 @@ file(GLOB python_srcs CMAKE_CONFIGURE_DEPENDS
"${PYTHON_ROOT}/*.cpp"
)

if(USE_CUDA AND CUDA_FOUND)
if(USE_CUDA AND CMAKE_CUDA_COMPILER)
# Don't let cmake set a default value for CMAKE_CUDA_ARCHITECTURES
cmake_policy(SET CMP0104 OLD)
enable_language(CUDA)
Expand Down
Loading