This repository has been archived by the owner on Nov 2, 2022. It is now read-only.
forked from yaneurao/YaneuraOu
-
Notifications
You must be signed in to change notification settings - Fork 6
141 lines (131 loc) · 6.47 KB
/
make-deep-ubuntu.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
# for Linux environment
name: Make CI (DeepLearning for Ubuntu Linux)
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
build-ubuntu:
# ubuntu-latest = ubuntu-20.04
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
runs-on: ubuntu-20.04
strategy:
matrix:
edition:
- YANEURAOU_ENGINE_DEEP_ORT_CPU
- YANEURAOU_ENGINE_DEEP_TENSOR_RT
compiler:
- g++-10
- g++-11
- clang++-11
- clang++-12
- clang++-13
- clang++-14
- clang++-15
target:
- normal
archcpu:
- AVX2
steps:
- name: Checkout own repository
uses: actions/checkout@v2
with:
path: main
- name: install g++-10
# Ubuntu 20.04
run: |
sudo cat /etc/apt/sources.list
sudo ls -R /etc/apt/sources.list.d
sudo apt update
sudo apt install g++-10
if: ${{ matrix.compiler == 'g++-10' }}
- name: install g++-11
#
run: |
# sudo curl "https://keyserver.ubuntu.com/pks/lookup?search=0x1e9377a2ba9ef27f&op=get" -o /usr/share/keyrings/ubuntu-toolchain-r.gpg.asc
# echo "deb [signed-by=/usr/share/keyrings/ubuntu-toolchain-r.gpg.asc] http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/ubuntu-toolchain-r-test-focal.list
sudo cat /etc/apt/sources.list
sudo ls -R /etc/apt/sources.list.d
sudo apt update
sudo apt install g++-11
if: ${{ matrix.compiler == 'g++-11' }}
- name: install clang-11
# Ubuntu 20.04
run: |
sudo cat /etc/apt/sources.list
sudo ls -R /etc/apt/sources.list.d
sudo apt update
sudo apt install clang-11 libomp-11-dev
if: ${{ matrix.compiler == 'clang++-11' }}
- name: install clang-12
# Ubuntu 20.04 or LLVM APT
run: |
sudo cat /etc/apt/sources.list
sudo ls -R /etc/apt/sources.list.d
sudo apt update
sudo apt install clang-12 libomp-12-dev
if: ${{ matrix.compiler == 'clang++-12' }}
- name: install clang-13
# LLVM APT
run: |
# install clang-13
wget https://apt.llvm.org/llvm.sh
sudo bash ./llvm.sh 13 all
sudo cat /etc/apt/sources.list
sudo ls -R /etc/apt/sources.list.d
if: ${{ matrix.compiler == 'clang++-13' }}
- name: install clang-14
# LLVM APT
run: |
# install clang-14
wget https://apt.llvm.org/llvm.sh
sudo bash ./llvm.sh 14 all
sudo cat /etc/apt/sources.list
sudo ls -R /etc/apt/sources.list.d
if: ${{ matrix.compiler == 'clang++-14' }}
- name: install clang-15
# LLVM APT
run: |
# install clang-15
wget https://apt.llvm.org/llvm.sh
sudo bash ./llvm.sh 15 all
sudo cat /etc/apt/sources.list
sudo ls -R /etc/apt/sources.list.d
if: ${{ matrix.compiler == 'clang++-15' }}
- name: install ONNXRUNTIME
run: |
curl --create-dirs -RLo ${HOME}/resource/onnxruntime-linux-x64-1.11.1.tgz https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-linux-x64-1.11.1.tgz
tar xvf ${HOME}/resource/onnxruntime-linux-x64-1.11.1.tgz -C ${HOME}
if: ${{ matrix.edition == 'YANEURAOU_ENGINE_DEEP_ORT_CPU' }}
- name: install CUDA, TensorRT
# ここではCUDAアプリケーションの開発環境用に、CUDAドライバーを含まない cuda-minimal-build-11-7 をインストールしている。
# CUDAアプリケーションの実行環境用にセットアップする場合、 cuda-minimal-build-11-7 の代わりに
# CUDAドライバーを含むメタパッケージ、 cuda-11-7 もしくは cuda をインストールする。
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#package-manager-metas
# https://github.com/NVIDIA/cuda-repo-management/issues/4
run: |
sudo curl "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin" -o /etc/apt/preferences.d/cuda-repository-pin-600
sudo curl "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004-keyring.gpg" -o /usr/share/keyrings/cuda-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" | sudo tee /etc/apt/sources.list.d/cuda-ubuntu2004-x86_64.list &&\
sudo cat /etc/apt/sources.list
sudo ls -R /etc/apt/sources.list.d
sudo apt update
sudo apt install cuda-minimal-build-11-7 cuda-nvrtc-dev-11-7 libcublas-11-7 libcublas-dev-11-7 libnvinfer-dev libnvinfer-plugin-dev libnvonnxparsers-dev libnvparsers-dev
echo "/usr/local/cuda/bin" >> $GITHUB_PATH
if: ${{ matrix.edition == 'YANEURAOU_ENGINE_DEEP_TENSOR_RT' }}
- name: make YANEURAOU_ENGINE_DEEP_ORT_CPU
run: ./main/script/build.sh -e ${{ matrix.edition }} -c ${{ matrix.compiler }} -t ${{ matrix.target }} -a ${{ matrix.archcpu }} -x "EXTRA_CPPFLAGS=-I${HOME}/onnxruntime-linux-x64-1.11.1/include EXTRA_LDFLAGS=-L${HOME}/onnxruntime-linux-x64-1.11.1/lib"
if: ${{ matrix.edition == 'YANEURAOU_ENGINE_DEEP_ORT_CPU' }}
# ONNXRUNTIME版のビルド済みバイナリ実行時、 `${HOME}/onnxruntime-linux-x64-1.11.1/lib` のディレクトリを環境変数 `LD_LIBRARY_PATH` に追加するか、
# ライブラリ検索パス(`/usr/local/lib` など)の下にコピーし、root権限にてldconfigを実行してライブラリキャッシュを更新する。
- name: make YANEURAOU_ENGINE_DEEP_TENSOR_RT
run: ./main/script/build.sh -e ${{ matrix.edition }} -c ${{ matrix.compiler }} -t ${{ matrix.target }} -a ${{ matrix.archcpu }} -x "EXTRA_CPPFLAGS=-I/usr/local/cuda-11.7/include EXTRA_LDFLAGS=-L/usr/local/cuda-11.7/lib64 EXTRA_LDFLAGS+=-L/usr/local/cuda-11.7/lib64/stubs"
if: ${{ matrix.edition == 'YANEURAOU_ENGINE_DEEP_TENSOR_RT' }}
- uses: actions/upload-artifact@v2
with:
name: build-linux_deep_${{ github.run_number }}_${{ github.sha }}
path: ./main/build/**/**/*