forked from pytorch/torchcodec
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (66 loc) · 2.48 KB
/
cuda_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Unit-tests on Linux GPU
on:
pull_request:
push:
branches:
- nightly
- main
- release/*
workflow_dispatch:
jobs:
tests:
strategy:
matrix:
python_version: ["3.9"]
# TODO: Add more cuda versions.
cuda_arch_version: ["12.4"]
ffmpeg_version: ["origin/release/6.1"]
fail-fast: false
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.g5.4xlarge.nvidia.gpu
repository: pytorch/torchcodec
gpu-arch-type: cuda
gpu-arch-version: ${{ matrix.cuda_arch_version }}
timeout: 120
steps:
- name: Setup conda env
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniconda-version: "latest"
activate-environment: test
python-version: ${{ matrix.python-version }}
- name: Check nvidia driver presence
run: |
nvidia-smi
- name: Create and activate conda environment
conda create --yes --name test
conda activate test
conda install --quiet --yes pip cmake pkg-config nasm
- name: Install dependencies
run: |
pip install --quiet --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu124
conda install --quiet --yes nvidia::libnpp
- name: Build and install FFMPEG from source
run: |
git clone --quiet https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
pushd nv-codec-headers
make --silent PREFIX=$CONDA_PREFIX -j install
popd
git clone --quiet https://git.ffmpeg.org/ffmpeg.git ffmpeg/
pushd ffmpeg
git checkout ${{ matrix.ffmpeg_version }}
which pkg-config
pkg-config --list-all
./configure --prefix=$CONDA_PREFIX --enable-nonfree --enable-cuda-nvcc --disable-static --enable-shared --optflags=-fno-omit-frame-pointer --disable-stripping --enable-cuvid --enable-rpath
make --silent -j install
popd
- name: Run tests
run: |
CMAKE_BUILD_PARALLEL_LEVEL=8 CXXFLAGS="" LDFLAGS="-Wl,--allow-shlib-undefined -Wl,-rpath,$CONDA_PREFIX/lib -Wl,-rpath-link,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib" CMAKE_BUILD_TYPE=Release ENABLE_CUDA=1 pip install -e ".[dev]" --no-build-isolation -vv --debug
which ffmpeg
pytest -k "not (test_get_metadata or get_ffmpeg_version)" -vvv
- name: Clean up
run: |
conda deactivate