-
Notifications
You must be signed in to change notification settings - Fork 4.2k
186 lines (170 loc) · 7.12 KB
/
linux-riscv64-cpu-gcc.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: linux-riscv64-cpu-gcc
on:
push:
branches: [master]
paths:
- '.github/workflows/linux-riscv64-cpu-gcc.yml'
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
- 'toolchains/riscv64-unknown-linux-gnu.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/riscv/**'
- 'tests/**'
pull_request:
branches: [master]
paths:
- '.github/workflows/linux-riscv64-cpu-gcc.yml'
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
- 'toolchains/riscv64-unknown-linux-gnu.toolchain.cmake'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/riscv/**'
- 'tests/**'
concurrency:
group: linux-riscv64-cpu-gcc-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
linux-gcc-riscv64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: cache-qemu
id: cache-qemu
uses: actions/cache@v3
with:
path: qemu-install
key: qemu-riscv64-install-20220502-4
- name: install-qemu-build-deps
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install autoconf automake autotools-dev ninja-build
- name: checkout-qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: qemu/qemu
path: qemu
ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
- name: qemu
if: steps.cache-qemu.outputs.cache-hit != 'true'
run: |
cd qemu
wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system
make -j2
make install
- name: riscv64-gnu-toolchain
run: |
sudo apt-get update
sudo apt-get install g++-riscv64-linux-gnu
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 2
- name: test
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/riscv64-linux-gnu" ctest --output-on-failure -j 2
linux-gcc-riscv64-c906:
runs-on: [self-hosted, linux, centos]
steps:
- uses: actions/checkout@v3
- name: configure
run: |
export RISCV_ROOT_PATH=/data/action/osd/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/c906-v226.toolchain.cmake -DCMAKE_BUILD_TYPE=release -DNCNN_OPENMP=OFF -DNCNN_THREADS=OFF -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=ON -DNCNN_SIMPLEOCV=ON -DNCNN_BUILD_EXAMPLES=ON ..
- name: build
run: cmake --build build -j 4
linux-gcc-riscv64-rvv:
runs-on: [self-hosted, linux, centos]
steps:
- uses: actions/checkout@v3
#- name: cache-qemu
#id: cache-qemu
#uses: actions/cache@v3
#with:
#path: qemu-install
#key: qemu-riscv64-install-20220502-3
#- name: install-qemu-build-deps
#if: steps.cache-qemu.outputs.cache-hit != 'true'
#run: |
#sudo apt-get update
#sudo apt-get install autoconf automake autotools-dev ninja-build
#- name: checkout-qemu
#if: steps.cache-qemu.outputs.cache-hit != 'true'
#uses: actions/checkout@v3
#with:
#repository: qemu/qemu
#path: qemu
#ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
#- name: qemu
#if: steps.cache-qemu.outputs.cache-hit != 'true'
#run: |
#cd qemu
#wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
#patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
#./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system
#make -j2
#make install
#- name: cache-riscv
#id: cache-riscv
#uses: actions/cache@v3
#with:
#path: rv64gcv-install-next
#key: rv64gcv-linux-install-20210504
#- name: install-riscv-build-deps
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#run: |
#sudo apt-get update
#sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler
#- name: checkout-riscv-gnu-toolchain
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#uses: actions/checkout@v3
#with:
#repository: riscv/riscv-gnu-toolchain
#path: riscv-gnu-toolchain
#ref: da01ba455ce3802ffa84fdca3a089079996dbfc3
#- name: checkout-riscv-gnu-toolchain-submodules
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#run: |
#cd riscv-gnu-toolchain
#git submodule update --init --recursive --depth 1 glibc
#git submodule update --init --recursive --depth 1 newlib
#git submodule update --init --recursive --depth 1 riscv-binutils
#git submodule update --init --recursive --depth 1 riscv-gcc
#git submodule update --init --recursive --depth 1 riscv-dejagnu
#git submodule update --init --recursive --depth 1 riscv-gdb
#- name: riscv-gnu-toolchain
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#run: |
#cd riscv-gnu-toolchain
#sed -i '/__OBSOLETE_MATH/d' newlib/newlib/libm/common/math_errf.c
#./configure --prefix=$GITHUB_WORKSPACE/rv64gcv-install-next --with-arch=rv64gcv_zfh
#make linux
#- name: riscv-strip-install
#if: steps.cache-riscv.outputs.cache-hit != 'true'
#run: find $GITHUB_WORKSPACE/rv64gcv-install-next -type f | xargs -i strip -g {} || true
- name: configure
run: export RISCV_ROOT_PATH=/data/action/osd/rv64gcv-install-next && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
- name: build
run: cmake --build build -j 4
- name: test-vlen256
run: |
export PATH=/data/action/osd/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=256,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install-next/sysroot" ctest --output-on-failure -j 4
- name: test-vlen128
run: |
export PATH=/data/action/osd/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=128,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install-next/sysroot" ctest --output-on-failure -j 4