diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index 26f9d2c44..d80f2a391 100755 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -61,6 +61,10 @@ conda install "cudatoolkit=$CUDA_REL" \ "ucx-py=$MINOR_VERSION.*" "ucx-proc=*=gpu" \ "rapids-build-env=$MINOR_VERSION.*" +# Pin pytest-asyncio because latest versions modify the default asyncio +# `event_loop_policy`. See https://github.com/dask/distributed/pull/4212 . +conda install "pytest-asyncio=<0.14.0" + # https://docs.rapids.ai/maintainers/depmgmt/ # conda remove -f rapids-build-env # conda install "your-pkg=1.0.0" diff --git a/dask_cuda/tests/test_dgx.py b/dask_cuda/tests/test_dgx.py index 86d82e6bb..10b37e47b 100644 --- a/dask_cuda/tests/test_dgx.py +++ b/dask_cuda/tests/test_dgx.py @@ -17,7 +17,6 @@ from dask_cuda.utils import wait_workers mp = mp.get_context("spawn") -ucp = pytest.importorskip("ucp") psutil = pytest.importorskip("psutil") @@ -114,6 +113,8 @@ def test_default(): def _test_tcp_over_ucx(): + ucp = pytest.importorskip("ucp") + with LocalCUDACluster(enable_tcp_over_ucx=True) as cluster: with Client(cluster) as client: res = da.from_array(numpy.arange(10000), chunks=(1000,)) @@ -133,6 +134,8 @@ def check_ucx_options(): def test_tcp_over_ucx(): + ucp = pytest.importorskip("ucp") # NOQA: F841 + p = mp.Process(target=_test_tcp_over_ucx) p.start() p.join() @@ -156,6 +159,7 @@ def test_tcp_only(): def _test_ucx_infiniband_nvlink(enable_infiniband, enable_nvlink, enable_rdmacm): cupy = pytest.importorskip("cupy") + ucp = pytest.importorskip("ucp") net_devices = _get_dgx_net_devices() openfabrics_devices = [d.split(",")[0] for d in net_devices] @@ -222,6 +226,8 @@ def check_ucx_options(): reason="Automatic InfiniBand device detection Unsupported for %s" % _get_dgx_name(), ) def test_ucx_infiniband_nvlink(params): + ucp = pytest.importorskip("ucp") # NOQA: F841 + p = mp.Process( target=_test_ucx_infiniband_nvlink, args=( @@ -237,6 +243,7 @@ def test_ucx_infiniband_nvlink(params): def _test_dask_cuda_worker_ucx_net_devices(enable_rdmacm): loop = IOLoop.current() + ucp = pytest.importorskip("ucp") cm_protocol = "rdmacm" if enable_rdmacm else "sockcm" net_devices = _get_dgx_net_devices() @@ -337,6 +344,8 @@ def _timeout_callback(): reason="Automatic InfiniBand device detection Unsupported for %s" % _get_dgx_name(), ) def test_dask_cuda_worker_ucx_net_devices(enable_rdmacm): + ucp = pytest.importorskip("ucp") # NOQA: F841 + p = mp.Process( target=_test_dask_cuda_worker_ucx_net_devices, args=(enable_rdmacm,), )