Skip to main content

cudaRuntimeGetVersion

Function cudaRuntimeGetVersion 

Source
pub unsafe extern "C" fn cudaRuntimeGetVersion(
    runtimeVersion: *mut c_int,
) -> cudaError_t
Expand description

Returns the CUDA Runtime version.

Returns in *runtimeVersion the version number of the current CUDA Runtime instance. The version is returned as (1000 major + 10 minor). For example, CUDA 9.2 would be represented by 9020.

As of CUDA 12.0, this function no longer initializes CUDA. The purpose of this API is solely to return a compile-time constant stating the CUDA Toolkit version in the above format.

As of CUDA 13.0, on Windows, the runtimeVersion may not be the same as the CUDA Toolkit version the app was built with. Windows will use the CUDA Runtime packaged with the display driver, and that version will be reported.

This function automatically returns cudaError_t::CUDA_ERROR_INVALID_VALUE if the runtimeVersion argument is NULL.

Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.

Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.

§Parameters

  • runtimeVersion: Returns the CUDA Runtime version.

§Return value

See also: cudaDriverGetVersion, cuDriverGetVersion.