File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1047,6 +1047,13 @@ class Device:
10471047 cuda.core.system.Device
10481048 The corresponding system-level device instance used for NVML access.
10491049 """
1050+ from cuda.core.system._system import CUDA_BINDINGS_NVML_IS_COMPATIBLE
1051+
1052+ if not CUDA_BINDINGS_NVML_IS_COMPATIBLE:
1053+ raise RuntimeError(
1054+ "cuda.core.system.Device requires cuda_bindings 13.1.2+ or 12.9.6+"
1055+ )
1056+
10501057 from cuda.core.system import Device as SystemDevice
10511058 return SystemDevice(uuid = self .uuid)
10521059
Original file line number Diff line number Diff line change @@ -26,9 +26,17 @@ def cuda_version():
2626
2727
2828def test_to_system_device (deinit_cuda ):
29- from cuda .core .system import Device as SystemDevice
29+ from cuda .core .system import _system
3030
3131 device = Device ()
32+
33+ if not _system .CUDA_BINDINGS_NVML_IS_COMPATIBLE :
34+ with pytest .raises (RuntimeError ):
35+ device .to_system_device ()
36+ pytest .skip ("NVML support requires cuda.bindings version 12.9.6+ or 13.1.2+" )
37+
38+ from cuda .core .system import Device as SystemDevice
39+
3240 system_device = device .to_system_device ()
3341 assert isinstance (system_device , SystemDevice )
3442 assert system_device .uuid [4 :] == device .uuid
You can’t perform that action at this time.
0 commit comments