Skip to content

Commit

Permalink
[CUDA] drop CUDA 10 support, start supporting CUDA 12 (fixes #5789) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Sep 30, 2023
1 parent b7418dc commit 63a882b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .ci/check_python_dists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion docs/Installation-Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 63a882b

Please sign in to comment.