Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
65b944e
Skip IPC mempool tests on WSL
rparolin Sep 29, 2025
67d5f45
Merge branch 'main' into rparolin/skip_ipc_on_wsl
rparolin Sep 29, 2025
47a8d89
Update cuda_core/tests/conftest.py
rparolin Sep 29, 2025
7f7be24
Update cuda_core/tests/test_ipc_mempool.py
rparolin Sep 29, 2025
d88d627
Apply suggestion from @cpcloud
rparolin Sep 29, 2025
aab97af
addressing feedback
rparolin Sep 29, 2025
fe47883
Making utils globally accessible
rparolin Sep 29, 2025
46cd33c
Merge branch 'rparolin/skip_ipc_on_wsl' of github.com:NVIDIA/cuda-pyt…
rparolin Sep 29, 2025
4366efe
working
rparolin Sep 29, 2025
2b49a77
wip
rparolin Sep 29, 2025
57ead02
wip
rparolin Sep 29, 2025
0a9be40
formatting
rparolin Sep 29, 2025
1da2c82
removing deleted files
rparolin Sep 29, 2025
f7deec9
removing skip helper
rparolin Sep 29, 2025
57fc851
Merge branch 'main' into rparolin/skip_ipc_on_wsl
rparolin Sep 29, 2025
56a2381
wip
rparolin Sep 29, 2025
5e21482
feedback
rparolin Sep 29, 2025
c95d29b
wip
rparolin Sep 29, 2025
7edd190
sorting imports
rparolin Sep 29, 2025
8ce40b8
Update cuda_core/tests/conftest.py
rparolin Oct 1, 2025
2168cd1
Checking if CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES is sup…
rparolin Oct 1, 2025
b40487d
Merge branch 'rparolin/skip_ipc_on_wsl' of github.com:NVIDIA/cuda-pyt…
rparolin Oct 1, 2025
d66d4da
Update cuda_python_test_helpers/__init__.py
rparolin Oct 2, 2025
1f9bb51
Merge branch 'main' into rparolin/skip_ipc_on_wsl
rparolin Oct 2, 2025
4b9c417
merge main branch
rparolin Oct 8, 2025
8d291a6
wip
rparolin Oct 8, 2025
55546cb
Merge branch 'main' into rparolin/skip_ipc_on_wsl
leofang Oct 8, 2025
8664327
[pre-commit.ci] auto code formatting
pre-commit-ci[bot] Oct 8, 2025
7af149b
Creating the cuda_python_test_helpers as a package
rparolin Oct 8, 2025
5977cab
Merge branch 'rparolin/skip_ipc_on_wsl' of github.com:NVIDIA/cuda-pyt…
rparolin Oct 8, 2025
90590ec
[pre-commit.ci] auto code formatting
pre-commit-ci[bot] Oct 8, 2025
034125f
pre-commit changes
rparolin Oct 8, 2025
75c4d25
Merge branch 'rparolin/skip_ipc_on_wsl' of github.com:NVIDIA/cuda-pyt…
rparolin Oct 8, 2025
cd6b714
removing cuda_python_test_helpers/__init__.py
rparolin Oct 8, 2025
baac405
install cuda_python_test_helpers as editable
rparolin Oct 8, 2025
d8b0a46
Merge branch 'main' into rparolin/skip_ipc_on_wsl
leofang Oct 8, 2025
bbe82c8
do not require cuda_python_test_helpers to be pre-installed for now
leofang Oct 8, 2025
7726e05
Revert "install cuda_python_test_helpers as editable"
rparolin Oct 8, 2025
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
26 changes: 22 additions & 4 deletions cuda_core/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Comment thread
rparolin marked this conversation as resolved.
Outdated
# SPDX-License-Identifier: Apache-2.0

import multiprocessing
import os

import helpers
import pytest

try:
from cuda.bindings import driver
except ImportError:
from cuda import cuda as driver
import multiprocessing

import pytest
from cuda.core.experimental import Device, _device
from cuda.core.experimental._utils.cuda_utils import handle_return


def _detect_wsl() -> bool:
Comment thread
leofang marked this conversation as resolved.
Outdated
try:
with open("/proc/sys/kernel/osrelease") as f:
data = f.read().lower()
if "microsoft" in data or "wsl" in data:
return True
except Exception:
pass
Comment thread
rparolin marked this conversation as resolved.
Outdated
# Fallback: env hints sometimes present in CI or shells
if any(os.environ.get(k) for k in ("WSL_DISTRO_NAME", "WSL_INTEROP")):
return True
return False
Comment thread
rparolin marked this conversation as resolved.
Outdated


IS_WSL = _detect_wsl()


@pytest.fixture(scope="session", autouse=True)
def session_setup():
# Always init CUDA.
Expand Down
5 changes: 5 additions & 0 deletions cuda_core/tests/test_ipc_mempool.py
Comment thread
rparolin marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import pytest
from cuda.core.experimental import Buffer, Device, DeviceMemoryResource, IPCChannel, MemoryResource
from conftest import IS_WSL
from cuda.core.experimental._utils.cuda_utils import handle_return

CHILD_TIMEOUT_SEC = 10
Expand All @@ -33,9 +34,12 @@ def ipc_device():
if not device.properties.handle_type_posix_file_descriptor_supported:
pytest.skip("Device does not support IPC")

# On WSL, this test is skipped via decorator; on other platforms it runs.

Comment thread
rparolin marked this conversation as resolved.
Outdated
return device


@pytest.mark.skipif(IS_WSL, reason="WSL does not support CUDA IPC mempool sharing")
def test_ipc_mempool(ipc_device):
"""Test IPC with memory pools."""
# Set up the IPC-enabled memory pool and share it.
Expand Down Expand Up @@ -83,6 +87,7 @@ def child_main1(channel, queue):
stream.sync()


@pytest.mark.skipif(IS_WSL, reason="WSL does not support CUDA IPC mempool sharing")
def test_shared_pool_errors(ipc_device):
"""Test expected errors with allocating from a shared IPC memory pool."""
# Set up the IPC-enabled memory pool and share it.
Expand Down
9 changes: 8 additions & 1 deletion cuda_core/tests/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from cuda.core.experimental import Buffer, Device, DeviceMemoryResource, MemoryResource
from cuda.core.experimental._memory import DLDeviceType, IPCBufferDescriptor
from cuda.core.experimental._utils.cuda_utils import handle_return
from conftest import IS_WSL

POOL_SIZE = 2097152 # 2MB size

Expand Down Expand Up @@ -359,7 +360,13 @@ def test_mempool(mempool_device):
buffer.close()


@pytest.mark.parametrize("ipc_enabled", [True, False])
@pytest.mark.parametrize(
"ipc_enabled",
[
pytest.param(True, marks=pytest.mark.skipif(IS_WSL, reason="WSL does not support CUDA IPC mempool sharing")),
False,
],
)
@pytest.mark.parametrize(
"property_name,expected_type",
[
Expand Down