.github/workflows/windows.yml: upgrade to hip 6.1.2 #196
This file contains 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 (Windows) | |
on: | |
push: | |
paths: | |
- 'CMakeLists.txt' | |
- 'source/*' | |
- 'cpu_source/*' | |
- 'rtc_source/*' | |
- 'hip_source/*' | |
- 'sycl_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: | |
fetch-depth: 1 | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Setup Ninja | |
run: pip install ninja | |
- 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: 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 | |
- name: Configure (CUDA) | |
shell: bash | |
run: cmake -S . -B build -G Ninja -LA | |
-D CMAKE_BUILD_TYPE=Release | |
-D ENABLE_CUDA=ON | |
-D ENABLE_CPU=OFF | |
-D USE_NVRTC_STATIC=ON | |
-D VAPOURSYNTH_INCLUDE_DIRECTORY="$(pwd)\vapoursynth\include" | |
-D CMAKE_CXX_FLAGS="/fp:fast /arch:AVX /EHsc" | |
-D CMAKE_CUDA_FLAGS="--threads 0 --use_fast_math --resource-usage -Wno-deprecated-gpu-targets" | |
-D CMAKE_CUDA_ARCHITECTURES="50;61-real;70-virtual;75-real;86-real;89-real" | |
-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 --verbose | |
- name: Install (CUDA) | |
run: cmake --install build --prefix install | |
- name: Setup LLVM | |
shell: bash | |
run: | | |
curl -s -o llvm-win64.exe -LJO https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/LLVM-16.0.6-win64.exe | |
7z x -ollvm llvm-win64.exe | |
- name: Configure, build, install (CPU) | |
shell: bash | |
run: for arch in haswell skylake icelake-client alderlake znver1 znver2 znver3 znver4; do | |
cmake -S . -B build_cpu -G Ninja -LA | |
-D CMAKE_BUILD_TYPE=Release | |
-D ENABLE_CUDA=OFF | |
-D ENABLE_CPU=ON | |
-D VAPOURSYNTH_INCLUDE_DIRECTORY="$(pwd)\vapoursynth\include" | |
-D CMAKE_CXX_COMPILER="$(pwd)/llvm/bin/clang++.exe" | |
-D CMAKE_CXX_FLAGS="-mtune=${arch} -ffast-math" | |
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded | |
&& cmake --build build_cpu --verbose | |
&& cmake --install build_cpu --prefix temp | |
&& mv temp/bin/bm3dcpu.dll install/bin/bm3dcpu-${arch}.dll -v; | |
done | |
- name: Cache HIP | |
id: cache-hip | |
uses: actions/cache@v3 | |
with: | |
path: C:\Program Files\AMD\ROCM | |
key: ${{ runner.os }}-rocm-6.1.2 | |
- name: Setup HIP | |
if: steps.cache-hip.outputs.cache-hit != 'true' | |
shell: pwsh | |
run: | | |
curl -s -o hip_installer.exe -L https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe | |
Start-Process hip_installer.exe -ArgumentList '-install' -NoNewWindow -Wait | |
- name: Configure (HIP) | |
shell: bash | |
run: cmake -S . -B build_hip -G Ninja -LA | |
-D CMAKE_BUILD_TYPE=Release | |
-D ENABLE_CUDA=OFF | |
-D ENABLE_CPU=OFF | |
-D ENABLE_HIP=ON | |
-D VAPOURSYNTH_INCLUDE_DIRECTORY="$(pwd)\vapoursynth\include" | |
-D CMAKE_CXX_COMPILER="C:/Program Files/AMD/ROCm/6.1/bin/clang++.exe" | |
-D CMAKE_CXX_FLAGS="-ffast-math -munsafe-fp-atomics -Rpass-analysis=kernel-resource-usage" | |
-D HIP_DIR="C:/Program Files/AMD/ROCm/6.1/lib/cmake/hip" | |
-D HIP_PLATFORM=amd | |
-D GPU_TARGETS="gfx1030;gfx1032;gfx1100;gfx1102" | |
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded | |
- name: Build (HIP) | |
run: cmake --build build_hip --verbose | |
- name: Install (HIP) | |
run: cmake --install build_hip --prefix install | |
- name: Cache SYCL | |
id: cache-sycl | |
uses: actions/cache@v3 | |
with: | |
path: C:\Program Files (x86)\Intel\oneAPI | |
key: ${{ runner.os }}-dpcpp-2024.0 | |
- name: Setup SYCL | |
if: steps.cache-sycl.outputs.cache-hit != 'true' | |
run: | | |
curl -J -o dpcpp_installer.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/94e15cb5-4bcc-4fdd-91cf-0f819a54e42e/w_dpcpp-cpp-compiler_p_2024.0.2.28_offline.exe | |
dpcpp_installer -s -a -s --eula accept | |
- name: Setup ocloc (Gen12+) | |
shell: pwsh | |
run: | | |
$env:PATH = "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\lib\ocloc;$env:PATH" | |
"PATH=$env:PATH" | Out-File -Append -FilePath $env:GITHUB_ENV | |
- name: Configure (SYCL, Gen12+) | |
run: | | |
ocloc compile --help | |
call "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" | |
cmake -S . -B build_sycl_gen12+ -G Ninja -LA ^ | |
-D CMAKE_BUILD_TYPE=Release ^ | |
-D ENABLE_CUDA=OFF ^ | |
-D ENABLE_CPU=OFF ^ | |
-D ENABLE_HIP=OFF ^ | |
-D ENABLE_SYCL=ON ^ | |
-D VAPOURSYNTH_INCLUDE_DIRECTORY="%cd%\vapoursynth\include" ^ | |
-D CMAKE_CXX_COMPILER=icx ^ | |
-D CMAKE_CXX_FLAGS="-ffast-math -mavx" ^ | |
-D CMAKE_SHARED_LINKER_FLAGS="-fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen \"-device gen12lp,xe-hpg\"" | |
- name: Build (SYCL, Gen12+) | |
run: | | |
call "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" | |
cmake --build build_sycl_gen12+ --verbose | |
- name: Install (SYCL, Gen12+) | |
run: echo f | xcopy build_sycl_gen12+\sycl_source\bm3dsycl.dll install\bin\bm3dsycl_gen12+.dll /f | |
- name: Prepare for upload | |
run: | | |
mkdir artifact | |
copy install\bin\*.dll artifact | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: VapourSynth-BM3DCUDA-Windows | |
path: artifact | |
- name: Compress artifact for release | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' | |
run: | | |
cd artifact | |
mkdir VapourSynth-BM3DCUDA-${{ github.event.inputs.tag }} | |
xcopy bm3dcuda.dll VapourSynth-BM3DCUDA-${{ github.event.inputs.tag }} /f | |
7z a -t7z -mx=9 ../VapourSynth-BM3DCUDA-${{ github.event.inputs.tag }}.7z VapourSynth-BM3DCUDA-${{ github.event.inputs.tag }} | |
mkdir VapourSynth-BM3DCUDA_RTC-${{ github.event.inputs.tag }} | |
xcopy bm3dcuda_rtc.dll VapourSynth-BM3DCUDA_RTC-${{ github.event.inputs.tag }} /f | |
7z a -t7z -mx=9 ../VapourSynth-BM3DCUDA_RTC-${{ github.event.inputs.tag }}.7z VapourSynth-BM3DCUDA_RTC-${{ github.event.inputs.tag }} | |
mkdir VapourSynth-BM3DCPU-${{ github.event.inputs.tag }} | |
xcopy bm3dcpu-*.dll VapourSynth-BM3DCPU-${{ github.event.inputs.tag }} /f | |
7z a -t7z -mx=9 ../VapourSynth-BM3DCPU-${{ github.event.inputs.tag }}.7z VapourSynth-BM3DCPU-${{ github.event.inputs.tag }} | |
mkdir VapourSynth-BM3DHIP-${{ github.event.inputs.tag }} | |
xcopy bm3dhip.dll VapourSynth-BM3DHIP-${{ github.event.inputs.tag }} /f | |
7z a -t7z -mx=9 ../VapourSynth-BM3DHIP-${{ github.event.inputs.tag }}.7z VapourSynth-BM3DHIP-${{ github.event.inputs.tag }} | |
mkdir VapourSynth-BM3DSYCL-${{ github.event.inputs.tag }} | |
xcopy bm3dsycl_*.dll VapourSynth-BM3DSYCL-${{ github.event.inputs.tag }} /f | |
7z a -t7z -mx=9 ../VapourSynth-BM3DSYCL-${{ github.event.inputs.tag }}.7z VapourSynth-BM3DSYCL-${{ github.event.inputs.tag }} | |
mkdir SYCL-Runtime-${{ github.event.inputs.tag }} | |
echo f | xcopy "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin\sycl6.dll" SYCL-Runtime-${{ github.event.inputs.tag }} /f | |
echo f | xcopy "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin\pi_*.dll" SYCL-Runtime-${{ github.event.inputs.tag }} /f /i | |
echo f | xcopy "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler\libmmd.dll" SYCL-Runtime-${{ github.event.inputs.tag }} /f | |
7z a -t7z -mx=9 ../SYCL-Runtime-${{ github.event.inputs.tag }}.7z SYCL-Runtime-${{ 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: | | |
VapourSynth-BM3DCUDA-${{ github.event.inputs.tag }}.7z | |
VapourSynth-BM3DCUDA_RTC-${{ github.event.inputs.tag }}.7z | |
VapourSynth-BM3DCPU-${{ github.event.inputs.tag }}.7z | |
VapourSynth-BM3DHIP-${{ github.event.inputs.tag }}.7z | |
VapourSynth-BM3DSYCL-${{ github.event.inputs.tag }}.7z | |
SYCL-Runtime-${{ github.event.inputs.tag }}.7z | |
fail_on_unmatched_files: true | |
generate_release_notes: false | |
prerelease: true |