Skip to content

[doc-only] cuda.bindings: clarify getLocalRuntimeVersion docstring#2202

Open
matysanchez wants to merge 1 commit into
NVIDIA:mainfrom
matysanchez:hunter/issue-1062
Open

[doc-only] cuda.bindings: clarify getLocalRuntimeVersion docstring#2202
matysanchez wants to merge 1 commit into
NVIDIA:mainfrom
matysanchez:hunter/issue-1062

Conversation

@matysanchez

Copy link
Copy Markdown
Contributor

Closes #1062

What

Rewrites the docstring for getLocalRuntimeVersion() in cuda_bindings/cuda/bindings/runtime.pyx.in to clearly differentiate it from cudaRuntimeGetVersion():

  • getLocalRuntimeVersion() locates the CUDA Runtime shared library on the host via cuda.pathfinder.load_nvidia_dynamic_lib and calls cudaRuntimeGetVersion from that dynamically loaded library. The result reflects the locally discovered cudart version.
  • cudaRuntimeGetVersion() returns the version cuda.bindings was built against — a compile-time constant.

Also drops a stray "compile-time constant" sentence from the getLocalRuntimeVersion docstring that actually describes cudaRuntimeGetVersion (originally copy-pasted between the two), and adds cudaRuntimeGetVersion to the See Also section so readers can compare directly.

Why

Per #1062, the two functions' docstrings were nearly identical and didn't explain the distinction, leaving users without a way to choose between them.

Tested

  • Read both functions' implementations in the source to derive the actual semantic difference (getLocalRuntimeVersion calls into pathfinder; cudaRuntimeGetVersion reflects the build-time constant).
  • No code path changed — only the docstring on the public getLocalRuntimeVersion shim.
  • Sphinx markup (:py:obj:) preserved; section structure (Returns / Notes / See Also) unchanged.

Verification

branch: hunter/issue-1062
files-changed: 1
commit: e3ebf05

The docstring for getLocalRuntimeVersion() largely duplicated that of
cudaRuntimeGetVersion() without explaining the actual behavioral
difference. Update it to describe that this function dynamically locates
the cudart shared library via cuda.pathfinder and queries that locally
discovered library, whose version may differ from the cudart that
cuda.bindings was built against.

Closes NVIDIA#1062

Signed-off-by: matysanchez <matysanchez@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 11, 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

Copy link
Copy Markdown

Needs-Restricted-Paths-Review was assigned by CI: Restricted Paths Guard.

For details, open this workflow run and click Summary.

For external contributors: thank you for your interest in improving CUDA Python. The cuda_bindings/ package is distributed under the NVIDIA Software License, which does not allow us to accept external contributions to files under cuda_bindings/ in this repository.

Please close this PR. If your changes also include updates outside cuda_bindings/, please open a new PR containing only those changes so we can review them separately under the applicable license.

If you are an NVIDIA employee and believe this label was applied in error, no action is needed; a maintainer will review and remove the label if appropriate.

@github-actions github-actions Bot added Needs-Restricted-Paths-Review PR touches cuda_bindings or cuda_python; only NVIDIA employees may modify these paths; see LICENSEs cuda.bindings Everything related to the cuda.bindings module labels Jun 11, 2026
@matysanchez matysanchez marked this pull request as ready for review June 11, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module Needs-Restricted-Paths-Review PR touches cuda_bindings or cuda_python; only NVIDIA employees may modify these paths; see LICENSEs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOC]: Documentation for getLocalRuntimeVersion() is probably incorrect

1 participant