mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Fixing CUDA12 build (#15135)
Removing flags for CUDA architectures not supported in CUDA12 SDK Adding build flags for Hopper architecture, supported in CUDA12 SDK.
This commit is contained in:
parent
efa1262614
commit
559a21c7c3
1 changed files with 8 additions and 4 deletions
|
|
@ -1272,10 +1272,11 @@ if (onnxruntime_USE_CUDA)
|
|||
if (CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11)
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_30,code=sm_30") # K series
|
||||
endif()
|
||||
# 37, 50 still work in CUDA 11 but are marked deprecated and will be removed in future CUDA version.
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_37,code=sm_37") # K80
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_50,code=sm_50") # M series
|
||||
|
||||
if (CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 12)
|
||||
# 37, 50 still work in CUDA 11 but are marked deprecated and will be removed in future CUDA version.
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_37,code=sm_37") # K80
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_50,code=sm_50") # M series
|
||||
endif()
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_52,code=sm_52") # M60
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_60,code=sm_60") # P series
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_70,code=sm_70") # V series
|
||||
|
|
@ -1283,6 +1284,9 @@ if (onnxruntime_USE_CUDA)
|
|||
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11)
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_80,code=sm_80") # A series
|
||||
endif()
|
||||
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_90,code=sm_90") # H series
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr")
|
||||
|
|
|
|||
Loading…
Reference in a new issue