diff options
author | Brad King <brad.king@kitware.com> | 2022-03-15 01:01:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-03-16 17:14:51 (GMT) |
commit | ff8c0e9c10cbd777466d7316abfb671a5eddc947 (patch) | |
tree | 183ea8260640b9308f75faea9b3d87b84c8e3149 /.gitlab | |
parent | d1b48bfabd6157309b3056967e6e30cc0ce07983 (diff) | |
download | CMake-ff8c0e9c10cbd777466d7316abfb671a5eddc947.zip CMake-ff8c0e9c10cbd777466d7316abfb671a5eddc947.tar.gz CMake-ff8c0e9c10cbd777466d7316abfb671a5eddc947.tar.bz2 |
ci: Clamp CUDA 'native' architecture to values supported by its toolkit
The `native` architecture compiles for the host's GPUs, but our CI jobs
may may run on hosts with GPUs newer than supported by their version of
the CUDA toolkit. Add an undocumented environment variable to tell
CMake to clamp the native architecture to that supported by the toolkit.
Without this, we may try to compile for architectures not supported by
the CUDA Toolkit, which fails. Since commit d1b48bfabd (CUDA: Add
support for CUDA_ARCHITECTURES=native, 2022-03-04), our CUDA 9.2 CI job
fails when it runs on a CI host with a GPU architecture newer than that
CUDA 9.2 supports. Clamping the architecture level fixes that.
Do not document this clamp behavior publicly, at least for now.
Users can be responsible for building with a CUDA toolkit recent
enough to support their host's GPUs.
Issue: #22375
Diffstat (limited to '.gitlab')
-rw-r--r-- | .gitlab/os-linux.yml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 669d437..30b4fc3 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -227,6 +227,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" CMAKE_ARCH: x86_64 CTEST_LABELS: "CUDA" + CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP: 1 .cuda9.2_nvidia: extends: .cuda9.2 @@ -242,6 +243,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" CMAKE_ARCH: x86_64 CTEST_LABELS: "CUDA" + CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP: 1 .cuda10.2_nvidia: extends: .cuda10.2 @@ -264,6 +266,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" CMAKE_ARCH: x86_64 CTEST_LABELS: "CUDA" + CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP: 1 .cuda11.6_nvidia: extends: .cuda11.6 |