Skip to content

Commit 4b09e51

Browse files
authored
cuda_core test_memory.py, test_program.py xfail, fix (NVIDIA#1302)
* Fix mis-spelled enum name in cuda_core/tests/test_program.py * Add xfail in cuda_core/tests/test_memory.py: these tests are currently skipped in our CI; failures discovered elsewhere
1 parent 7c16560 commit 4b09e51

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

cuda_core/tests/test_memory.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
)
3030
from cuda.core.experimental._dlpack import DLDeviceType
3131
from cuda.core.experimental._memory import IPCBufferDescriptor
32-
from cuda.core.experimental._utils.cuda_utils import handle_return
32+
from cuda.core.experimental._utils.cuda_utils import CUDAError, handle_return
3333
from cuda.core.experimental.utils import StridedMemoryView
3434
from helpers import IS_WINDOWS
3535
from helpers.buffers import DummyUnifiedMemoryResource
@@ -430,7 +430,13 @@ def test_vmm_allocator_policy_configuration():
430430
assert vmm_mr.config.granularity == "minimum"
431431

432432
# Test allocation with custom config
433-
buffer = vmm_mr.allocate(8192)
433+
try:
434+
buffer = vmm_mr.allocate(8192)
435+
except CUDAError as exc:
436+
msg = str(exc)
437+
if "CUDA_ERROR_INVALID_DEVICE" in msg:
438+
pytest.xfail("TODO(#1300): Failing on Jetson AGX Orin P3730")
439+
raise
434440
assert buffer.size >= 8192
435441
assert buffer.device_id == device.device_id
436442

@@ -447,7 +453,13 @@ def test_vmm_allocator_policy_configuration():
447453
)
448454

449455
# Modify allocation policy
450-
modified_buffer = vmm_mr.modify_allocation(buffer, 16384, config=new_config)
456+
try:
457+
modified_buffer = vmm_mr.modify_allocation(buffer, 16384, config=new_config)
458+
except CUDAError as exc:
459+
msg = str(exc)
460+
if "CUDA_ERROR_UNKNOWN" in msg:
461+
pytest.xfail("TODO(#1300): Known to fail already with CTK 13.0 (Windows)")
462+
raise
451463
assert modified_buffer.size >= 16384
452464
assert vmm_mr.config == new_config
453465
assert vmm_mr.config.self_access == "r"

cuda_core/tests/test_program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def test_nvvm_program_creation_compilation(nvvm_ir):
345345
try:
346346
ker = obj.get_kernel("simple") # noqa: F841
347347
except CUDAError as e:
348-
if re.search(r"CUDA_UNSUPPORTED_PTX_VERSION", str(e)):
348+
if re.search(r"CUDA_ERROR_UNSUPPORTED_PTX_VERSION", str(e)):
349349
pytest.xfail("PTX version not supported by current CUDA Driver")
350350
raise
351351
program.close()

0 commit comments

Comments
 (0)