Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion cuda_core/cuda/core/experimental/_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,10 @@ def complete(self, options: GraphCompleteOptions | None = None) -> Graph:
raise RuntimeError(
"Instantiation for device launch failed due to the nodes belonging to different contexts."
)
elif params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED:
elif (
_py_major_minor >= (12, 8)
and params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED
):
raise RuntimeError("One or more conditional handles are not associated with conditional builders.")
elif params.result_out != driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_SUCCESS:
raise RuntimeError(f"Graph instantiation failed with unexpected error code: {params.result_out}")
Expand Down
8 changes: 4 additions & 4 deletions cuda_core/tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def test_graph_conditional_if_else(init_cuda, condition_value):
try:
gb_if, gb_else = gb.if_else(handle)
except RuntimeError as e:
with pytest.raises(RuntimeError, match="^Driver version"):
with pytest.raises(RuntimeError, match="^(Driver|Binding) version"):
raise e
gb.end_building()
b.close()
Expand Down Expand Up @@ -377,7 +377,7 @@ def test_graph_conditional_switch(init_cuda, condition_value):
try:
gb_case = list(gb.switch(handle, 3))
except RuntimeError as e:
with pytest.raises(RuntimeError, match="^Driver version"):
with pytest.raises(RuntimeError, match="^(Driver|Binding) version"):
raise e
gb.end_building()
b.close()
Expand Down Expand Up @@ -568,7 +568,7 @@ def build_graph(condition_value):
try:
gb_case = list(gb.switch(handle, 3))
except Exception as e:
with pytest.raises(RuntimeError, match="^Driver version"):
with pytest.raises(RuntimeError, match="^(Driver|Binding) version"):
raise e
gb.end_building()
raise e
Expand Down Expand Up @@ -599,7 +599,7 @@ def build_graph(condition_value):
try:
graph_variants = [build_graph(0), build_graph(1), build_graph(2)]
except Exception as e:
with pytest.raises(RuntimeError, match="^Driver version"):
with pytest.raises(RuntimeError, match="^(Driver|Binding) version"):
raise e
b.close()
pytest.skip("Driver does not support conditional switch")
Expand Down