Unverified Commit c9de57b0 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[CUDA] fix setting of CUDA architectures and enable support for NVIDIA Blackwell (#6812)

parent f2b959cd
...@@ -32,7 +32,7 @@ if [ "$PY_MINOR_VER" -gt 7 ]; then ...@@ -32,7 +32,7 @@ if [ "$PY_MINOR_VER" -gt 7 ]; then
--inspect \ --inspect \
--ignore 'compiled-objects-have-debug-symbols'\ --ignore 'compiled-objects-have-debug-symbols'\
--ignore 'distro-too-large-compressed' \ --ignore 'distro-too-large-compressed' \
--max-allowed-size-uncompressed '100M' \ --max-allowed-size-uncompressed '120M' \
--max-allowed-files 800 \ --max-allowed-files 800 \
"$(echo "${DIST_DIR}"/*)" || exit 1 "$(echo "${DIST_DIR}"/*)" || exit 1
elif { test "$(uname -m)" = "aarch64"; }; then elif { test "$(uname -m)" = "aarch64"; }; then
......
...@@ -86,7 +86,7 @@ jobs: ...@@ -86,7 +86,7 @@ jobs:
- method: wheel - method: wheel
compiler: gcc compiler: gcc
python_version: "3.11" python_version: "3.11"
cuda_version: "12.6.1" cuda_version: "12.8.0"
linux_version: "ubuntu22.04" linux_version: "ubuntu22.04"
task: cuda task: cuda
- method: source - method: source
......
...@@ -224,21 +224,28 @@ if(USE_CUDA) ...@@ -224,21 +224,28 @@ if(USE_CUDA)
# reference for mapping of CUDA toolkit component versions to supported architectures ("compute capabilities"): # reference for mapping of CUDA toolkit component versions to supported architectures ("compute capabilities"):
# https://en.wikipedia.org/wiki/CUDA#GPUs_supported # https://en.wikipedia.org/wiki/CUDA#GPUs_supported
set(CUDA_ARCHS "60" "61" "62" "70" "75") set(CUDA_ARCHS "60" "61" "62" "70" "75")
if(CUDA_VERSION VERSION_GREATER_EQUAL "110") if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.0")
list(APPEND CUDA_ARCHS "80") list(APPEND CUDA_ARCHS "80")
endif() endif()
if(CUDA_VERSION VERSION_GREATER_EQUAL "111") if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.1")
list(APPEND CUDA_ARCHS "86") list(APPEND CUDA_ARCHS "86")
endif() endif()
if(CUDA_VERSION VERSION_GREATER_EQUAL "115") if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.5")
list(APPEND CUDA_ARCHS "87") list(APPEND CUDA_ARCHS "87")
endif() endif()
if(CUDA_VERSION VERSION_GREATER_EQUAL "118") if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.8")
list(APPEND CUDA_ARCHS "89") list(APPEND CUDA_ARCHS "89")
list(APPEND CUDA_ARCHS "90") list(APPEND CUDA_ARCHS "90")
endif() endif()
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.8")
list(APPEND CUDA_ARCHS "100")
list(APPEND CUDA_ARCHS "120")
endif()
# Generate PTX for the most recent architecture for forwards compatibility
list(POP_BACK CUDA_ARCHS CUDA_LAST_SUPPORTED_ARCH) list(POP_BACK CUDA_ARCHS CUDA_LAST_SUPPORTED_ARCH)
list(APPEND CUDA_ARCHS "${CUDA_LAST_SUPPORTED_ARCH}+PTX") list(TRANSFORM CUDA_ARCHS APPEND "-real")
list(APPEND CUDA_ARCHS "${CUDA_LAST_SUPPORTED_ARCH}-real" "${CUDA_LAST_SUPPORTED_ARCH}-virtual")
message(STATUS "CUDA_ARCHITECTURES: ${CUDA_ARCHS}")
if(USE_DEBUG) if(USE_DEBUG)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g")
else() else()
...@@ -567,14 +574,14 @@ if(USE_CUDA) ...@@ -567,14 +574,14 @@ if(USE_CUDA)
set_target_properties( set_target_properties(
lightgbm_objs lightgbm_objs
PROPERTIES PROPERTIES
CUDA_ARCHITECTURES ${CUDA_ARCHS} CUDA_ARCHITECTURES "${CUDA_ARCHS}"
CUDA_SEPARABLE_COMPILATION ON CUDA_SEPARABLE_COMPILATION ON
) )
set_target_properties( set_target_properties(
_lightgbm _lightgbm
PROPERTIES PROPERTIES
CUDA_ARCHITECTURES ${CUDA_ARCHS} CUDA_ARCHITECTURES "${CUDA_ARCHS}"
CUDA_RESOLVE_DEVICE_SYMBOLS ON CUDA_RESOLVE_DEVICE_SYMBOLS ON
) )
...@@ -582,7 +589,7 @@ if(USE_CUDA) ...@@ -582,7 +589,7 @@ if(USE_CUDA)
set_target_properties( set_target_properties(
lightgbm lightgbm
PROPERTIES PROPERTIES
CUDA_ARCHITECTURES ${CUDA_ARCHS} CUDA_ARCHITECTURES "${CUDA_ARCHS}"
CUDA_RESOLVE_DEVICE_SYMBOLS ON CUDA_RESOLVE_DEVICE_SYMBOLS ON
) )
endif() endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment