Skip to content

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

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

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

Workflow file for this run

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