Skip to content

Commit 6282658

Browse files
authored
[CI Image] support CSI-NN2 in ci_qemu (#11689)
* [CI Image] support CSI-NN2 in ci_qemu * build CSI-NN2, download related toolchain and qemu * using fixed csinn2 branch
1 parent bd800c9 commit 6282658

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

docker/Dockerfile.ci_qemu

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,11 @@ RUN bash /install/ubuntu_install_ethosu_driver_stack.sh
110110
COPY install/ubuntu_install_vela.sh /install/ubuntu_install_vela.sh
111111
RUN bash /install/ubuntu_install_vela.sh
112112

113+
#Install CSI-NN2
114+
COPY install/ubuntu_download_csinn2_compute_lib.sh /install/ubuntu_download_csinn2_compute_lib.sh
115+
RUN bash /install/ubuntu_download_csinn2_compute_lib.sh
116+
113117
# Update PATH
114118
ENV PATH /opt/arm/gcc-arm-none-eabi/bin:/opt/arm/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4:$PATH
119+
ENV PATH /opt/csi-nn2/csi-nn2/tools/gcc-toolchain/bin:$PATH
120+
ENV PATH /opt/csi-nn2/csi-nn2/tools/qemu/bin:$PATH
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
set -e
20+
21+
install_path="/opt/csi-nn2"
22+
23+
# Clone CSI-NN2 Compute Library source code
24+
git clone --depth 1 --branch 1.12.2 https://github.com/T-head-Semi/csi-nn2.git ${install_path}
25+
26+
# download cross-compiler when not building natively.
27+
# riscv gcc toolchain will be downloaded to "/path/csi-nn2/tools/gcc-toolchain".
28+
cd ${install_path}
29+
./script/download_toolchain.sh
30+
31+
# download custom QEMU to "/path/csi-nn2/tools/qemu".
32+
./script/download_qemu.sh
33+
34+
# build csinn2 lib for x86 and c906
35+
# lib will be installed in /path/csi-nn2/install
36+
# for x86
37+
make -j4; cd x86_build; make install; cd -
38+
# for c906
39+
mkdir -p riscv_build; cd riscv_build
40+
cmake ../ -DBUILD_RISCV=ON; make -j4; make install; cd -
41+

0 commit comments

Comments
 (0)