Skip to content

Commit

Permalink
fix windows cuda ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed Feb 13, 2024
1 parent 9a0c1a1 commit 1384020
Showing 1 changed file with 86 additions and 10 deletions.
96 changes: 86 additions & 10 deletions .github/workflows/windows-precompile-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ concurrency:
cancel-in-progress: true

jobs:
mix_compile:
windows-precompile-cuda11:
runs-on: windows-2019
env:
MIX_ENV: prod
OPENCV_VER: "4.9.0"
ELIXIR_VERSION: "1.15.4"
ELIXIR_VERSION: "1.16.0"
EVISION_PREFER_PRECOMPILED: "false"
EVISION_GENERATE_LANG: "erlang,elixir"
EVISION_ENABLE_CONTRIB: "true"
Expand All @@ -41,6 +41,90 @@ jobs:
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"
Expand Down Expand Up @@ -76,14 +160,6 @@ jobs:
arch: x64
vsversion: "2019"

- name: Install CUDA with cuDNN 8.7.0
uses: cocoa-xu/[email protected]
if: ${{ matrix.pair.cudnn }} == '8.7.0'
with:
cuda: ${{ matrix.pair.cuda_ver }}
cudnn: ${{ matrix.pair.cudnn }}
cudnn_url: ${{ secrets.CUDA_V870_WINDOWS_X86_64_CUDA11 }}

- name: Install CUDA with cuDNN 8.9.0
uses: cocoa-xu/[email protected]
if: ${{ matrix.pair.cudnn }} == '8.9.0'
Expand Down

0 comments on commit 1384020

Please sign in to comment.