Skip to content

pathfinder: add cudart_static to the supported static libraries - #3234

Open
srimanachanta wants to merge 1 commit into
NVIDIA:mainfrom
srimanachanta:pathfinder-cudart-static
Open

srimanachanta wants to merge 1 commit into
NVIDIA:mainfrom
srimanachanta:pathfinder-cudart-static

Conversation

@srimanachanta

Copy link
Copy Markdown

Summary

Add "cudart_static" to SUPPORTED_STATIC_LIBS, so locate_static_lib("cudart_static") and find_static_lib("cudart_static") find libcudart_static.a / cudart_static.lib. Today the tuple is only ("cudadevrt",).

Motivation

Linking the static CUDA runtime lets one extension module work with different CUDA runtimes in the same major. In a CUDA 12 build of a downstream extension library, one .so linked against cudart_static worked in both cuda12 and cuda13 environments (cupy). Today the path has to be passed by hand (-DCUDA_CUDART=<path to libcudart_static.a>).

Change

cudart_static ships next to cudadevrt in every layout pathfinder searches, so _cudadevrt_info() becomes _cuda_runtime_static_lib_info(stem) and both entries use it. I checked the layouts directly:

Layout Location of both archives
CUDA 13 wheel, Linux nvidia/cu13/lib/
CUDA 12 wheel, Linux nvidia/cuda_runtime/lib/
CUDA 13 wheel, Windows nvidia/cu13/lib/x64/
CUDA 12 wheel, Windows nvidia/cuda_runtime/lib/x64/
conda cuda-cudart-static lib/
CTK lib64/

Tests

  • The existing Windows architecture test now goes through the shared helper.
  • New: cudart_static uses the same search directories as cudadevrt on Linux and Windows, and is found in site-packages.
  • Checked against a real CUDA 13.4 wheel (site-packages) and a system CTK (CUDA_PATH).

libcudart_static.a and cudart_static.lib ship next to cudadevrt in the
wheel, conda and CTK layouts, so both use the same search paths.
@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.pathfinder Everything related to the cuda.pathfinder module label Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 590a8bf and beecaac.

Files selected for processing: 2
  • cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py
  • cuda_pathfinder/tests/test_find_static_lib.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Added support for locating the cudadevrt and cudart_static CUDA libraries in site-packages on Windows and non-Windows platforms.
    • Library names are now handled according to the platform, while architecture-specific search paths are retained. This makes static CUDA runtime libraries available through the same lookup behavior across supported platforms.

The static-library registry now generates metadata for both cudadevrt and cudart_static through a shared helper. Tests cover platform-specific filenames, search paths, and locating cudart_static in site-packages.

Changes: Static-library metadata

Layer / File(s) Summary
Shared metadata and lookup validation
cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py, cuda_pathfinder/tests/test_find_static_lib.py
The shared helper derives platform-specific filenames for both libraries and retains architecture-specific search paths. Tests check metadata and site-packages lookup for cudart_static.

Suggested labels: cuda.pathfinder, enhancement

Suggested reviewers: isvoid

Priority: Normal

Change: Feature

Merge Risk: Minimal · up to beeca

No merge-blocking issue is identified for the static-library lookup change; it is ready for normal checks.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.pathfinder Everything related to the cuda.pathfinder module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant