{CUDA Decoding} Destroy existing NVDEC decoder before recreating on s… #1380
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| name: Build VRS on ${{ matrix.os }} / XPRS=${{ matrix.XPRS_FLAG }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-14, macos-latest, ubuntu-latest] # note: macos builds are arm only | |
| XPRS_FLAG: ["ON", "OFF"] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo apt-get update -y | |
| sudo apt-get install -o Acquire::Retries=5 \ | |
| cmake git ninja-build libgtest-dev libfmt-dev \ | |
| libjpeg-dev libturbojpeg-dev libpng-dev \ | |
| liblz4-dev libzstd-dev libxxhash-dev \ | |
| libboost-dev \ | |
| libopus-dev \ | |
| qtbase5-dev portaudio19-dev \ | |
| libeigen3-dev | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| # Update or install cmake | |
| brew upgrade cmake || brew install cmake | |
| # Install deps, but use pre-installed git, ninja | |
| brew install googletest glog fmt \ | |
| jpeg-turbo libpng \ | |
| lz4 zstd xxhash \ | |
| boost \ | |
| opus \ | |
| qt5 portaudio \ | |
| eigen | |
| else | |
| echo "$RUNNER_OS not supported" | |
| exit 1 | |
| fi | |
| - name: Build FFMPEG | |
| shell: bash | |
| if: matrix.XPRS_FLAG == 'ON' | |
| run: | | |
| ./build_third_party_libs/build_ffmpeg_linuxunix.sh | |
| - name: Configure | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" == "macOS" ]; then | |
| # Homebrew installs to /opt/homebrew on ARM, /usr/local on Intel | |
| QT5_CELLAR="/opt/homebrew/Cellar/qt@5" | |
| if [ ! -d "$QT5_CELLAR" ]; then | |
| QT5_CELLAR="/usr/local/Cellar/qt@5" | |
| fi | |
| export QT_DIR=$(find "$QT5_CELLAR" -name "5.*" -depth 1 2>/dev/null) | |
| fi | |
| mkdir build | |
| cmake -S . -B build -G Ninja -DBUILD_WITH_XPRS:BOOL="${{ matrix.XPRS_FLAG }}" | |
| - name: Build and Test C++ | |
| shell: bash | |
| run: | | |
| cd build | |
| ninja all | |
| ctest -j8 | |
| build-nvcodec: | |
| name: Build VRS NVCODEC (Linux, build-only) | |
| runs-on: ubuntu-latest | |
| # GitHub-hosted runners have no NVIDIA GPU, so this only compiles the | |
| # ENABLE_NVCODEC path -- which needs nv-codec-headers but neither a GPU nor a | |
| # CUDA toolkit -- to catch OSS build breakage. GPU decode is validated | |
| # manually on a GPU machine (see projectaria_tools shipping docs). | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -o Acquire::Retries=5 \ | |
| cmake git ninja-build libgtest-dev libfmt-dev \ | |
| libjpeg-dev libturbojpeg-dev libpng-dev \ | |
| liblz4-dev libzstd-dev libxxhash-dev \ | |
| libboost-dev \ | |
| libopus-dev \ | |
| qtbase5-dev portaudio19-dev \ | |
| libeigen3-dev | |
| - name: Install nv-codec-headers | |
| run: | | |
| git clone --depth 1 --branch n12.1.14.0 \ | |
| https://github.com/FFmpeg/nv-codec-headers.git /tmp/nv-codec-headers | |
| sudo make -C /tmp/nv-codec-headers install PREFIX=/usr | |
| pkg-config --modversion ffnvcodec | |
| - name: Build FFMPEG | |
| shell: bash | |
| run: | | |
| ./build_third_party_libs/build_ffmpeg_linuxunix.sh | |
| - name: Configure (XPRS + NVCODEC) | |
| shell: bash | |
| run: | | |
| mkdir build | |
| cmake -S . -B build -G Ninja \ | |
| -DBUILD_WITH_XPRS:BOOL=ON -DENABLE_NVCODEC:BOOL=ON | |
| - name: Build C++ | |
| shell: bash | |
| run: | | |
| cd build | |
| ninja all |