From 4f9be79759d01e422aecb33ceff2a05c203f784a Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 30 Nov 2026 15:25:55 -0500 Subject: [PATCH 1/4] test(cuda.core): run test_alloc_memory_type_host and accept the driver's NOT_SUPPORTED test_alloc_memory_type_host skipped on every runner because graph allocation nodes with a host pool location return CUDA_ERROR_NOT_SUPPORTED. Drivers up to CUDA 13.4 support graph allocations only in device memory: cuGraphAddMemAllocNode and stream-captured allocations from a host pool both reject HOST and HOST_NUMA locations, although host memory pools themselves are supported. Treat CUDA_ERROR_NOT_SUPPORTED as the expected current result instead of a skip, fail on any other error, and keep the round-trip check for a driver that accepts the allocation. Remove the "not currently run in any CI job" comment. Closes #3588. Co-Authored-By: Claude Opus 5.5 --- cuda_core/tests/graph/test_graph_definition.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cuda_core/tests/graph/test_graph_definition.py b/cuda_core/tests/graph/test_graph_definition.py index 3919d7b377ec..55212e953453 100644 --- a/cuda_core/tests/graph/test_graph_definition.py +++ b/cuda_core/tests/graph/test_graph_definition.py @@ -926,7 +926,6 @@ def test_alloc_peer_access(mempool_device_x2): assert d1.device_id in node.peer_access -# This test is not currently run in any CI job @pytest.mark.agent_authored(model="gpt-5.6-sol") def test_alloc_memory_type_host(init_cuda): """HOST graph alloc nodes reconstruct memory_type from the driver, not the Python argument.""" @@ -942,9 +941,13 @@ def test_alloc_memory_type_host(init_cuda): try: node = g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST) except CUDAError as e: - if "CUDA_ERROR_NOT_SUPPORTED" in str(e): - pytest.skip("Driver does not support graph alloc memory_type='host'") - raise + # Drivers up to and including CUDA 13.4 support graph allocations only + # in device memory, as documented on GraphMemoryType.HOST. Any other + # error fails the test; a driver that adds support runs the round-trip + # check below instead. + if "CUDA_ERROR_NOT_SUPPORTED" not in str(e): + raise + return expected_dptr = node.dptr succ = node.record(Device().create_event()) From 0147a4431e0e0aa1056fbb2ae4afed8292ce422c Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 30 Nov 2026 16:08:16 -0500 Subject: [PATCH 2/4] test(cuda.core): drop the stale GraphMemoryType.HOST reference from a test comment Co-Authored-By: Claude Opus 5.5 --- cuda_core/tests/graph/test_graph_definition.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cuda_core/tests/graph/test_graph_definition.py b/cuda_core/tests/graph/test_graph_definition.py index 55212e953453..87100dc68899 100644 --- a/cuda_core/tests/graph/test_graph_definition.py +++ b/cuda_core/tests/graph/test_graph_definition.py @@ -942,9 +942,8 @@ def test_alloc_memory_type_host(init_cuda): node = g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST) except CUDAError as e: # Drivers up to and including CUDA 13.4 support graph allocations only - # in device memory, as documented on GraphMemoryType.HOST. Any other - # error fails the test; a driver that adds support runs the round-trip - # check below instead. + # in device memory. Any other error fails the test; a driver that adds + # support runs the round-trip check below instead. if "CUDA_ERROR_NOT_SUPPORTED" not in str(e): raise return From d1441a7f7628b0d8595335687b39726a2560f8a7 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 1 Dec 2026 12:04:57 -0500 Subject: [PATCH 3/4] test(cuda.core): separate host graph-alloc rejection coverage from the round trip Instead of returning early (and passing) on CUDA_ERROR_NOT_SUPPORTED, record the newest driver known to reject host-located graph allocation nodes (_HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH, CUDA 13.4). On those drivers, test_alloc_memory_type_host_not_supported asserts the rejection and test_alloc_memory_type_host skips with a documented reason. On newer drivers the round-trip test runs and fails on an unexpected NOT_SUPPORTED. Co-Authored-By: Claude Opus 5.5 --- .../tests/graph/test_graph_definition.py | 56 ++++++++++++++++--- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/cuda_core/tests/graph/test_graph_definition.py b/cuda_core/tests/graph/test_graph_definition.py index 87100dc68899..6a2cf72986a6 100644 --- a/cuda_core/tests/graph/test_graph_definition.py +++ b/cuda_core/tests/graph/test_graph_definition.py @@ -926,27 +926,65 @@ def test_alloc_peer_access(mempool_device_x2): assert d1.device_id in node.peer_access -@pytest.mark.agent_authored(model="gpt-5.6-sol") -def test_alloc_memory_type_host(init_cuda): - """HOST graph alloc nodes reconstruct memory_type from the driver, not the Python argument.""" - skip_if_mempool_unsupported() - from cuda.core._utils.cuda_utils import CUDAError +# Newest driver (major, minor) known to reject host-located graph allocation +# nodes with CUDA_ERROR_NOT_SUPPORTED (#3588): checked on CUDA 13.2, 13.3 and +# 13.4 drivers. Drivers past it are expected to support them, so +# test_alloc_memory_type_host fails there if they don't. When a newer driver +# still rejects them, raise this to that driver's version. +_HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH = (13, 4) + + +def _skip_unless_host_graph_alloc_driver(): + """Skip on drivers that reject HOST pool properties outright.""" from cuda.core._utils.version import driver_version + skip_if_mempool_unsupported() # CUDA 12 rejects HOST pool properties before graph support is checked. if driver_version() < (13, 0, 0): pytest.skip("CUDA drivers before 13.0 reject HOST allocation properties") + +def _host_graph_alloc_known_unsupported(): + from cuda.core._utils.version import driver_version + + return driver_version()[:2] <= _HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH + + +@pytest.mark.agent_authored(model="claude-opus-5-5") +def test_alloc_memory_type_host_not_supported(init_cuda): + """Drivers known to lack host-located graph allocations reject them with NOT_SUPPORTED.""" + _skip_unless_host_graph_alloc_driver() + from cuda.core._utils.cuda_utils import CUDAError + + if not _host_graph_alloc_known_unsupported(): + pytest.skip("Driver is expected to support host-located graph allocations; see test_alloc_memory_type_host") + + g = GraphDefinition() + with pytest.raises(CUDAError, match="CUDA_ERROR_NOT_SUPPORTED"): + g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST) + + +# This test is not currently run in any CI job +@pytest.mark.agent_authored(model="gpt-5.6-sol") +def test_alloc_memory_type_host(init_cuda): + """HOST graph alloc nodes reconstruct memory_type from the driver, not the Python argument.""" + _skip_unless_host_graph_alloc_driver() + from cuda.core._utils.cuda_utils import CUDAError + + if _host_graph_alloc_known_unsupported(): + major, minor = _HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH + pytest.skip(f"No driver through CUDA {major}.{minor} supports host-located graph allocations (#3588)") + g = GraphDefinition() try: node = g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST) except CUDAError as e: - # Drivers up to and including CUDA 13.4 support graph allocations only - # in device memory. Any other error fails the test; a driver that adds - # support runs the round-trip check below instead. if "CUDA_ERROR_NOT_SUPPORTED" not in str(e): raise - return + pytest.fail( + "This driver still rejects host-located graph allocations; if that is expected, " + "raise _HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH to its version" + ) expected_dptr = node.dptr succ = node.record(Device().create_event()) From 571ab8a8f838b03f36f0dff9fe3ea0a61643b4dc Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 3 Dec 2026 10:02:32 -0500 Subject: [PATCH 4/4] test(cuda.core): assert host graph allocations are unsupported; drop the round trip The #3690 probe found no driver or platform that accepts a host-located graph allocation: CUDA 13.0 and 13.2 drivers on every CI row (Linux, Windows TCC/MCDM/WDDM, WSL; V100 through GB300), 13.4 locally, and 13.5 (620.70.10) on every Linux row of #3691. Graph memory nodes are documented only for device-resident memory. So the rejection test no longer depends on a driver-version threshold, and the round-trip test, which no configuration ever ran, is removed. The rejection test's docstring says to replace it with a round trip if a driver starts accepting host locations. Co-Authored-By: Claude Opus 5.5 --- .../tests/graph/test_graph_definition.py | 75 +++---------------- 1 file changed, 12 insertions(+), 63 deletions(-) diff --git a/cuda_core/tests/graph/test_graph_definition.py b/cuda_core/tests/graph/test_graph_definition.py index 6a2cf72986a6..f0cb73db72f1 100644 --- a/cuda_core/tests/graph/test_graph_definition.py +++ b/cuda_core/tests/graph/test_graph_definition.py @@ -6,7 +6,6 @@ import ctypes import gc import sys -import weakref from collections.abc import Callable from dataclasses import dataclass, field @@ -761,7 +760,6 @@ def test_identity_preservation(init_cuda): def test_registry_cleanup(init_cuda): """Node registry entries are removed on destroy() and graph teardown.""" - import gc from cuda.core.graph._graph_node import _node_registry @@ -926,16 +924,18 @@ def test_alloc_peer_access(mempool_device_x2): assert d1.device_id in node.peer_access -# Newest driver (major, minor) known to reject host-located graph allocation -# nodes with CUDA_ERROR_NOT_SUPPORTED (#3588): checked on CUDA 13.2, 13.3 and -# 13.4 drivers. Drivers past it are expected to support them, so -# test_alloc_memory_type_host fails there if they don't. When a newer driver -# still rejects them, raise this to that driver's version. -_HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH = (13, 4) - - -def _skip_unless_host_graph_alloc_driver(): - """Skip on drivers that reject HOST pool properties outright.""" +@pytest.mark.agent_authored(model="claude-opus-5-5") +def test_alloc_memory_type_host_not_supported(init_cuda): + """Drivers reject host-located graph allocations with NOT_SUPPORTED. + + Graph memory nodes are documented only for device-resident memory, and + every driver checked rejects host locations (#3588): CUDA 13.0 through + 13.5, on Linux, Windows (TCC, MCDM, WDDM) and WSL, including GH200 and + GB300. If a driver starts accepting them, this fails; replace it with a + test that the allocation round-trips (memory_type and dptr of the node + reconstructed from the driver). + """ + from cuda.core._utils.cuda_utils import CUDAError from cuda.core._utils.version import driver_version skip_if_mempool_unsupported() @@ -943,62 +943,11 @@ def _skip_unless_host_graph_alloc_driver(): if driver_version() < (13, 0, 0): pytest.skip("CUDA drivers before 13.0 reject HOST allocation properties") - -def _host_graph_alloc_known_unsupported(): - from cuda.core._utils.version import driver_version - - return driver_version()[:2] <= _HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH - - -@pytest.mark.agent_authored(model="claude-opus-5-5") -def test_alloc_memory_type_host_not_supported(init_cuda): - """Drivers known to lack host-located graph allocations reject them with NOT_SUPPORTED.""" - _skip_unless_host_graph_alloc_driver() - from cuda.core._utils.cuda_utils import CUDAError - - if not _host_graph_alloc_known_unsupported(): - pytest.skip("Driver is expected to support host-located graph allocations; see test_alloc_memory_type_host") - g = GraphDefinition() with pytest.raises(CUDAError, match="CUDA_ERROR_NOT_SUPPORTED"): g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST) -# This test is not currently run in any CI job -@pytest.mark.agent_authored(model="gpt-5.6-sol") -def test_alloc_memory_type_host(init_cuda): - """HOST graph alloc nodes reconstruct memory_type from the driver, not the Python argument.""" - _skip_unless_host_graph_alloc_driver() - from cuda.core._utils.cuda_utils import CUDAError - - if _host_graph_alloc_known_unsupported(): - major, minor = _HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH - pytest.skip(f"No driver through CUDA {major}.{minor} supports host-located graph allocations (#3588)") - - g = GraphDefinition() - try: - node = g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST) - except CUDAError as e: - if "CUDA_ERROR_NOT_SUPPORTED" not in str(e): - raise - pytest.fail( - "This driver still rejects host-located graph allocations; if that is expected, " - "raise _HOST_GRAPH_ALLOC_UNSUPPORTED_THROUGH to its version" - ) - - expected_dptr = node.dptr - succ = node.record(Device().create_event()) - node_ref = weakref.ref(node) - del node - gc.collect() - assert node_ref() is None - reconstructed = next(iter(succ.pred)) - assert isinstance(reconstructed, AllocNode) - assert reconstructed.memory_type == GraphMemoryType.HOST - assert reconstructed.dptr == expected_dptr - assert reconstructed.dptr != 0 - - # ============================================================================= # Join API # =============================================================================