mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-08 23:44:00 +03:00
ci: Fix HIP tests on NVIDIA GPUs newer than the CUDA toolkit supports
Extend commit ff8c0e9c10 (ci: Clamp CUDA 'native' architecture to values
supported by its toolkit, 2022-03-14, v3.24.0-rc1~468^2) to avoid HIP
failures due to `nvcc -arch=native`.
This commit is contained in:
1 parent
810e5d3a7a
commit
6189d4e5f9
2 files changed
+9
-1
No files matched your search
@@ -597,6 +597,7 @@
|
||||
variables:
|
||||
CMAKE_CONFIGURATION: hip6.3_nvidia
|
||||
CTEST_LABELS: "HIP"
|
||||
CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP: 1
|
||||
|
||||
### C++ modules
|
||||
|
||||
|
||||
@@ -57,7 +57,14 @@ try_compile(native_archs_compiles
|
||||
COMPILE_DEFINITIONS ${try_compile_flags}
|
||||
OUTPUT_VARIABLE output
|
||||
)
|
||||
verify_output(native)
|
||||
if(native_archs_compiles)
|
||||
verify_output(native)
|
||||
elseif("$ENV{CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP}"
|
||||
AND CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA"
|
||||
AND output MATCHES "Unsupported gpu architecture")
|
||||
# nvcc -arch=native is not affected by the clamp
|
||||
set(native_archs_compiles 1)
|
||||
endif()
|
||||
|
||||
if(all_archs_compiles AND all_major_archs_compiles AND native_archs_compiles)
|
||||
set(CMAKE_HIP_ARCHITECTURES all)
|
||||
|
||||
Reference in new issue
Block a user