Skip to content

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

Open
srimanachanta wants to merge 3 commits into
NVIDIA:mainfrom
srimanachanta:pathfinder-cudart-static
Open

srimanachanta wants to merge 3 commits into
NVIDIA:mainfrom
srimanachanta:pathfinder-cudart-static

Conversation

@srimanachanta

Copy link
Copy Markdown
Contributor

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

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added support for locating the cudart_static CUDA library in site-packages on Windows and non-Windows platforms.
  • Improvements
    • Preserved cudadevrt lookup behavior, including platform-specific library names and architecture-specific search paths.

The static-library registry now uses a shared helper to generate metadata for cudadevrt and cudart_static. 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 generates platform-specific filenames for both libraries and retains existing search paths. Tests check metadata and site-packages lookup for cudart_static.

Suggested reviewers: isvoid

Change: Feature

Merge Risk: Minimal · up to e872f

This change lets CUDA Pathfinder locate the static CUDA runtime library automatically, in addition to cudadevrt. Existing cudadevrt lookup behavior is unchanged and the new lookup has test coverage. No merge-blocking risk is evident in the code.

Security architecture risk: Minimal · up to e872f

The new option lets callers discover the static CUDA runtime in the same locations already searched for cudadevrt. It does not change how cudadevrt is found, accept arbitrary filenames, or link or load an archive on the caller’s behalf.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The directly affected scope is callers that request cudart_static or act on the expanded supported-name list. The lookup itself returns a local path; any subsequent linking is outside this API.

Trust Boundaries and Controls

  • observed — The new name inherits the existing environment and filesystem trust model. Local search locations can influence which candidate path is returned; the finder checks for a file and resolves its path without authenticating the archive contents.
Finishing Touches

Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6c1e94e and e872fed.

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; 11 remain after this review.

@Andy-Jost

Copy link
Copy Markdown
Contributor

/ok to test beecaac

@Andy-Jost Andy-Jost self-assigned this Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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.

2 participants