-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CUDA] fix setting of CUDA architectures and enable support for NVIDIA Blackwell #6812
Changes from all commits
2df25bd
f569fac
6918b18
4218424
cca1a03
8648091
f44d835
2fc0a4f
c32e639
9a9c3cb
e6751d9
d9b8c26
b1a9d31
903d9e0
a026971
e9bf0c6
cc09dc0
be70aa5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -224,21 +224,28 @@ if(USE_CUDA) | |||
# reference for mapping of CUDA toolkit component versions to supported architectures ("compute capabilities"): | ||||
# https://en.wikipedia.org/wiki/CUDA#GPUs_supported | ||||
set(CUDA_ARCHS "60" "61" "62" "70" "75") | ||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "110") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "110" means exactly 110 version during comparison, |
||||
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.0") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we call FindCUDAToolkit but not FindCUDA, we get undefined Line 220 in 425395d
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excellent fix, thank you! |
||||
list(APPEND CUDA_ARCHS "80") | ||||
endif() | ||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "111") | ||||
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.1") | ||||
list(APPEND CUDA_ARCHS "86") | ||||
endif() | ||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "115") | ||||
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.5") | ||||
list(APPEND CUDA_ARCHS "87") | ||||
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 "90") | ||||
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(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") | ||||
Comment on lines
+246
to
+247
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the following error:
Borrowed from XGBoost: https://github.com/dmlc/xgboost/actions/runs/13056819151/job/36429848864#step:6:162 |
||||
message(STATUS "CUDA_ARCHITECTURES: ${CUDA_ARCHS}") | ||||
if(USE_DEBUG) | ||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g") | ||||
else() | ||||
|
@@ -567,22 +574,22 @@ if(USE_CUDA) | |||
set_target_properties( | ||||
lightgbm_objs | ||||
PROPERTIES | ||||
CUDA_ARCHITECTURES ${CUDA_ARCHS} | ||||
CUDA_ARCHITECTURES "${CUDA_ARCHS}" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prevent the following error:
|
||||
CUDA_SEPARABLE_COMPILATION ON | ||||
) | ||||
|
||||
set_target_properties( | ||||
_lightgbm | ||||
PROPERTIES | ||||
CUDA_ARCHITECTURES ${CUDA_ARCHS} | ||||
CUDA_ARCHITECTURES "${CUDA_ARCHS}" | ||||
CUDA_RESOLVE_DEVICE_SYMBOLS ON | ||||
) | ||||
|
||||
if(BUILD_CLI) | ||||
set_target_properties( | ||||
lightgbm | ||||
PROPERTIES | ||||
CUDA_ARCHITECTURES ${CUDA_ARCHS} | ||||
CUDA_ARCHITECTURES "${CUDA_ARCHS}" | ||||
CUDA_RESOLVE_DEVICE_SYMBOLS ON | ||||
) | ||||
endif() | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid