-
Notifications
You must be signed in to change notification settings - Fork 652
[LightGBM] build v4.3.0 with OpenCL/CUDA support #8593
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
36e5fb7
build LightGBM v4.3.0 with OpenCL/CUDA support
characat0 89cc382
fix: replace FindCuda with FindCUDAToolkit
characat0 0e0932c
😶 oops
characat0 7c91295
patch switch to findcudatoolkit
characat0 16681bf
boost pin compat
characat0 4fb837d
Update build_tarballs.jl
characat0 1765d5b
fix: add libs to CMAKE_CUDA_FLAGS
characat0 70a89db
Merge branch 'LightGBM-v4.3.0' of https://github.com/characat0/Yggdra…
characat0 457202b
Update L/LightGBM/build_tarballs.jl
giordano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
characat0 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 1ff289b9..e71d5b99 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -198,32 +198,28 @@ if(__INTEGRATE_OPENCL) | ||
| endif() | ||
|
|
||
| if(USE_CUDA) | ||
| - find_package(CUDA 11.0 REQUIRED) | ||
| - include_directories(${CUDA_INCLUDE_DIRS}) | ||
| + find_package(CUDAToolkit 11.0 REQUIRED) | ||
| + include_directories(${CUDAToolkit_INCLUDE_DIRS}) | ||
| set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS} -Xcompiler=-fPIC -Xcompiler=-Wall") | ||
|
|
||
| # 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") | ||
| + set(CUDA_ARCHS "60" "61" "62" "70" "75") | ||
| + if(CUDA_VERSION VERSION_GREATER_EQUAL "110") | ||
| + list(APPEND CUDA_ARCHS "80") | ||
| endif() | ||
| - if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1") | ||
| - list(APPEND CUDA_ARCHS "8.6") | ||
| + if(CUDA_VERSION VERSION_GREATER_EQUAL "111") | ||
| + list(APPEND CUDA_ARCHS "86") | ||
| endif() | ||
| - if(CUDA_VERSION VERSION_GREATER_EQUAL "11.5") | ||
| - list(APPEND CUDA_ARCHS "8.7") | ||
| + if(CUDA_VERSION VERSION_GREATER_EQUAL "115") | ||
| + list(APPEND CUDA_ARCHS "87") | ||
| endif() | ||
| - if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8") | ||
| - list(APPEND CUDA_ARCHS "8.9") | ||
| - list(APPEND CUDA_ARCHS "9.0") | ||
| + if(CUDA_VERSION VERSION_GREATER_EQUAL "118") | ||
| + list(APPEND CUDA_ARCHS "89") | ||
| + list(APPEND CUDA_ARCHS "90") | ||
| 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}) | ||
| - string(REPLACE ";" " " CUDA_ARCH_FLAGS "${CUDA_ARCH_FLAGS}") | ||
| - | ||
| - set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CUDA_ARCH_FLAGS}") | ||
| if(USE_DEBUG) | ||
| set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g") | ||
| else() | ||
| @@ -260,7 +256,7 @@ if(USE_CUDA) | ||
| function(add_histogram hsize hname hadd hconst hdir) | ||
| add_library(histo${hsize}${hname} OBJECT src/treelearner/kernels/histogram${hsize}.cu) | ||
| set_target_properties(histo${hsize}${hname} PROPERTIES CUDA_SEPARABLE_COMPILATION ON) | ||
| - set_target_properties(histo${hsize}${hname} PROPERTIES CUDA_ARCHITECTURES OFF) | ||
| + set_target_properties(histo${hsize}${hname} PROPERTIES CUDA_ARCHITECTURES ${CUDA_ARCHS}) | ||
| if(hadd) | ||
| list(APPEND histograms histo${hsize}${hname}) | ||
| set(histograms ${histograms} PARENT_SCOPE) | ||
| @@ -600,10 +596,10 @@ if(USE_CUDA) | ||
| # Disable cmake warning about policy CMP0104. Refer to issue #3754 and PR #4268. | ||
| # Custom target properties does not propagate, thus we need to specify for | ||
| # each target that contains or depends on cuda source. | ||
| - set_target_properties(lightgbm_objs PROPERTIES CUDA_ARCHITECTURES OFF) | ||
| - set_target_properties(_lightgbm PROPERTIES CUDA_ARCHITECTURES OFF) | ||
| + set_target_properties(lightgbm_objs PROPERTIES CUDA_ARCHITECTURES ${CUDA_ARCHS}) | ||
| + set_target_properties(_lightgbm PROPERTIES CUDA_ARCHITECTURES ${CUDA_ARCHS}) | ||
| if(BUILD_CLI) | ||
| - set_target_properties(lightgbm PROPERTIES CUDA_ARCHITECTURES OFF) | ||
| + set_target_properties(lightgbm PROPERTIES CUDA_ARCHITECTURES ${CUDA_ARCHS}) | ||
| endif() | ||
|
|
||
| set_target_properties(lightgbm_objs PROPERTIES CUDA_SEPARABLE_COMPILATION ON) |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.