-
Notifications
You must be signed in to change notification settings - Fork 64
Add CI for linux cuda #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bbad58a
67d6862
d8f2d2f
b436b9e
8ed7939
8abceb1
a3a8048
5b62955
532f43e
753ee6e
2cf388f
9dff4e6
4ad8a6f
e6e0737
ab78c49
1396b97
a5547f9
60c11b8
353568a
7047622
71e7892
58b30f4
e4feaa6
eddb128
567baac
61717a6
a1882e0
9416931
7e02734
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
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"] | ||
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 | ||
|
||
script: | | ||
nvidia-smi | ||
conda create --yes --name test | ||
conda activate test | ||
conda install --quiet --yes pip cmake pkg-config nasm | ||
|
||
pip install --quiet --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu124 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Torchvision is required for the gpu benchmark which uses functional transforms from vision. See gpu_benchmark.py for details. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but we don't need it to build, right? So we might prefer to install it later. This is OK though, since this job is just a temporary setup I guess. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point. Should I move it below after the build step so it doesn't accidentally leak as a build-time dep? WDYT? |
||
conda install --quiet --yes nvidia::libnpp | ||
|
||
# Build and install FFMPEG from source with CUDA enabled. | ||
# The one on conda doesn't have CUDA enabled. | ||
# Sub-step: install nvidia headers. Reference this link for details: | ||
# https://docs.nvidia.com/video-technologies/video-codec-sdk/12.1/ffmpeg-with-nvidia-gpu/index.html | ||
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 | ||
|
||
# Now build FFMPEG from source with CUDA enabled. | ||
git clone --quiet https://git.ffmpeg.org/ffmpeg.git ffmpeg/ | ||
pushd ffmpeg | ||
git checkout origin/release/6.1 | ||
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 | ||
make --silent -j install | ||
popd | ||
|
||
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 ENABLE_NVTX=1 pip install -e ".[dev]" --no-build-isolation -vv --debug | ||
|
||
# We skip certain tests because they are not relevant to GPU decoding and they always fail with | ||
# a custom FFMPEG build. | ||
NicolasHug marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pytest -k "not (test_get_metadata or get_ffmpeg_version)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, fun fact: it's currently hard to tell whether the GPU tests are being ran at all, because they're protected within an "if" block. I'll share pointers on how to address this offline There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is accurate and a real problem. Should I address this in a different diff? |
||
python benchmarks/decoders/gpu_benchmark.py | ||
conda deactivate |
Uh oh!
There was an error while loading. Please reload this page.