Skip to content

Link libcugraph dynamically against libcuvs - #5499

Merged
rapids-bot[bot] merged 5 commits into
rapidsai:mainfrom
bdice:dynamic-libcuvs
May 12, 2026
Merged

rapids-bot[bot] merged 5 commits into
rapidsai:mainfrom
bdice:dynamic-libcuvs

Conversation

@bdice

@bdice bdice commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the cuVS static-link configuration path and always link libcugraph against shared libcuvs
  • add libcuvs as a runtime dependency for conda and wheel builds, and exclude libcuvs.so from wheel bundling
  • re-enable the previously filtered CUDA test matrix entries now that libcugraph.so no longer carries the cuVS JIT LTO cudaLibrary* symbols

Validation

  • build-cugraph -j0
  • ldd cpp/build/conda/cuda-13.1/release/libcugraph.so shows libcuvs.so
  • nm -D --undefined-only cpp/build/conda/cuda-13.1/release/libcugraph.so | rg cudaLibrary returns no matches

Remove the cuVS static-link configuration path and make libcugraph depend on
libcuvs as a shared library for both conda and wheel builds. This moves the
cudaLibrary* runtime requirement out of libcugraph, restores the older CUDA
CI matrix entries, and keeps libcuvs ownership in the libcuvs package/wheel
instead of bundling it into libcugraph.
@bdice
bdice requested review from a team as code owners April 23, 2026 15:34
@bdice
bdice requested a review from AyodeAwe April 23, 2026 15:34
@bdice bdice added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 23, 2026
@bdice bdice self-assigned this Apr 23, 2026
libcugraph now depends on shared libcuvs at runtime. Load libcuvs after
libraft and before libcugraph so wheel imports resolve the new dependency
chain consistently.
@bdice
bdice requested a review from a team as a code owner April 24, 2026 04:46

@jakirkham jakirkham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Bradley! 🙏

Comment on lines 38 to 46
# their symbols
import librmm
import libraft
import libcuvs

librmm.load_library()
libraft.load_library()
libcuvs.load_library()
except ModuleNotFoundError:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the Python change for context

@jakirkham
jakirkham removed the request for review from AyodeAwe May 12, 2026 02:52

@rlratzel rlratzel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from the Python perspective.

@rlratzel

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit 1e6353a into rapidsai:main May 12, 2026
80 checks passed
rapids-bot Bot pushed a commit to rapidsai/cugraph-gnn that referenced this pull request May 14, 2026
## Summary
- restore CUDA 12.2 test matrix coverage removed in #454
- restore Python 3.14 CI coverage removed in #433
- keep the existing arm64 CUDA 12.2 exclusion
- follows the CUDA 12.2 runtime fix from rapidsai/cugraph#5499

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Alex Barghi (https://github.com/alexbarghi-nv)
  - https://github.com/jakirkham

URL: #457
rapids-bot Bot pushed a commit that referenced this pull request Sep 9, 2026
## Summary

- add libcuvs to the libcugraph wheel build requirements
- discover only the libcuvs CMake package prefix exported by the installed wheel during direct C++ builds, so pip devcontainers use the installed libcuvs wheel instead of cloning cuVS
- remove direct NVRTC and nvJitLink dependencies that were added for the old source-built/static cuVS integration; libcuvs now owns those requirements

Part of rapidsai/build-planning#325.

## Root causes

There were two independent gaps after #5499 switched libcugraph to dynamic libcuvs linkage:

1. The libcugraph wheel job installs only the py_build_libcugraph and py_rapids_build_libcugraph dependency sets before running pip wheel --no-deps. libcuvs was a runtime dependency but not a build requirement, so it was absent and rapids_cpm_find fell back to a source build.
2. Pip devcontainers already installed libcuvs-cu12/libcuvs-cu13, but build.sh invokes CMake directly. Unlike scikit-build-core, direct CMake did not consume the wheel cmake.prefix entry point, so it still cloned cuVS into _deps/cuvs-src.

The second gap is fixed with the RAPIDS CMake wheel-prefix discovery helper, filtered to libcuvs. RMM and RAFT must remain source-backed in this direct C++ build so the generated cugraph build-tree package carries complete transitive dependency targets for downstream pylibcugraph configuration.

## Dependency audit

- #5483 added cuda-nvrtc-dev because source-built cuVS compiled a file including nvrtc.h.
- #5479 and #5457 added explicit nvJitLink build/runtime requirements for source-built/static cuVS.
- Those direct requirements are no longer needed with dynamic linkage to the prebuilt libcuvs package. The release/26.10 libcuvs conda and wheel metadata already owns NVRTC and nvJitLink.
- The cutile additions proposed in #5646 are not needed by cuGraph once it stops building cuVS.

I also verified NVIDIA/cuML has the same pip-devcontainer issue: its current CUDA 13.3 pip job installs libcuvs-cu13, then logs CPM: Adding package cuvs and uses _deps/cuvs-src. cuML needs the analogous CMake prefix-discovery change and can then remove its direct cutile workaround separately.

## Validation

Using rapidsai/ci-wheel:26.10-cuda13.3.0-rockylinux8-py3.14:

- reproduced the original failure at e6cb493: CMake cloned cuVS and failed under _deps/cuvs-src because cuda.tile was unavailable
- after this change, CMake reports CPM: Using local package cuvs@26.10.0 and cuvs_DIR points into site-packages/libcuvs
- no _deps/cuvs-src directory is created and CMake configuration completes
- generated CUDA 13.3 pip-devcontainer requirements contain libcuvs-cu13 and no direct cuda-tile, NVRTC, or nvJitLink requirements
- generated CUDA 12 requirements select libcuvs-cu12
- strict RAPIDS dependency generation passes
- pre-commit passes on all changed files

Using ghcr.io/rapidsai/cugraph/devcontainer:26.10-cuda13.3-pip with libcuvs, libraft, and librmm wheels installed:

- reproduced the CI regression caused by exposing every wheel prefix: downstream pylibcugraph generation could not resolve nvtx3::nvtx3-cpp or rapids_logger::rapids_logger from wheel-backed RMM/RAFT exports
- verified the filtered prefix discovery selects source RMM/RAFT and wheel libcuvs
- verified both libcugraph and downstream pylibcugraph CMake configure/generate successfully with all three wheel prefixes present

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - James Lamb (https://github.com/jameslamb)
  - Chuck Hastings (https://github.com/ChuckHastings)

URL: #5654
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants