Skip to content

switch to ubicloud-standard-4-arm #255

switch to ubicloud-standard-4-arm

switch to ubicloud-standard-4-arm #255

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