From 63a882b7400a19485727cc808e4715897e63635a Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 30 Sep 2023 08:34:50 -0500 Subject: [PATCH] [CUDA] drop CUDA 10 support, start supporting CUDA 12 (fixes #5789) (#6099) --- .ci/check_python_dists.sh | 2 +- .github/workflows/cuda.yml | 12 +++++++----- CMakeLists.txt | 15 ++++++++++----- docs/Installation-Guide.rst | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index cb0bbae79fa9..217fd3317f6c 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -25,7 +25,7 @@ if [ $PY_MINOR_VER -gt 7 ]; then pydistcheck \ --inspect \ --ignore 'compiled-objects-have-debug-symbols,distro-too-large-compressed' \ - --max-allowed-size-uncompressed '60M' \ + --max-allowed-size-uncompressed '70M' \ --max-allowed-files 800 \ ${DIST_DIR}/* || exit -1 elif { test $(uname -m) = "aarch64"; }; then diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 9ab8440a6625..3120fb1fae9f 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -31,17 +31,17 @@ jobs: - method: wheel compiler: gcc python_version: "3.11" - cuda_version: "11.7.1" + cuda_version: "11.8.0" task: cuda - method: source compiler: gcc python_version: "3.9" - cuda_version: "10.0" + cuda_version: "12.2.0" task: cuda - method: pip compiler: clang python_version: "3.10" - cuda_version: "11.7.1" + cuda_version: "11.8.0" task: cuda steps: - name: Setup or update software on host machine @@ -98,8 +98,10 @@ jobs: cuda_version="${{ matrix.cuda_version }}" cuda_major=${cuda_version%%.*} docker_img="nvcr.io/nvidia/cuda:${cuda_version}-devel" - if [[ ${cuda_major} -gt 10 ]]; then - docker_img="${docker_img}-ubuntu$(lsb_release -rs)" + if [[ ${cuda_major} -eq 11 ]]; then + docker_img="${docker_img}-ubuntu18.04" + elif [[ ${cuda_major} -ge 12 ]]; then + docker_img="${docker_img}-ubuntu20.04" fi docker run --env-file docker.env -v "$GITHUB_WORKSPACE":"$ROOT_DOCKER_FOLDER" --rm --gpus all "$docker_img" /bin/bash $ROOT_DOCKER_FOLDER/docker-script.sh all-cuda-jobs-successful: diff --git a/CMakeLists.txt b/CMakeLists.txt index 6705ef130052..bcbc569672a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,20 +203,25 @@ if(__INTEGRATE_OPENCL) endif() if(USE_CUDA) - find_package(CUDA 10.0 REQUIRED) + find_package(CUDA 11.0 REQUIRED) include_directories(${CUDA_INCLUDE_DIRS}) set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS} -Xcompiler=-fPIC -Xcompiler=-Wall") - set(CUDA_ARCHS "6.0" "6.1" "6.2" "7.0") - if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") - list(APPEND CUDA_ARCHS "7.5") - endif() + # reference for mapping of CUDA toolkit component versions to supported architectures ("compute capabilities"): + # https://en.wikipedia.org/wiki/CUDA#GPUs_supported + set(CUDA_ARCHS "6.0" "6.1" "6.2" "7.0" "7.5") if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0") list(APPEND CUDA_ARCHS "8.0") endif() if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1") list(APPEND CUDA_ARCHS "8.6") endif() + if(CUDA_VERSION VERSION_GREATER_EQUAL "11.5") + list(APPEND CUDA_ARCHS "8.7") + endif() + if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8") + list(APPEND CUDA_ARCHS "9.0") + endif() list(POP_BACK CUDA_ARCHS CUDA_LAST_SUPPORTED_ARCH) list(APPEND CUDA_ARCHS "${CUDA_LAST_SUPPORTED_ARCH}+PTX") cuda_select_nvcc_arch_flags(CUDA_ARCH_FLAGS ${CUDA_ARCHS}) diff --git a/docs/Installation-Guide.rst b/docs/Installation-Guide.rst index 412f0ec5993a..41f7070d6a9d 100644 --- a/docs/Installation-Guide.rst +++ b/docs/Installation-Guide.rst @@ -635,7 +635,7 @@ On Linux a CUDA version of LightGBM can be built using **CUDA**, **CMake** and * The following dependencies should be installed before compilation: -- **CUDA** 10.0 or later libraries. Please refer to `this detailed guide`_. Pay great attention to the minimum required versions of host compilers listed in the table from that guide and use only recommended versions of compilers. +- **CUDA** 11.0 or later libraries. Please refer to `this detailed guide`_. Pay great attention to the minimum required versions of host compilers listed in the table from that guide and use only recommended versions of compilers. - **CMake** 3.16 or later.