Skip to content

Commit 528df3c

Browse files
committed
fix windows arm64 cuda 13 build
1 parent 1edd1f5 commit 528df3c

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

cmake/external/cuda_configuration.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ macro(setup_cuda_architectures)
164164
unset(ORT_HAS_SM80_OR_LATER)
165165
unset(ORT_HAS_SM90_OR_LATER)
166166
unset(ORT_HAS_SM100_OR_LATER)
167+
unset(ORT_HAS_SM120_OR_LATER)
167168
foreach(CUDA_ARCH IN LISTS CMAKE_CUDA_ARCHITECTURES_ORIG)
168169
if(CUDA_ARCH MATCHES "^([0-9]+)")
169170
if(CMAKE_MATCH_1 GREATER_EQUAL 80)
@@ -175,6 +176,9 @@ macro(setup_cuda_architectures)
175176
if(CMAKE_MATCH_1 GREATER_EQUAL 100)
176177
set(ORT_HAS_SM100_OR_LATER ON)
177178
endif()
179+
if(CMAKE_MATCH_1 GREATER_EQUAL 120)
180+
set(ORT_HAS_SM120_OR_LATER ON)
181+
endif()
178182
endif()
179183
endforeach()
180184
if(ORT_HAS_SM80_OR_LATER)
@@ -186,6 +190,9 @@ macro(setup_cuda_architectures)
186190
if(ORT_HAS_SM100_OR_LATER)
187191
add_definitions("-DHAS_SM100_OR_LATER")
188192
endif()
193+
if(ORT_HAS_SM120_OR_LATER)
194+
add_definitions("-DHAS_SM120_OR_LATER")
195+
endif()
189196

190197
set(ARCHITECTURES_WITH_KERNELS "80" "86" "89" "90" "100" "110" "120")
191198
foreach(CUDA_ARCH IN LISTS ARCHITECTURES_WITH_KERNELS)

cmake/onnxruntime_providers_cuda_plugin.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,12 @@ if(NOT onnxruntime_DISABLE_CONTRIB_OPS)
357357
if(_cuda_plugin_llm_srcs)
358358
if(MSVC AND NOT onnxruntime_USE_FP4_QMOE)
359359
onnxruntime_filter_cuda_archs(_plugin_llm_cuda_architectures MIN_SM 75 EXCLUDE_SM120_REAL)
360+
# A native-only Windows ARM64 build has no lower architecture left after the
361+
# MSVC SM120 exclusion. Emit PTX privately for this object library so its host
362+
# launchers and device kernels are still linked into the plugin.
363+
if(NOT _plugin_llm_cuda_architectures AND ORT_HAS_SM120_OR_LATER)
364+
set(_plugin_llm_cuda_architectures "120-virtual")
365+
endif()
360366
else()
361367
onnxruntime_filter_cuda_archs(_plugin_llm_cuda_architectures MIN_SM 75)
362368
endif()

0 commit comments

Comments
 (0)