Skip to content

.github/workflows/linux.yml: compile hip backends #171

.github/workflows/linux.yml: compile hip backends

.github/workflows/linux.yml: compile hip backends #171

Workflow file for this run

name: Build (Linux)
on:
push:
paths:
- 'CMakeLists.txt'
- 'cpu_source/*'
- 'cuda_source/*'
- 'nvrtc_source/*'
- '.github/workflows/linux.yml'
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Ninja
run: pip3 install ninja
- name: Setup CUDA
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda-nvcc-11-8 cuda-cudart-dev-11-8 cuda-nvrtc-dev-11-8 libcufft-dev-11-8
echo "PATH=/usr/local/cuda/bin${PATH:+:${PATH}}" >> $GITHUB_ENV
echo "CUDA_PATH=/usr/local/cuda" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/cuda/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
- name: Download VapourSynth headers
run: |
wget -q -O vs.zip https://github.com/vapoursynth/vapoursynth/archive/refs/tags/R57.zip
unzip -q vs.zip
mv vapoursynth*/ vapoursynth
- name: Configure
run: cmake -S . -B build -G Ninja
-D VS_INCLUDE_DIR="`pwd`/vapoursynth/include"
-D ENABLE_CUDA=ON
-D USE_NVRTC_STATIC=ON
-D ENABLE_CPU=ON
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_CXX_FLAGS="-Wall -ffast-math"
- name: Build
run: cmake --build build --config Release --verbose
- name: Install
run: cmake --install build --prefix artifact
- name: Setup HIP
run: |
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.0.2 jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
sudo apt update
sudo apt install hip-runtime-amd rocm-device-libs hipfft-dev
- name: Configure (HIP)
run: cmake -S . -B build_hip -G Ninja
-D VS_INCLUDE_DIR="`pwd`/vapoursynth/include"
-D ENABLE_CUDA=OFF
-D ENABLE_CPU=OFF
-D ENABLE_HIP=ON
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_CXX_FLAGS="-Wall -ffast-math"
-D CMAKE_PREFIX_PATH=/opt/rocm
- name: Build (HIP)
run: cmake --build build_hip --config Release --verbose
- name: Install (HIP)
run: cmake --install build_hip --prefix artifact
- name: Upload
uses: actions/upload-artifact@v3
with:
name: vs-dfttest2-Linux
path: artifact