From 4b0894befb7a5e21382fe7d4985a4a40094c2f9f Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 7 Jan 2026 15:55:34 -0500 Subject: [PATCH 1/3] Add the one missing system-level API (system_get_driver_branch) --- cuda_core/cuda/core/system/_system.pyx | 8 ++++++++ cuda_core/tests/system/test_system_system.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/cuda_core/cuda/core/system/_system.pyx b/cuda_core/cuda/core/system/_system.pyx index e6163b94fd..dae2c58237 100644 --- a/cuda_core/cuda/core/system/_system.pyx +++ b/cuda_core/cuda/core/system/_system.pyx @@ -82,6 +82,13 @@ def get_nvml_version() -> tuple[int, ...]: return tuple(int(v) for v in nvml.system_get_nvml_version().split(".")) +def get_driver_branch() -> str: + """ + Retrieves the driver branch of the NVIDIA driver installed on the system. + """ + return nvml.system_get_driver_branch() + + def get_num_devices() -> int: """ Return the number of devices in the system. @@ -112,6 +119,7 @@ def get_process_name(pid: int) -> str: __all__ = [ + "get_driver_branch", "get_driver_version", "get_driver_version_full", "get_nvml_version", diff --git a/cuda_core/tests/system/test_system_system.py b/cuda_core/tests/system/test_system_system.py index 582c471b8c..78ef4129aa 100644 --- a/cuda_core/tests/system/test_system_system.py +++ b/cuda_core/tests/system/test_system_system.py @@ -95,3 +95,10 @@ def test_device_count(): device_count = system.get_num_devices() assert isinstance(device_count, int) assert device_count >= 0 + + +def test_get_driver_branch(): + driver_branch = system.get_driver_branch() + assert isinstance(driver_branch, str) + assert len(driver_branch) > 0 + assert driver_branch[0] == "r" From 325230688e01abf7456e340c02e864d01ac2c2d5 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 8 Jan 2026 10:17:21 -0500 Subject: [PATCH 2/3] Update cuda_core/cuda/core/system/_system.pyx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cuda_core/cuda/core/system/_system.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cuda_core/cuda/core/system/_system.pyx b/cuda_core/cuda/core/system/_system.pyx index dae2c58237..adef2d8afc 100644 --- a/cuda_core/cuda/core/system/_system.pyx +++ b/cuda_core/cuda/core/system/_system.pyx @@ -86,6 +86,9 @@ def get_driver_branch() -> str: """ Retrieves the driver branch of the NVIDIA driver installed on the system. """ + if not CUDA_BINDINGS_NVML_IS_COMPATIBLE: + raise RuntimeError("NVML library is not available") + initialize() return nvml.system_get_driver_branch() From 7ce96e9a541f8b8a5248532285d2b5fb86bc9cf0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 8 Jan 2026 10:17:37 -0500 Subject: [PATCH 3/3] Update cuda_core/tests/system/test_system_system.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cuda_core/tests/system/test_system_system.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_core/tests/system/test_system_system.py b/cuda_core/tests/system/test_system_system.py index 78ef4129aa..ebc8af12bb 100644 --- a/cuda_core/tests/system/test_system_system.py +++ b/cuda_core/tests/system/test_system_system.py @@ -97,6 +97,7 @@ def test_device_count(): assert device_count >= 0 +@skip_if_nvml_unsupported def test_get_driver_branch(): driver_branch = system.get_driver_branch() assert isinstance(driver_branch, str)