-
Notifications
You must be signed in to change notification settings - Fork 10
135 lines (110 loc) · 5.19 KB
/
linux.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build (Linux)
on:
push:
paths:
- 'CMakeLists.txt'
- 'source/*'
- 'cpu_source/*'
- 'hip_source/*'
- 'rtc_source/*'
- 'sycl_source/*'
- '.github/workflows/linux.yml'
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Ninja
run: pip install ninja
- 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: Setup CUDA
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda-nvcc-12-8 cuda-cudart-dev-12-8 cuda-nvrtc-dev-12-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: Configure (CUDA, CPU)
run: cmake -S . -B build -G Ninja -LA
-D USE_NVRTC_STATIC=ON
-D VAPOURSYNTH_INCLUDE_DIRECTORY="`pwd`/vapoursynth/include"
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_CXX_FLAGS="-Wall -ffast-math -march=x86-64-v3"
-D CMAKE_CUDA_FLAGS="--threads 0 --use_fast_math --resource-usage -Wno-deprecated-gpu-targets"
-D CMAKE_CUDA_ARCHITECTURES="50;61-real;70;75-real;86-real;89-real;90-real;100-real;120-real"
- name: Build (CUDA, CPU)
run: cmake --build build --verbose
- name: Install (CUDA, CPU)
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 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
- name: Configure (HIP)
run: cmake -S . -B build_hip -G Ninja -LA
-D CMAKE_BUILD_TYPE=Release
-D ENABLE_CPU=OFF -D ENABLE_CUDA=OFF -D ENABLE_HIP=ON
-D CMAKE_CXX_COMPILER=/opt/rocm/bin/amdclang++
-D CMAKE_CXX_FLAGS="-Wall -ffast-math -munsafe-fp-atomics -Rpass-analysis=kernel-resource-usage"
-D VAPOURSYNTH_INCLUDE_DIRECTORY="`pwd`/vapoursynth/include"
-D HIP_DIR=/opt/rocm/lib/cmake/hip
-D AMDDeviceLibs_DIR=/opt/rocm/lib/cmake/AMDDeviceLibs
-D amd_comgr_DIR=/opt/rocm/lib/cmake/amd_comgr
-D hsa-runtime64_DIR=/opt/rocm/lib/cmake/hsa-runtime64
-D GPU_TARGETS="gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103"
- name: Build (HIP)
run: cmake --build build_hip --verbose
- name: Install (HIP)
run: cmake --install build_hip --prefix artifact
- name: Setup SYCL
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor \
| sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
| sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install -y intel-oneapi-dpcpp-cpp-2025.0
- name: Setup ocloc
run: |
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key \
| sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" \
| sudo tee /etc/apt/sources.list.d/intel-gpu-jammy.list
sudo apt-get update
sudo apt-get install -y intel-ocloc
ocloc compile --help
- name: Configure (SYCL)
run: |
source /opt/intel/oneapi/compiler/latest/env/vars.sh
cmake -S . -B build_sycl -G Ninja -LA \
-D CMAKE_BUILD_TYPE=Release \
-D ENABLE_CPU=OFF -D ENABLE_CUDA=OFF -D ENABLE_HIP=OFF -D ENABLE_SYCL=ON \
-D VAPOURSYNTH_INCLUDE_DIRECTORY="`pwd`/vapoursynth/include" \
-D CMAKE_CXX_COMPILER=icpx \
-D CMAKE_CXX_FLAGS="-Wall -ffast-math -march=x86-64-v3" \
-D CMAKE_SHARED_LINKER_FLAGS="-fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen \"-device gen12lp,xe-hpg,xe-lpg,xe-lpgplus,xe2-hpg,xe2-lpg\""
- name: Build (SYCL)
run: |
source /opt/intel/oneapi/compiler/latest/env/vars.sh
cmake --build build_sycl --verbose
- name: Install (SYCL)
run: cmake --install build_sycl --prefix artifact
- name: Upload
uses: actions/upload-artifact@v4
with:
name: VapourSynth-BM3DCUDA-Linux
path: artifact