Skip to content

[ci-windows-cuda] use cocoa-xu/[email protected] #52

[ci-windows-cuda] use cocoa-xu/[email protected]

[ci-windows-cuda] use cocoa-xu/[email protected] #52

name: windows-precompile-cuda
on:
push:
tags:
- 'v*'
- 'windows-cuda'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
windows-precompile-cuda11:
runs-on: windows-2019
env:
MIX_ENV: prod
OPENCV_VER: "4.9.0"
ELIXIR_VERSION: "1.16.0"
EVISION_PREFER_PRECOMPILED: "false"
EVISION_GENERATE_LANG: "erlang,elixir"
EVISION_ENABLE_CONTRIB: "true"
EVISION_ENABLE_CUDA: "true"
MAKE: "nmake"
MSBUILD_PLATFORM: x64
CMAKE_GENERATOR_TYPE: Ninja
EVISION_KEEP_OCV_BUILD_DIR: "false"
strategy:
fail-fast: false
matrix:
include:
- pair:
cuda_ver: "11.8.0"
cuda_id: "118"
cudnn: "8.7.0"
OTP_VERSION: "25"
NIF_VERSION: "2.16"
- pair:
cuda_ver: "11.8.0"
cuda_id: "118"
cudnn: "8.7.0"
OTP_VERSION: "26"
NIF_VERSION: "2.17"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Git Checkout
shell: bash
run: |
echo "$(pwd)"
cd ..
ls -lah
cp -rf evision /c/evision
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.pair.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
vsversion: "2019"
- name: Install CUDA with cuDNN 8.7.0
uses: cocoa-xu/[email protected]
with:
cuda: ${{ matrix.pair.cuda_ver }}
cudnn: ${{ matrix.pair.cudnn }}
cudnn_url: ${{ secrets.CUDA_V870_WINDOWS_X86_64_CUDA11 }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Get mix deps
shell: bash
run: |
cd C:/evision
mix deps.get
- name: Mix compile
shell: bash
run: |
cd C:/evision
mix compile
- name: Create precompiled library
shell: bash
run: |
export RUNNER_DIR=`pwd`
cd C:/evision
export PKG_NAME=evision-nif_${{ matrix.pair.NIF_VERSION }}-x86_64-windows-msvc-contrib-cuda${{ matrix.pair.cuda_id }}-${GITHUB_REF##*/v}
mkdir -p "${PKG_NAME}"
cp -a _build/${MIX_ENV}/lib/evision/priv "${PKG_NAME}"
cp -a lib/generated "${PKG_NAME}/elixir_generated"
cp -a src/generated "${PKG_NAME}/erlang_generated"
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}"
rm -rf "${PKG_NAME}"
ls -lah "${PKG_NAME}.tar.gz"
mkdir -p "${RUNNER_DIR}/artifacts"
mv "${PKG_NAME}.tar.gz" "${RUNNER_DIR}/artifacts"
- uses: softprops/action-gh-release@v1
with:
files: artifacts/*.tar.gz
windows-precompile-cuda12:
runs-on: windows-2019
env:
MIX_ENV: prod
OPENCV_VER: "4.9.0"
ELIXIR_VERSION: "1.16.0"
EVISION_PREFER_PRECOMPILED: "false"
EVISION_GENERATE_LANG: "erlang,elixir"
EVISION_ENABLE_CONTRIB: "true"
EVISION_ENABLE_CUDA: "true"
MAKE: "nmake"
MSBUILD_PLATFORM: x64
CMAKE_GENERATOR_TYPE: Ninja
EVISION_KEEP_OCV_BUILD_DIR: "false"
strategy:
fail-fast: false
matrix:
include:
- pair:
cuda_ver: "12.1.0"
cuda_id: "121"
cudnn: "8.9.0"
OTP_VERSION: "25"
NIF_VERSION: "2.16"
- pair:
cuda_ver: "12.1.0"
cuda_id: "121"
cudnn: "8.9.0"
OTP_VERSION: "26"
NIF_VERSION: "2.17"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Git Checkout
shell: bash
run: |
echo "$(pwd)"
cd ..
ls -lah
cp -rf evision /c/evision
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.pair.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
vsversion: "2019"
- name: Install CUDA with cuDNN 8.9.0
uses: cocoa-xu/[email protected]
with:
cuda: ${{ matrix.pair.cuda_ver }}
cudnn: ${{ matrix.pair.cudnn }}
cudnn_url: ${{ secrets.CUDA_V890_WINDOWS_X86_64_CUDA12 }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Get mix deps
shell: bash
run: |
cd C:/evision
mix deps.get
- name: Mix compile
shell: bash
run: |
cd C:/evision
mix compile
- name: Create precompiled library
shell: bash
run: |
export RUNNER_DIR=`pwd`
cd C:/evision
export PKG_NAME=evision-nif_${{ matrix.pair.NIF_VERSION }}-x86_64-windows-msvc-contrib-cuda${{ matrix.pair.cuda_id }}-${GITHUB_REF##*/v}
mkdir -p "${PKG_NAME}"
cp -a _build/${MIX_ENV}/lib/evision/priv "${PKG_NAME}"
cp -a lib/generated "${PKG_NAME}/elixir_generated"
cp -a src/generated "${PKG_NAME}/erlang_generated"
tar -czf "${PKG_NAME}.tar.gz" "${PKG_NAME}"
rm -rf "${PKG_NAME}"
ls -lah "${PKG_NAME}.tar.gz"
mkdir -p "${RUNNER_DIR}/artifacts"
mv "${PKG_NAME}.tar.gz" "${RUNNER_DIR}/artifacts"
- uses: softprops/action-gh-release@v1
with:
files: artifacts/*.tar.gz