diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2023-09-26 16:16:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-09-27 17:28:52 (GMT) |
commit | 4316d4dcfd00bd261f7902de68013522bdb9933b (patch) | |
tree | 8bf21d8b444ffd7c4b1b7f2c105814eb3b31b1a4 /.gitlab | |
parent | 5a79ea2799e27dc78d71ad71cbf7009416e98076 (diff) | |
download | CMake-4316d4dcfd00bd261f7902de68013522bdb9933b.zip CMake-4316d4dcfd00bd261f7902de68013522bdb9933b.tar.gz CMake-4316d4dcfd00bd261f7902de68013522bdb9933b.tar.bz2 |
FindCUDAToolkit: Search all of `nvcc` implicit includes and library dirs
Improves the handling of CUDA layouts where we have multiple include
and library directories listed in the output of `nvcc -v`. This
updates both when the CUDA language is enabled or not.
Fixes: #24915
Diffstat (limited to '.gitlab')
-rw-r--r-- | .gitlab/ci/configure_cuda11.8_splayed_nvidia.cmake | 3 | ||||
-rw-r--r-- | .gitlab/ci/env_cuda11.8_splayed_nvidia.sh | 36 | ||||
-rw-r--r-- | .gitlab/os-linux.yml | 6 |
3 files changed, 45 insertions, 0 deletions
diff --git a/.gitlab/ci/configure_cuda11.8_splayed_nvidia.cmake b/.gitlab/ci/configure_cuda11.8_splayed_nvidia.cmake new file mode 100644 index 0000000..519699b --- /dev/null +++ b/.gitlab/ci/configure_cuda11.8_splayed_nvidia.cmake @@ -0,0 +1,3 @@ +set(CMake_TEST_CUDA "NVIDIA" CACHE STRING "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/env_cuda11.8_splayed_nvidia.sh b/.gitlab/ci/env_cuda11.8_splayed_nvidia.sh new file mode 100644 index 0000000..38e788d --- /dev/null +++ b/.gitlab/ci/env_cuda11.8_splayed_nvidia.sh @@ -0,0 +1,36 @@ +# +# Splay the libraries and includes to emulate conda where +# things are split between the host and build prefix +# +# /usr/local/cuda/include/crt/ -> /tmp/cuda/include/crt +# /usr/local/cuda/lib64/stubs/ -> /tmp/cuda/stubs/ +# /usr/local/cuda/lib64/libcudart* -> /tmp/cuda/libs/ +# +# Also reduce to minimal subset of libraries by removing +# static libraries to emulate a minimal cuda install +mkdir -p /tmp/cuda/libs +mkdir -p /tmp/cuda/stubs +mkdir -p /tmp/cuda/include + +mv /usr/local/cuda/lib64/libcuda* /tmp/cuda/libs +mv /usr/local/cuda/lib64/stubs/ /tmp/cuda/stubs/ +mv /usr/local/cuda/include/crt/ /tmp/cuda/include/ + +# patch the nvcc.profile to handle the splayed layout +# which allows verification +mv /usr/local/cuda/bin/nvcc.profile /usr/local/cuda/bin/nvcc.profile.orig +echo " +TOP = \$(_HERE_)/.. + +NVVMIR_LIBRARY_DIR = \$(TOP)/\$(_NVVM_BRANCH_)/libdevice + +LD_LIBRARY_PATH += \$(TOP)/lib: +PATH += \$(TOP)/\$(_NVVM_BRANCH_)/bin:\$(_HERE_): + +INCLUDES += \"-I\$(TOP)/\$(_TARGET_DIR_)/include\" \$(_SPACE_) \"-I/tmp/cuda/include\" \$(_SPACE_) + +LIBRARIES =+ \$(_SPACE_) \"-L\$(TOP)/\$(_TARGET_DIR_)/lib\$(_TARGET_SIZE_)\" \"-L/tmp/cuda/stubs/\" \"-L/tmp/cuda/libs\" + +CUDAFE_FLAGS += +PTXAS_FLAGS += +" > /usr/local/cuda/bin/nvcc.profile diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index e70dc07..8894057 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -362,6 +362,12 @@ CMAKE_CONFIGURATION: cuda11.8_minimal_nvidia CTEST_NO_WARNINGS_ALLOWED: 1 +.cuda11.8_splayed_nvidia: + extends: .cuda11.8_minimal + variables: + CMAKE_CONFIGURATION: cuda11.8_splayed_nvidia + CTEST_NO_WARNINGS_ALLOWED: 1 + ### HIP builds .hip5.5: |