Skip to content

Commit 474c06b

Browse files
authored
[Unity] Set CMAKE_CUDA_ARCHITECTURES default to native (#16335)
CI images should also be updated to install cmake 3.24
1 parent 45532d7 commit 474c06b

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.18)
1+
cmake_minimum_required(VERSION 3.24)
22
project(tvm C CXX)
33

44
# Utility functions

cmake/modules/CUDA.cmake

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,10 @@ if(USE_CUDA)
3838
list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_CUDA_LIBRARY})
3939
list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_NVRTC_LIBRARY})
4040

41-
# Compatibility with cmake 3.18+
42-
#
43-
# The updates to the cutlass kernels made in TVM PR#16244 require
44-
# symbols provided in cuda 7.5+. While the cuda architecture is
45-
# specified by setting `NVCC_FLAGS` in the `CMakeLists.txt` for each
46-
# kernel, cmake 3.18+ also sets it based on the
47-
# `CMAKE_CUDA_ARCHITECTURES` value. If not set, cmake will explicitly
48-
# pass the compute capability as nvidia's default of 5.2, *EVEN IF* it
49-
# has already been specified in `NVCC_FLAGS`. Because the kernels
50-
# cannot compile with compute capability of 5.2, this causes
51-
# compilation errors.
52-
#
53-
# By setting `CMAKE_CUDA_ARCHITECTURES` to `OFF`, cmake does not add
54-
# 5.2 as a target architecture.
55-
#
56-
# See https://cmake.org/cmake/help/latest/policy/CMP0104.html for
57-
# details on CMake's policy for CUDA architecture flags.
58-
#
59-
# See https://cmake.org/cmake/help/latest/policy/CMP0104.html for the
60-
# default CUDA architecture for each version of CUDA.
61-
set(CMAKE_CUDA_ARCHITECTURES OFF)
41+
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
42+
message(STATUS "CMAKE_CUDA_ARCHITECTURES not set, using native")
43+
set(CMAKE_CUDA_ARCHITECTURES native)
44+
endif()
6245

6346
if(USE_CUDNN)
6447
message(STATUS "Build with cuDNN support")

tests/scripts/task_config_build_gpu.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@ echo set\(USE_PIPELINE_EXECUTOR ON\) >> config.cmake
5454
echo set\(USE_CUTLASS ON\) >> config.cmake
5555
echo set\(USE_CMSISNN ON\) >> config.cmake
5656
echo set\(USE_MSC ON\) >> config.cmake
57-
echo set\(CMAKE_CUDA_ARCHITECTURES 75\) >> config.cmake

0 commit comments

Comments
 (0)