Skip to content

Use static cudart - #112

Merged
rapids-bot[bot] merged 3 commits into
rapidsai:mainfrom
KyleFromNVIDIA:static-cudart
May 12, 2026
Merged

Use static cudart#112
rapids-bot[bot] merged 3 commits into
rapidsai:mainfrom
KyleFromNVIDIA:static-cudart

Conversation

@KyleFromNVIDIA

Copy link
Copy Markdown
Member

@KyleFromNVIDIA
KyleFromNVIDIA requested review from a team as code owners May 12, 2026 14:44
@KyleFromNVIDIA
KyleFromNVIDIA requested a review from bdice May 12, 2026 14:44
@KyleFromNVIDIA KyleFromNVIDIA added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels May 12, 2026
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bd10c6d9-dca4-447d-bf1b-7372d6c6a010

📥 Commits

Reviewing files that changed from the base of the PR and between 3c13543 and 7fd415f.

📒 Files selected for processing (1)
  • cpp/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/CMakeLists.txt

📝 Walkthrough

Summary by CodeRabbit

  • Chores

    • Enforced a consistent static CUDA runtime across builds for more predictable packaging.
    • Removed a redundant CUDA runtime host dependency from packaged outputs to simplify installs.
  • Documentation

    • Updated build docs to reflect the revised CUDA/CMake configuration and resulting packaging behavior.

Walkthrough

Removes the CUDA_STATIC_RUNTIME CMake option, hardcodes static CUDA runtime initialization (USE_STATIC ON), updates nvforest++ linking to use CUDA::cudart_static, removes cuda-cudart from conda host requirements, and deletes the option from build docs.

Changes

CUDA static runtime hardening

Layer / File(s) Summary
CMake CUDA static runtime hardcoding
cpp/CMakeLists.txt, python/libnvforest/CMakeLists.txt
Removes the CUDA_STATIC_RUNTIME option and its verbose status; rapids_cuda_init_runtime is called with USE_STATIC ON. nvforest++ now includes CUDA::cudart_static in its public link list. The python CMakeLists no longer sets CUDA_STATIC_RUNTIME before adding the cpp subdirectory.
Conda recipe dependency alignment
conda/recipes/libnvforest/recipe.yaml
Removes the cuda-cudart host requirement from both libnvforest and libnvforest-tests outputs.
Build documentation updates
docs/source/build.rst
Removes the CUDA_STATIC_RUNTIME flag row from the libnvforest++ CMake options table.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • rapidsai/nvforest#89: Modifies the same conda recipe and CMake CUDA static-runtime handling files with related configuration changes.
  • rapidsai/nvforest#87: Adjusts CUDA-related dependencies in the conda recipe (removes CUDA math library dependencies), related to dependency alignment.

Suggested reviewers

  • csadorf
  • hcho3
  • gforsyth
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Use static cudart' directly reflects the main change: unconditionally linking against the static CUDA runtime library across all build configurations.
Description check ✅ Passed The description references a relevant issue that motivated the changes (build-planning issue #235), which is appropriate context for the PR's static CUDA runtime linking updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/CMakeLists.txt`:
- Around line 297-301: The current INTERFACE $<COMPILE_ONLY:CUDA::cudart_static>
on target_link_libraries for ${NVFOREST_CPP_TARGET} only propagates compile info
and will break static consumers at link time; change that generator expression
to a conditional one that applies LINK_ONLY:CUDA::cudart_static when the
consuming target is a static library and omits the CUDA runtime for shared
builds (i.e., replace the COMPILE_ONLY use with a conditional generator
expression that yields $<LINK_ONLY:CUDA::cudart_static> for static-type
consumers of ${NVFOREST_CPP_TARGET} and nothing for shared).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7dac64f1-41cb-4fad-b406-4bfd5cae8bb5

📥 Commits

Reviewing files that changed from the base of the PR and between d35f3fd and 3c13543.

📒 Files selected for processing (1)
  • cpp/CMakeLists.txt

Comment thread cpp/CMakeLists.txt
@KyleFromNVIDIA

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit c00a383 into rapidsai:main May 12, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake conda Relates to conda packaging CUDA/C++ Cython / Python improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants