Skip to content

Commit 4c90e1e

Browse files
committed
test(cuda.core): xfail the default managed pool error test on Windows VA OOM
test_default_pool_error_without_concurrent_access calls ManagedMemoryResource() and expects the RuntimeError that _MMR_init raises when the default managed pool lookup returns CUDA_ERROR_NOT_SUPPORTED. On some Windows machines the driver instead fails to reserve VA for the lookup and returns CUDA_ERROR_OUT_OF_MEMORY (nvbugs5815123). #2000 xfailed this case and #3004 removed that xfail. Restore it for this one test only, as an inline xfail on Windows + CUDA_ERROR_OUT_OF_MEMORY, without bringing back the shared helper.
1 parent b712677 commit 4c90e1e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎cuda_core/tests/test_managed_memory_warning.py‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
These tests only run on affected platforms (concurrent_managed_access is False).
99
"""
1010

11+
import sys
1112
import warnings
1213

1314
import pytest
@@ -16,6 +17,7 @@
1617
import cuda.bindings
1718
from cuda.core import Device, ManagedMemoryResource, ManagedMemoryResourceOptions
1819
from cuda.core._memory._managed_memory_resource import reset_concurrent_access_warning
20+
from cuda.core._utils.cuda_utils import CUDAError
1921

2022
_cuda_major = int(cuda.bindings.__version__.split(".")[0])
2123

@@ -51,8 +53,16 @@ def device_without_concurrent_managed_access(init_cuda):
5153
@requires_cuda_13
5254
def test_default_pool_error_without_concurrent_access(device_without_concurrent_managed_access):
5355
"""ManagedMemoryResource() raises RuntimeError when the default pool doesn't support managed."""
54-
with pytest.raises(RuntimeError, match="does not support managed allocations"):
55-
ManagedMemoryResource()
56+
try:
57+
with pytest.raises(RuntimeError, match="does not support managed allocations"):
58+
ManagedMemoryResource()
59+
except CUDAError as e:
60+
# nvbugs5815123: on some Windows machines the driver fails to reserve VA
61+
# for the default managed pool lookup and returns CUDA_ERROR_OUT_OF_MEMORY
62+
# instead of CUDA_ERROR_NOT_SUPPORTED, so the RuntimeError is never raised.
63+
if sys.platform == "win32" and "CUDA_ERROR_OUT_OF_MEMORY" in str(e):
64+
pytest.xfail("default managed pool lookup ran out of VA on Windows (nvbugs5815123)")
65+
raise
5666

5767

5868
@requires_cuda_13

0 commit comments

Comments
 (0)