-
Notifications
You must be signed in to change notification settings - Fork 22
150 lines (137 loc) · 4.42 KB
/
windows-precompile-cuda.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
name: windows-precompile-cuda
on:
push:
tags:
- 'v*'
- 'windows-cuda'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
windows-precompile-cuda:
runs-on: windows-2019
env:
MIX_ENV: prod
OPENCV_VER: "4.10.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:
OTP_VERSION: "25"
NIF_VERSION: "2.16"
# cuda 11.8.0
cuda_major: "11"
cuda_minor: "8"
cuda_patch: "0"
# cudnn 8.9.7
cudnn_major: "8"
cudnn_minor: "9"
cudnn_patch: "7"
- pair:
OTP_VERSION: "25"
NIF_VERSION: "2.16"
# cuda 11.8.0
cuda_major: "11"
cuda_minor: "8"
cuda_patch: "0"
# cudnn 9.2.0
cudnn_major: "9"
cudnn_minor: "2"
cudnn_patch: "0"
- pair:
OTP_VERSION: "25"
NIF_VERSION: "2.16"
# cuda 12.5.0
cuda_major: "12"
cuda_minor: "5"
cuda_patch: "0"
# cudnn 8.9.7
cudnn_major: "8"
cudnn_minor: "9"
cudnn_patch: "7"
- pair:
OTP_VERSION: "25"
NIF_VERSION: "2.16"
# cuda 12.5.0
cuda_major: "12"
cuda_minor: "5"
cuda_patch: "0"
# cudnn 9.2.0
cudnn_major: "9"
cudnn_minor: "2"
cudnn_patch: "0"
name: x86_64-windows-msvc-cuda${{ matrix.pair.cuda_major }}-cudnn${{ matrix.pair.cudnn_major }}
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 ${{ matrix.pair.cudnn_major }}
uses: cocoa-xu/[email protected]
with:
cuda: ${{ matrix.pair.cuda_major }}.${{ matrix.pair.cuda_minor }}.${{ matrix.pair.cuda_patch }}
cudnn: ${{ matrix.pair.cudnn_major }}.${{ matrix.pair.cudnn_minor }}.${{ matrix.pair.cudnn_patch }}
# check python version and their EOL
# https://devguide.python.org/versions/
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- 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_major }}-cudnn${{ matrix.pair.cudnn_major }}-${GITHUB_REF##*/v}
mkdir -p "${PKG_NAME}"
export PRIV_DIR="$(pwd)/_build/${MIX_ENV}/lib/evision/priv"
export TMP_INCLUDE_DIR="$(pwd)/include"
mv "${PRIV_DIR}/include" "${TMP_INCLUDE_DIR}"
cp -a "${PRIV_DIR}" "${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"
cd "${RUNNER_DIR}/artifacts"
sha256sum "${PKG_NAME}.tar.gz" | tee "${PKG_NAME}.tar.gz.sha256"
mv "${TMP_INCLUDE_DIR}" "${PRIV_DIR}/include"
- uses: softprops/action-gh-release@v2
with:
files: |
artifacts/*.tar.gz
artifacts/*.sha256