diff --git a/.github/workflows/linux_cuda_wheel.yaml b/.github/workflows/linux_cuda_wheel.yaml index 4e711b8c3..d4e988ba2 100644 --- a/.github/workflows/linux_cuda_wheel.yaml +++ b/.github/workflows/linux_cuda_wheel.yaml @@ -70,8 +70,7 @@ jobs: # We test against 12.6 and 13.0 to avoid having too big of a CI matrix, # but for releases we should add 12.8. cuda-version: ['12.6', '13.0'] - # TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325 - ffmpeg-version-for-tests: ['4.4.2', '6', '7', '8.0'] + ffmpeg-version-for-tests: ['4.4.2', '5', '6', '7', '8.0'] container: image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}" @@ -89,10 +88,16 @@ jobs: name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64 path: pytorch/torchcodec/dist/ - name: Setup miniconda using test-infra - uses: pytorch/test-infra/.github/actions/setup-miniconda@main + uses: conda-incubator/setup-miniconda@v3 with: + # Using miniforge instead of miniconda ensures that the default + # conda channel is conda-forge instead of main/default. This ensures + # ABI consistency between dependencies: + # https://conda-forge.org/docs/user/transitioning_from_defaults/ + miniforge-version: latest python-version: ${{ matrix.python-version }} - # We install conda packages at the start because otherwise conda may have conflicts with dependencies. + - name: Install dependencies + run: | # Note: xorg-libxau was addded to fix a problem with ffmpeg 4. We should consider removing it. default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }} conda-forge::xorg-libxau" - name: Check env, set LD_LIBRARY_PATH @@ -104,18 +109,18 @@ jobs: echo LD_LIBRARY_PATH=$CONDA_PREFIX/lib:/usr/local/cuda/lib64/:${LD_LIBRARY_PATH} >> $GITHUB_ENV - name: Assert ffmpeg exists run: | - ${CONDA_RUN} ffmpeg -buildconf + ffmpeg -buildconf - name: Update pip run: ${CONDA_RUN} python -m pip install --upgrade pip - name: Install PyTorch run: | - ${CONDA_RUN} python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} - ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")' + conda run python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} + conda run python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")' - name: Install torchcodec from the wheel run: | wheel_path=`find pytorch/torchcodec/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"` echo Installing $wheel_path - ${CONDA_RUN} python -m pip install $wheel_path -vvv + python -m pip install $wheel_path -vvv - name: Check out repo uses: actions/checkout@v3 @@ -123,7 +128,7 @@ jobs: - name: Install test dependencies run: | # Ideally we would find a way to get those dependencies from pyproject.toml - ${CONDA_RUN} python -m pip install numpy pytest pillow + python -m pip install numpy pytest pillow - name: Delete the src/ folder just for fun run: | @@ -141,7 +146,7 @@ jobs: ls - name: Run Python tests run: | - ${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short + FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short - name: Run Python benchmark run: | - ${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none + time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none