diff --git a/.github/scripts/setup-env.sh b/.github/scripts/setup-env.sh index 64b4aa7fa90..8c5b53fd281 100755 --- a/.github/scripts/setup-env.sh +++ b/.github/scripts/setup-env.sh @@ -82,6 +82,12 @@ echo '::group::Install TorchVision' pip install -e . -v --no-build-isolation echo '::endgroup::' +if [[ "${CVCUDA:-}" == "1" ]]; then + echo '::group::Install CV-CUDA' + pip install --progress-bar=off cvcuda-cu12 + echo '::endgroup::' +fi + echo '::group::Install torchvision-extra-decoders' # This can be done after torchvision was built if [[ "$(uname)" == "Linux" && "$(uname -m)" != "aarch64" ]]; then diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ddded5b2266..49016d17c28 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,6 +45,36 @@ jobs: ./.github/scripts/unittest.sh + unittests-linux-cvcuda: + strategy: + matrix: + python-version: + - "3.10" + runner: ["linux.g5.4xlarge.nvidia.gpu"] + gpu-arch-type: ["cuda"] + gpu-arch-version: ["12.6"] + fail-fast: false + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + permissions: + id-token: write + contents: read + with: + repository: pytorch/vision + runner: ${{ matrix.runner }} + gpu-arch-type: ${{ matrix.gpu-arch-type }} + gpu-arch-version: ${{ matrix.gpu-arch-version }} + timeout: 120 + test-infra-ref: main + script: | + set -euo pipefail + + export PYTHON_VERSION=${{ matrix.python-version }} + export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }} + export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }} + export CVCUDA="1" + + ./.github/scripts/unittest.sh + unittests-macos: strategy: matrix: diff --git a/test/test_transforms_v2.py b/test/test_transforms_v2.py index 670a9d00ffb..978d6e04756 100644 --- a/test/test_transforms_v2.py +++ b/test/test_transforms_v2.py @@ -6825,7 +6825,7 @@ def test_functional_and_transform(self, dtype, device, color_space, batch_dims, assert F.get_size(output) == F.get_size(input_tensor) def test_functional_error(self): - with pytest.raises(TypeError, match="cvcuda_img should be `cvcuda.Tensor`"): + with pytest.raises(TypeError, match=r"cvcuda_img should be ``cvcuda\.Tensor``\. Got .+\."): F.cvcuda_to_tensor(object())