Repository navigation
[GPU] Add cuCascade to contrib - #120803
Conversation
…bing Splits the build-system half of #119502 out of it, so that the pull request there is the aggregation code and its tests alone. What is here: - `cmake/cuda.cmake`: the include half of `ch_gpu::cudart`, which every consumer of `ch_contrib::rmm` needs; `gpu_island_executable`, for the build-time tools on the island; and the shared `libstdc++` the island's host code is compiled against. - `cmake/linux/default_libs.cmake`: where that `libstdc++` is appended, and why the order matters for the Itanium ABI runtime. - `cmake/ccache.cmake`: a compiler launcher for `.cu` as well. - `contrib/cudf-cmake`, `contrib/nvcomp-cmake`, `contrib/CMakeLists.txt`: cuDF and nvcomp as `ch_contrib::` targets. - `contrib/cucascade`, and the `cuCollections` bump it needs. - `base/glibc-compatibility`: the `__isoc23_strto*` aliases and `__libc_single_threaded`, which the island needs because it compiles against the host's headers and links against the sysroot's glibc. - `programs/main.cpp`, `programs/keeper/keeper_main.cpp`: the `dlopen` override lifted in a GPU build, because the CUDA runtime reaches a device no other way. - `.gitignore`: nvcomp is unpacked into `contrib/nvcomp` rather than vendored. `contrib/cucascade` was a gitlink with no `.gitmodules` entry, so `git submodule update --init` could not fetch it. Added it here. `ENABLE_GPU` stays `OFF`, so nothing in a default build changes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [da89a1b] Summary: ❌
AI ReviewSummaryThis PR splits out the build-system half of the planned GPU engine by wiring in PR Metadata
Findings❌ Blockers
Tests
Final Verdict
LLVM Coverage Report |
`programs/main.cpp` and `programs/keeper/keeper_main.cpp` read `USE_GPU`, which `src/Common/config.h.in` defines - and that file is in #119502, not here. Without it the macro is undefined, and `-Wundef -Werror` fails the bare use, which is what the Fast test and `Build (arm_tidy)` reported on `programs/main.cpp:262` and `programs/keeper/keeper_main.cpp:103`. Both files now go with that definition instead. Nothing left here reads `USE_GPU`; everything is behind `ENABLE_GPU`, which cmake defines itself. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The CUDA runtime reaches a device only through `dlopen`, so a build with the GPU engine cannot keep the stub that tells the process there are no shared libraries to load. Both translation units defining it are here. These two guards read `USE_GPU`, which `src/Common/config.h.in` defines, so they belong with that definition rather than with the build island in #120803 - the island alone has no `USE_GPU` and `-Wundef -Werror` rejects the bare use. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Only comments change here; every line of cmake and C is untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
| # It must stay last: both runtimes define `__gxx_personality_v0`, the linker binds the first on the | ||
| # command line, and libstdc++'s does not recognize a libc++ exception - earlier, and the server dies | ||
| # on the first `throw` anywhere. | ||
| if (ENABLE_GPU) |
There was a problem hiding this comment.
Adding ${GPU_LIBSTDCXX_LIBRARY} to global DEFAULT_LIBS makes every Linux executable in an ENABLE_GPU=1 tree depend on the builder's shared libstdc++.so.6, not just binaries that actually link GPU-island code. That breaks the current packaging contract here: packages/clickhouse-common-static.yaml still ships only /usr/bin/clickhouse and /usr/bin/clickhouse-extract-from-config, with no matching libstdc++ runtime bundled or declared.
The glibc-compatibility shim also cannot really paper this over, because the shared libstdc++.so.6 carries its own versioned GLIBC_* requirements. So a GPU-enabled package becomes tied to the distro/GCC runtime it was built on.
Please attach libstdc++ only to the specific final targets that actually consume the GPU island, or explicitly bundle/package the matching runtime.
| .nv_fatbin : { *(.nv_fatbin) } | ||
| } | ||
| ") | ||
| target_link_options (_cudf PRIVATE "$<HOST_LINK:${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld>") |
There was a problem hiding this comment.
fatbin.ld needs to reach the final link that consumes ch_contrib::cudf, but _cudf is a plain add_library(...) target and ClickHouse never sets BUILD_SHARED_LIBS, so this is a static archive in the default build. In that configuration PRIVATE link options stop at the archive and are not propagated to the eventual executable/library, which means the consumer never sees the script that keeps .nvFatBinSegment and .nv_fatbin together.
This line works upstream because cuDF sets BUILD_SHARED_LIBS to ON; here that assumption no longer holds. Please export the script via INTERFACE_LINK_OPTIONS on _cudf, or attach it on the real consumer target once the GPU binary is linked.
`Build (arm_tidy)` was failing on a duplicate `#include <IO/VarInt.h>` in `src/Core/tests/gtest_settings.cpp`, a file this branch does not touch. Master carried that duplicate for a few hours - every PR built in that window failed the same way, and so did master itself - and has since reverted it. Re-running the job replays the same merge commit, so it needs a fresh one. No conflicts. `cmake/ccache.cmake` drops out of the diff: master has that change already. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add cuCascade to contrib. Related #119502
Workflow [PR]
Sync PR [sync-upstream/pr/120803]