Skip to content

Commit c90c1b7

Browse files
committed
gpuCI: Explicitly specify the CUDA toolkit for NVC++ to use with -gpu=cudaX.Y;
the NVC++ "slim" images only contain one CUDA toolkit version, and when used in an environment without GPUs (like our CPU-only builders), it will default to searching for the oldest CUDA toolkit version it supports, even if its not included in the "slim" image.
1 parent c4a014f commit c90c1b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ci/common/build.bash

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ if [[ "${CXX_TYPE}" == "nvcxx" ]]; then
8787
# supported, so we just use makefiles.
8888
append CMAKE_FLAGS "-DCMAKE_CUDA_COMPILER_FORCED=ON"
8989
append CMAKE_FLAGS "-DCMAKE_CUDA_COMPILER_ID=NVCXX"
90+
# We use NVC++ "slim" image which only contain a single CUDA toolkit version.
91+
# When using NVC++ in an environment without GPUs (like our CPU-only
92+
# builders) it unfortunately defaults to the oldest CUDA toolkit version it
93+
# supports, even if that version is not in the image. So, we have to
94+
# explicitly tell NVC++ it which CUDA toolkit version to use.
95+
CUDA_VER=$(echo ${SDK_VER} | sed 's/.*\(cuda[0-9]\+\.[0-9]\+\)/\1/')
96+
append CMAKE_FLAGS "-DCMAKE_CUDA_FLAGS=-gpu=${CUDA_VER}"
9097
# Don't stop on build failures.
9198
append CMAKE_BUILD_FLAGS "-k"
9299
else

0 commit comments

Comments
 (0)