diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index 96d70577f5..ede657bccd 100644 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -15,7 +15,7 @@ function hasArg { # Set path and build parallel level export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH -export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4} +export PARALLEL_LEVEL=${PARALLEL_LEVEL:-8} export CUDA_REL=${CUDA_VERSION%.*} # Set home to the job's workspace diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 071b5dbed6..07042217e5 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -15,7 +15,7 @@ #============================================================================= cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR) -file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.10/RAPIDS.cmake +file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.12/RAPIDS.cmake ${CMAKE_BINARY_DIR}/RAPIDS.cmake) include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) include(rapids-cmake) @@ -100,8 +100,10 @@ endif() # add third party dependencies using CPM rapids_cpm_init() +# thrust and libcudacxx need to be before cuco! include(cmake/thirdparty/get_thrust.cmake) include(cmake/thirdparty/get_rmm.cmake) +include(cmake/thirdparty/get_libcudacxx.cmake) include(cmake/thirdparty/get_cuco.cmake) if(BUILD_TESTS) diff --git a/cpp/cmake/libcudacxx.patch b/cpp/cmake/libcudacxx.patch new file mode 100644 index 0000000000..3cdc40ef08 --- /dev/null +++ b/cpp/cmake/libcudacxx.patch @@ -0,0 +1,21 @@ +diff --git a/include/cuda/std/detail/__config b/include/cuda/std/detail/__config +index d55a43688..654142d7e 100644 +--- a/include/cuda/std/detail/__config ++++ b/include/cuda/std/detail/__config +@@ -23,7 +23,7 @@ + #define _LIBCUDACXX_CUDACC_VER_MINOR __CUDACC_VER_MINOR__ + #define _LIBCUDACXX_CUDACC_VER_BUILD __CUDACC_VER_BUILD__ + #define _LIBCUDACXX_CUDACC_VER \ +- _LIBCUDACXX_CUDACC_VER_MAJOR * 10000 + _LIBCUDACXX_CUDACC_VER_MINOR * 100 + \ ++ _LIBCUDACXX_CUDACC_VER_MAJOR * 100000 + _LIBCUDACXX_CUDACC_VER_MINOR * 1000 + \ + _LIBCUDACXX_CUDACC_VER_BUILD + + #define _LIBCUDACXX_HAS_NO_LONG_DOUBLE +@@ -64,7 +64,7 @@ + # endif + #endif + +-#if defined(_LIBCUDACXX_COMPILER_MSVC) || (defined(_LIBCUDACXX_CUDACC_VER) && (_LIBCUDACXX_CUDACC_VER < 110500)) ++#if defined(_LIBCUDACXX_COMPILER_MSVC) || (defined(_LIBCUDACXX_CUDACC_VER) && (_LIBCUDACXX_CUDACC_VER < 1105000)) + # define _LIBCUDACXX_HAS_NO_INT128 + #endif diff --git a/cpp/cmake/thirdparty/get_cuco.cmake b/cpp/cmake/thirdparty/get_cuco.cmake index 33e28ff622..a0c0faf0a9 100644 --- a/cpp/cmake/thirdparty/get_cuco.cmake +++ b/cpp/cmake/thirdparty/get_cuco.cmake @@ -22,7 +22,7 @@ function(find_and_configure_cuco VERSION) INSTALL_EXPORT_SET raft-exports CPM_ARGS GIT_REPOSITORY https://github.com/NVIDIA/cuCollections.git - GIT_TAG 729857a5698a0e8d8f812e0464f65f37854ae17b + GIT_TAG f0eecb203590f1f4ac4a9f1700229f4434ac64dc OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF" diff --git a/cpp/cmake/thirdparty/get_libcudacxx.cmake b/cpp/cmake/thirdparty/get_libcudacxx.cmake new file mode 100644 index 0000000000..e18b912ba7 --- /dev/null +++ b/cpp/cmake/thirdparty/get_libcudacxx.cmake @@ -0,0 +1,26 @@ +# ============================================================================= +# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# ============================================================================= + +# This function finds libcudacxx and sets any additional necessary environment variables. +function(find_and_configure_libcudacxx) + include(${rapids-cmake-dir}/cpm/libcudacxx.cmake) + + rapids_cpm_libcudacxx( + BUILD_EXPORT_SET raft-exports INSTALL_EXPORT_SET raft-exports PATCH_COMMAND patch + --reject-file=- -p1 -N < ${RAFT_SOURCE_DIR}/cmake/libcudacxx.patch || true + ) + +endfunction() + +find_and_configure_libcudacxx()