Skip to content

Commit e3ebf05

Browse files
committed
[doc-only] cuda.bindings: clarify getLocalRuntimeVersion docstring
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 #1062 Signed-off-by: matysanchez <matysanchez@users.noreply.github.com>
1 parent 4ceaddc commit e3ebf05

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

cuda_bindings/cuda/bindings/runtime.pyx.in

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42117,15 +42117,18 @@ def cudaGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags):
4211742117

4211842118
@cython.embedsignature(True)
4211942119
def getLocalRuntimeVersion():
42120-
""" Returns the CUDA Runtime version of local shared library.
42120+
""" Returns the CUDA Runtime version of the locally installed shared library.
4212142121

42122-
Returns in `*runtimeVersion` the version number of the current CUDA
42123-
Runtime instance. The version is returned as (1000 * major + 10 *
42124-
minor). For example, CUDA 9.2 would be represented by 9020.
42122+
Locates the CUDA Runtime (``cudart``) shared library on the host using
42123+
:py:obj:`cuda.pathfinder.load_nvidia_dynamic_lib`, then calls
42124+
``cudaRuntimeGetVersion`` from that dynamically loaded library. The
42125+
returned value reflects the CUDA Toolkit version of the locally
42126+
discovered ``cudart``, which may differ from the version that
42127+
:py:obj:`cuda.bindings` was built against (as reported by
42128+
:py:obj:`~.cudaRuntimeGetVersion`).
4212542129

42126-
As of CUDA 12.0, this function no longer initializes CUDA. The purpose
42127-
of this API is solely to return a compile-time constant stating the
42128-
CUDA Toolkit version in the above format.
42130+
The version is returned as (1000 * major + 10 * minor). For example,
42131+
CUDA 9.2 would be represented by 9020.
4212942132

4213042133
This function automatically returns :py:obj:`~.cudaErrorInvalidValue`
4213142134
if the `runtimeVersion` argument is NULL.
@@ -42139,7 +42142,7 @@ def getLocalRuntimeVersion():
4213942142

4214042143
See Also
4214142144
--------
42142-
:py:obj:`~.cudaDriverGetVersion`, :py:obj:`~.cuDriverGetVersion`
42145+
:py:obj:`~.cudaRuntimeGetVersion`, :py:obj:`~.cudaDriverGetVersion`, :py:obj:`~.cuDriverGetVersion`
4214342146
"""
4214442147
cdef int runtimeVersion = 0
4214542148
err = cyruntime.getLocalRuntimeVersion(&runtimeVersion)

0 commit comments

Comments
 (0)