-
Notifications
You must be signed in to change notification settings - Fork 22
163 lines (149 loc) · 5 KB
/
linux-cuda-gnu.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
151
152
153
154
155
156
157
158
159
160
161
162
163
name: linux-cuda
on:
workflow_dispatch:
pull_request:
types: [ labeled, synchronize, opened, reopened ]
paths-ignore:
- 'assets/**'
- '*.md'
- '**/*.md'
- 'LICENSE*'
- 'examples/**'
- 'nerves/**'
- 'gleam_src/**'
- 'Makefile.win'
- 'cc_toolchain/**'
- 'checksum.exs'
- '.github/FUNDING.yml'
- '.github/workflows/nerves-*'
- '.github/workflows/macos-*'
- '.github/workflows/windows-*'
- '.github/workflows/test-*.yml'
- '.github/workflows/linux-x86_64.yml'
- '.github/workflows/linux-arm64.yml'
- '.github/workflows/linux-armv7.yml'
- '.github/workflows/linux-ppc64le.yml'
- '.github/workflows/linux-s390x.yml'
- '.github/workflows/linux-precompile-*.yml'
push:
branches:
- main
paths-ignore:
- 'assets/**'
- '*.md'
- '**/*.md'
- 'LICENSE*'
- 'examples/**'
- 'nerves/**'
- 'Makefile.win'
- 'cc_toolchain/**'
- 'checksum.exs'
- '.github/FUNDING.yml'
- '.github/workflows/nerves-*'
- '.github/workflows/macos-*'
- '.github/workflows/windows-*'
- '.github/workflows/test-*.yml'
- '.github/workflows/linux-x86_64.yml'
- '.github/workflows/linux-arm64.yml'
- '.github/workflows/linux-armv7.yml'
- '.github/workflows/linux-ppc64le.yml'
- '.github/workflows/linux-s390x.yml'
- '.github/workflows/linux-precompile-*.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
x86_64-gnu-cuda:
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'cuda') }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- container: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
cuda_ver: "11.8.0"
cuda_id: "118"
container: ${{ matrix.container }}
env:
# container env vars
# ref link: https://github.com/elixir-nx/xla/blob/main/.github/workflows/release.yml
ImageOS: ubuntu20
LANG: en_US.UTF-8
LANGUAGE: en_US:en
LC_ALL: en_US.UTF-8
DEBIAN_FRONTEND: noninteractive
# evision related env vars
MIX_ENV: test
OPENCV_VER: "4.10.0"
OTP_VERSION: "25.3"
ELIXIR_VERSION: "1.16.1"
EVISION_PREFER_PRECOMPILED: "false"
EVISION_ENABLE_CUDA: "true"
PKG_CONFIG_PATH: "/usr/lib/x86_64-linux-gnu/pkgconfig"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies
run: |
apt-get update
apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip curl git libssl-dev gzip python3 ca-certificates \
libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libavresample-dev libeigen3-dev ffmpeg locales curl wget cmake
echo "${LANG} UTF-8" >> /etc/locale.gen
locale-gen
update-locale LANG=${LANG}
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Cache mix packages
id: cache-mix-deps
uses: actions/cache@v4
with:
key: deps-${{ hashFiles('mix.lock') }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}
path: |
./deps
- name: Get mix deps
if: steps.cache-mix-deps.outputs.cache-hit != 'true'
run: |
mix deps.get
- name: Cache OpenCV
id: cache-opencv
uses: actions/cache@v4
with:
key: opencv-with-contrib-${{ env.OPENCV_VER }}
path: |
./3rd_party
- name: Download OpenCV
if: steps.cache-opencv.outputs.cache-hit != 'true'
run: |
bash scripts/download_opencv.sh ${OPENCV_VER} 3rd_party/cache 3rd_party/opencv/
bash scripts/download_opencv_contrib.sh ${OPENCV_VER} 3rd_party/cache 3rd_party/opencv/
- name: Cache compiled OpenCV
id: cache-mix-compile_opencv
uses: actions/cache@v4
with:
key: compiled-opencv-${{ env.OPENCV_VER }}-cuda${{ matrix.cuda_ver }}-x86_64-linux-gnu-${{ hashFiles('Makefile') }}
path: |
./_build/${{ env.MIX_ENV }}/lib/evision
./c_src/headers.txt
./c_src/configuration.private.hpp
- name: Compile OpenCV
if: steps.cache-mix-compile_opencv.outputs.cache-hit != 'true'
run: |
mix compile_opencv
- name: Mix Compile
run: |
rm -f _build/${{ env.MIX_ENV }}/lib/evision/priv/evision.so
ls -la ./c_src
mix compile
ls -la ./lib/generated
- name: Cache testdata
id: cache-mix-testdata
uses: actions/cache@v4
with:
key: testdata-${{ hashFiles('test/downloading_list.txt') }}
path: |
./test/testdata
- name: Mix Test
run: |
mix test --include require_downloading --include require_ffmpeg