Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] Fetch runtime version with cuda-python instead of numba #1675

Open
wants to merge 4 commits into
base: branch-24.12
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions python/rmm/rmm/_cuda/gpu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

from cuda import cuda, cudart

Expand Down Expand Up @@ -78,15 +78,13 @@ def runtimeGetVersion():
The version is returned as (1000 major + 10 minor). For example,
CUDA 9.2 would be represented by 9020.

This calls numba.cuda.runtime.get_version() rather than cuda-python due to
current limitations in cuda-python.
This function automatically raises CUDARuntimeError with error message
and status code.
"""
# TODO: Replace this with `cuda.cudart.cudaRuntimeGetVersion()` when the
# limitation is fixed.
import numba.cuda

major, minor = numba.cuda.runtime.get_version()
return major * 1000 + minor * 10
status, version = cudart.getLocalRuntimeVersion()
if status != cudart.cudaError_t.cudaSuccess:
raise CUDARuntimeError(status)
return version


def getDeviceCount():
Expand Down
Loading