diff --git a/cuda_core/tests/graph/test_graph_definition.py b/cuda_core/tests/graph/test_graph_definition.py index 3919d7b377ec..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,37 +924,28 @@ 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.""" - skip_if_mempool_unsupported() +@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() # 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") g = GraphDefinition() - 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 - - 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 + with pytest.raises(CUDAError, match="CUDA_ERROR_NOT_SUPPORTED"): + g.allocate(ALLOC_SIZE, memory_type=GraphMemoryType.HOST) # =============================================================================