-
Notifications
You must be signed in to change notification settings - Fork 5
159 lines (131 loc) · 4.93 KB
/
windows.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Build (Windows)
on:
push:
paths:
- 'CMakeLists.txt'
- 'cpu_source/*'
- 'cuda_source/*'
- 'nvrtc_source/*'
- '.github/workflows/windows.yml'
workflow_dispatch:
inputs:
tag:
description: 'which tag to upload to'
default: ''
jobs:
build-windows:
runs-on: windows-2022
defaults:
run:
shell: cmd
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: true
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Setup Ninja
run: pip install ninja
- name: Cache CUDA
id: cache-cuda
uses: actions/cache@v3
with:
path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA
key: ${{ runner.os }}-cuda-12.0.0
- name: Setup CUDA
if: steps.cache-cuda.outputs.cache-hit != 'true'
run: |
curl -s -o cuda_installer.exe -L https://developer.download.nvidia.com/compute/cuda/12.0.0/network_installers/cuda_12.0.0_windows_network.exe
cuda_installer.exe -s nvcc_12.0 cudart_12.0 nvrtc_dev_12.0 cufft_12.0 cufft_dev_12.0
- name: Download VapourSynth headers
run: |
curl -s -o vs.zip -L https://github.com/vapoursynth/vapoursynth/archive/refs/tags/R57.zip
unzip -q vs.zip
mv vapoursynth-*/ vapoursynth/
- name: Configure (CUDA)
run: cmake -S . -B build_cuda -G Ninja -LA
-D CMAKE_BUILD_TYPE=Release
-D ENABLE_CUDA=ON
-D USE_NVRTC_STATIC=ON
-D ENABLE_CPU=OFF
-D VS_INCLUDE_DIR="%cd%\vapoursynth\include"
-D CMAKE_CXX_FLAGS="/fp:fast /EHsc"
-D CMAKE_SHARED_LINKER_FLAGS="/DELAYLOAD:cufft64_11.dll"
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
env:
CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0
CUDA_PATH_V12_0: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0
- name: Build (CUDA)
run: cmake --build build_cuda --verbose
- name: Install (CUDA)
run: cmake --install build_cuda --prefix install_cuda
- name: Prepare for upload (CUDA)
run: |
mkdir artifact_cuda
copy install_cuda\lib\*.dll artifact_cuda
mkdir cufft
copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin\cufft64_*.dll" cufft
- name: Upload (CUDA)
uses: actions/upload-artifact@v3
with:
name: vs-dfttest2-cuda-windows
path: artifact_cuda
- name: Upload cufft
uses: actions/upload-artifact@v3
if: false
with:
name: cufft-windows
path: cufft
- name: Configure (CPU)
shell: bash
run: cmake -S . -B build_cpu -G Ninja -LA
-D CMAKE_BUILD_TYPE=Release
-D ENABLE_CUDA=OFF
-D ENABLE_CPU=ON
-D VS_INCLUDE_DIR="$(pwd)/vapoursynth/include"
-D CMAKE_CXX_COMPILER=clang++
-D CMAKE_CXX_FLAGS="-ffast-math"
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
- name: Build (CPU)
run: cmake --build build_cpu --verbose
- name: Install (CPU)
run: cmake --install build_cpu --prefix install_cpu
- name: Prepare for upload (CPU)
run: |
mkdir artifact_cpu
copy install_cpu\lib\*.dll artifact_cpu
- name: Upload (CPU)
uses: actions/upload-artifact@v3
with:
name: vs-dfttest2-cpu-windows
path: artifact_cpu
- name: Compress artifact for release
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
run: |
cd artifact_cuda
mkdir vs-dfttest2-cuda-windows-${{ github.event.inputs.tag }}
xcopy dfttest2_cuda.dll vs-dfttest2-cuda-windows-${{ github.event.inputs.tag }} /f
xcopy dfttest2_nvrtc.dll vs-dfttest2-cuda-windows-${{ github.event.inputs.tag }} /f
7z a -t7z -mx=9 ../vs-dfttest2-cuda-windows-${{ github.event.inputs.tag }}.7z vs-dfttest2-cuda-windows-${{ github.event.inputs.tag }}
cd ../cufft
mkdir vsmlrt-cuda
xcopy cufft64_*.dll vsmlrt-cuda /f
7z a -t7z -mx=9 ../cufft-windows-${{ github.event.inputs.tag }}.7z vsmlrt-cuda
cd ../artifact_cpu
mkdir vs-dfttest2-cpu-windows-${{ github.event.inputs.tag }}
xcopy dfttest2_cpu.dll vs-dfttest2-cpu-windows-${{ github.event.inputs.tag }} /f
7z a -t7z -mx=9 ../vs-dfttest2-cpu-windows-${{ github.event.inputs.tag }}.7z vs-dfttest2-cpu-windows-${{ github.event.inputs.tag }}
- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
with:
tag_name: ${{ github.event.inputs.tag }}
files: |
vs-dfttest2-cuda-windows-${{ github.event.inputs.tag }}.7z
vs-dfttest2-cpu-windows-${{ github.event.inputs.tag }}.7z
cufft-windows-${{ github.event.inputs.tag }}.7z
dfttest2.py
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true