Skip to content

Conversation

@bdice
Copy link
Contributor

@bdice bdice commented Dec 9, 2025

This PR removes the CUDA_STATIC_RUNTIME option and always uses static linking for the CUDA runtime (cudart_static).

Changes

  • Remove CUDA_STATIC_RUNTIME option from cpp/CMakeLists.txt
  • Change rapids_cuda_init_runtime(USE_STATIC ${CUDA_STATIC_RUNTIME}) to rapids_cuda_init_runtime(USE_STATIC ON)
  • Remove set(CUDA_STATIC_RUNTIME ON) from Python CMakeLists.txt files

Motivation

Static linking embeds the CUDA runtime into binaries, eliminating runtime dependency on cuda-cudart conda packages and simplifying deployment.

Related

Summary by CodeRabbit

  • Chores
    • CUDA runtime now links statically by default; the user-configurable static-runtime option removed.
    • Removed obsolete commented directives related to CUDA static linking.
    • Dropped explicit CUDA development runtime from host build requirements and removed corresponding runtime-suppression entries from package exports.
    • Updated copyright/SPDX year ranges across build and packaging files.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

📝 Walkthrough

Walkthrough

Removed the CUDA_STATIC_RUNTIME CMake option and hard-coded static CUDA runtime linking (USE_STATIC ON); removed commented/static-linking lines and updated SPDX years in CMake files; conda recipes removed cuda-cudart-dev from host requirements and dropped cuda-cudart from ignore_run_exports/by_name.

Changes

Cohort / File(s) Summary
CMake: enforce static CUDA runtime
cpp/CMakeLists.txt
Removed public option CUDA_STATIC_RUNTIME; replaced rapids_cuda_init_runtime(USE_STATIC ${CUDA_STATIC_RUNTIME}) with rapids_cuda_init_runtime(USE_STATIC ON) and updated SPDX year.
CMake: wheel/build cleanup
python/libcuopt/CMakeLists.txt, python/cuopt/cuopt/linear_programming/CMakeLists.txt
Removed set(CUDA_STATIC_RUNTIME ON) and related commented notes in CUOPT_BUILD_WHEELS/wheel blocks; updated SPDX year range in one CMakeLists.
Conda: remove cuda-cudart-dev and run_exports suppression
conda/recipes/cuopt/recipe.yaml, conda/recipes/libcuopt/recipe.yaml
Dropped cuda-cudart-dev from host requirements; removed cuda-cudart entries from ignore_run_exports/by_name across affected outputs; updated SPDX year metadata.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: enforcing static linkage for the CUDA runtime by removing the optional configuration and making it mandatory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a86f21c and 41e4565.

📒 Files selected for processing (1)
  • conda/recipes/libcuopt/recipe.yaml
💤 Files with no reviewable changes (1)
  • conda/recipes/libcuopt/recipe.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.12, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.10, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.10, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.13, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.13, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.11, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.11, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.12, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-sh-client / 13.0.2, 3.10, amd64, rockylinux8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

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

