Skip to content

Commit fffa9fd

Browse files
committed
feat(cuda.core): require CUDA 12.2 for node updates
Report unsupported driver or binding versions before preparing mutation attachments or calling the generic node setter.
1 parent 442cb94 commit fffa9fd

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

cuda_core/cuda/core/graph/_subclasses.pyx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ from cuda.core._resource_handles cimport (
3434
graph_prepare_attachment,
3535
)
3636
from cuda.core._utils.cuda_utils cimport HANDLE_RETURN
37+
from cuda.core._utils.version cimport cy_binding_version, cy_driver_version
3738

3839
from cuda.core.graph._host_callback cimport (
3940
_is_py_host_trampoline,
@@ -71,6 +72,19 @@ cdef void _set_definition_node_params(
7172
cydriver.CUgraphNodeParams* params,
7273
OpaqueHandle owner0,
7374
OpaqueHandle owner1=OpaqueHandle()) except *:
75+
cdef tuple version = cy_driver_version()
76+
if version < (12, 2, 0):
77+
raise RuntimeError(
78+
"Graph node mutation requires CUDA driver 12.2 or newer; "
79+
f"using driver version {'.'.join(map(str, version))}"
80+
)
81+
version = cy_binding_version()
82+
if version < (12, 2, 0):
83+
raise RuntimeError(
84+
"Graph node mutation requires cuda.bindings 12.2 or newer; "
85+
f"using cuda.bindings version {'.'.join(map(str, version))}"
86+
)
87+
7488
cdef GraphHandle h_graph = graph_node_get_graph(h_node)
7589
cdef cydriver.CUgraphNode node = as_cu(h_node)
7690
cdef PreparedAttachment prepared

0 commit comments

Comments
 (0)