Skip to content

Commit a1c25e6

Browse files
committed
[CI Image] support CSI-NN2 in ci_qemu
* build CSI-NN2, download related toolchain and qemu
1 parent 8341e33 commit a1c25e6

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
@@ -108,5 +108,11 @@ RUN bash /install/ubuntu_install_ethosu_driver_stack.sh
108108
COPY install/ubuntu_install_vela.sh /install/ubuntu_install_vela.sh
109109
RUN bash /install/ubuntu_install_vela.sh
110110

111+
#Install CSI-NN2
112+
COPY install/ubuntu_download_csinn2_compute_lib.sh /install/ubuntu_download_csinn2_compute_lib.sh
113+
RUN bash /install/ubuntu_download_csinn2_compute_lib.sh
114+
111115
# Update PATH
112116
ENV PATH /opt/arm/gcc-arm-none-eabi/bin:/opt/arm/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4:$PATH
117+
ENV PATH /opt/csi-nn2/csi-nn2/tools/gcc-toolchain/bin:$PATH
118+
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 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)