I believe we are missing changes to conda/recipes/*, and dependencies.yaml ( usage of nvidia-cudart )

@bdice bdice added breaking Introduces a breaking change improvement Improves an existing functionality labels Dec 10, 2025
@tmckayus tmckayus added this to the 26.02 milestone Dec 10, 2025
@github-actions
Copy link

🔔 Hi @anandhkb, this pull request has had no activity for 7 days. Please update or let us know if it can be closed. Thank you!

If this is an "epic" issue, then please add the "epic" label to this issue.
If it is a PR and not ready for review, then please convert this to draft.
If you just want to switch off this notification, then use the "skip inactivity reminder" label.

@rgsl888prabhu
Copy link
Collaborator

How much increase in library size should we expect ?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3417689 and a86f21c.

📒 Files selected for processing (5)
  • conda/recipes/cuopt/recipe.yaml
  • conda/recipes/libcuopt/recipe.yaml
  • cpp/CMakeLists.txt
  • python/cuopt/cuopt/linear_programming/CMakeLists.txt
  • python/libcuopt/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (2)
  • conda/recipes/cuopt/recipe.yaml
  • python/cuopt/cuopt/linear_programming/CMakeLists.txt
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Check that hard-coded GPU device IDs and resource limits are made configurable; abstract multi-backend support for different CUDA versions
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Check that hard-coded GPU device IDs and resource limits are made configurable; abstract multi-backend support for different CUDA versions

Applied to files:

  • cpp/CMakeLists.txt
  • python/libcuopt/CMakeLists.txt
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*benchmark*.{cpp,cu,py} : Include performance benchmarks and regression detection for GPU operations; verify near real-time performance on million-variable problems

Applied to files:

  • cpp/CMakeLists.txt
  • python/libcuopt/CMakeLists.txt
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Track GPU device memory allocations and deallocations to prevent memory leaks; ensure cudaMalloc/cudaFree balance and cleanup of streams/events

Applied to files:

  • cpp/CMakeLists.txt
  • python/libcuopt/CMakeLists.txt
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Refactor code duplication in solver components (3+ occurrences) into shared utilities; for GPU kernels, use templated device functions to avoid duplication

Applied to files:

  • cpp/CMakeLists.txt
  • python/libcuopt/CMakeLists.txt
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*test*.{cpp,cu,py} : Ensure test isolation: prevent GPU state, cached memory, and global variables from leaking between test cases; verify each test independently initializes its environment

Applied to files:

  • cpp/CMakeLists.txt
  • python/libcuopt/CMakeLists.txt
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Ensure race conditions are absent in multi-GPU code and multi-threaded server implementations; verify proper synchronization of shared state

Applied to files:

  • cpp/CMakeLists.txt
  • python/libcuopt/CMakeLists.txt
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Verify error propagation from CUDA to user-facing APIs is complete; ensure CUDA errors are caught and mapped to meaningful user error codes

Applied to files:

  • cpp/CMakeLists.txt
  • python/libcuopt/CMakeLists.txt
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh} : Avoid reinventing functionality already available in Thrust, CCCL, or RMM libraries; prefer standard library utilities over custom implementations

Applied to files:

  • python/libcuopt/CMakeLists.txt
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cpp,hpp,h} : Avoid inappropriate use of exceptions in performance-critical GPU operation paths; prefer error codes or CUDA error checking for latency-sensitive code

Applied to files:

  • python/libcuopt/CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.12, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.13, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.11, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.10, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.11, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.10, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.13, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.2, 3.12, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-sh-client / 13.0.2, 3.10, amd64, rockylinux8
🔇 Additional comments (5)
python/libcuopt/CMakeLists.txt (2)

2-2: LGTM: Copyright year updated appropriately.

The copyright year update reflects the current development period.


1-95: LGTM: Removal of local CUDA_STATIC_RUNTIME setting is correct.

The removal of set(CUDA_STATIC_RUNTIME ON) aligns with the PR objective to centralize static CUDA runtime configuration in cpp/CMakeLists.txt. The Python wrapper now inherits the static linking behavior from the parent build configuration.

cpp/CMakeLists.txt (1)

2-2: LGTM: Copyright year updated appropriately.

The copyright year range update reflects the current development period.

conda/recipes/libcuopt/recipe.yaml (2)

1-1: LGTM: Copyright year updated appropriately.

The copyright year update reflects the current development period.


65-79: LGTM: Conda recipe changes align with static CUDA runtime linking.

The removal of cuda-cudart-dev from host requirements and cuda-cudart from ignore_run_exports is correct for static CUDA runtime linking. With cudart_static embedded in the binaries, there's no runtime dependency on the dynamic CUDA runtime library.

The static CUDA runtime library should be provided by the CUDA compiler package (${{ compiler("cuda") }}) or implicitly through cuda-version, which appears to be correctly specified in the build and host requirements.

Also applies to: 95-117, 140-169, 190-213

@bdice
Copy link
Contributor Author

bdice commented Jan 5, 2026

How much increase in library size should we expect ?

Minimal. Something like 1-2 MB.

@bdice bdice requested a review from robertmaynard January 5, 2026 16:52
@rgsl888prabhu
Copy link
Collaborator

/merge

@rapids-bot rapids-bot bot merged commit 22c3315 into NVIDIA:main Jan 5, 2026
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change improvement Improves an existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants