Skip to content

Commit f656a22

Browse files
authored
Docker env for Arm® Ethos™-U55 Port (#8514)
* Docker env for Arm® Ethos™-U55 Port * Added Arm® Corstone™-300 Reference System for testing * Added Arm® Ethos™-U driver stack * Added installation of Arm® Vela. Co-authored-by: Manupa Karunaratne <manupa.karunaratne@arm.com> Change-Id: Ie3cc43943c876d95618a39887aa666da20bcb1e4 * Docker env for Arm® Ethos™-U55 Port * Removes /opt/arm/cmake/bin from the path * Parameterizes Arm® Ethos™-U55 driver stack version number Change-Id: I2162b40f82241fd013643cbfa8847b60d7f4f5a1 * Docker env for Arm® Ethos™-U55 Port * Adds ethosu as an extra to /python/gen_requirements.py Change-Id: I2162b40f82241fd013643cbfa8847b60d7f4f5a1 * Docker env for Arm® Ethos™-U55 Port * Added comment explaining why Vela version needs to be pinned to 2.1.1 Change-Id: I1ade280faa5274cca78899f4dae9e596b16fb5df
1 parent 49d5879 commit f656a22

File tree

4 files changed

+142
-0
lines changed

4 files changed

+142
-0
lines changed

docker/Dockerfile.ci_cpu

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,13 @@ RUN bash /install/ubuntu_install_androidsdk.sh
112112
ENV ANDROID_HOME=/opt/android-sdk-linux/
113113
ENV ANDROID_NDK_HOME=/opt/android-sdk-linux/ndk/21.3.6528147/
114114

115+
# Arm(R) Ethos(TM)-U NPU driver
116+
COPY install/ubuntu_install_ethosu_driver_stack.sh /install/ubuntu_install_ethosu_driver_stack.sh
117+
RUN bash /install/ubuntu_install_ethosu_driver_stack.sh
118+
119+
# Install Vela compiler
120+
COPY install/ubuntu_install_vela.sh /install/ubuntu_install_vela.sh
121+
RUN bash /install/ubuntu_install_vela.sh
122+
123+
# Update PATH
124+
ENV PATH /opt/arm/gcc-arm-none-eabi/bin:$PATH
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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+
set -u
21+
set -o pipefail
22+
23+
fvp_dir="/opt/arm/FVP_Corstone_SSE-300_Ethos-U55"
24+
cmake_dir="/opt/arm/cmake"
25+
ethosu_dir="/opt/arm/ethosu"
26+
ethosu_driver_ver="21.05"
27+
cmsis_ver="5.7.0"
28+
29+
mkdir -p /opt/arm
30+
31+
tmpdir=$(mktemp -d)
32+
33+
cleanup()
34+
{
35+
rm -rf "$tmpdir"
36+
}
37+
38+
trap cleanup 0
39+
40+
# Ubuntu 18.04 dependencies
41+
apt-get update
42+
43+
apt-get install -y \
44+
bsdmainutils \
45+
build-essential \
46+
cpp \
47+
git \
48+
linux-headers-generic \
49+
make \
50+
python-dev \
51+
python3 \
52+
ssh \
53+
wget \
54+
xxd
55+
56+
# Download the FVP
57+
mkdir -p "$fvp_dir"
58+
cd "$tmpdir"
59+
curl -sL https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/MPS3/FVP_Corstone_SSE-300_Ethos-U55_11.14_24.tgz | tar -xz
60+
./FVP_Corstone_SSE-300_Ethos-U55.sh --i-agree-to-the-contained-eula --no-interactive -d "$fvp_dir"
61+
rm -rf FVP_Corstone_SSE-300_Ethos-U55.sh license_terms
62+
63+
# Setup cmake 3.19.5
64+
mkdir -p "${cmake_dir}"
65+
cd "$tmpdir"
66+
curl -sL -o cmake-3.19.5-Linux-x86_64.sh https://github.com/Kitware/CMake/releases/download/v3.19.5/cmake-3.19.5-Linux-x86_64.sh
67+
chmod +x cmake-3.19.5-Linux-x86_64.sh
68+
./cmake-3.19.5-Linux-x86_64.sh --prefix="${cmake_dir}" --skip-license
69+
rm cmake-3.19.5-Linux-x86_64.sh
70+
export PATH="${cmake_dir}/bin:${PATH}"
71+
72+
# Install the GCC toolchain
73+
mkdir -p /opt/arm/gcc-arm-none-eabi/
74+
gcc_arm_url='https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2?revision=ca0cbf9c-9de2-491c-ac48-898b5bbc0443&la=en&hash=68760A8AE66026BCF99F05AC017A6A50C6FD832A'
75+
curl --retry 64 -sSL ${gcc_arm_url} | tar -C /opt/arm/gcc-arm-none-eabi --strip-components=1 -jx
76+
export PATH="/opt/arm/gcc-arm-none-eabi/bin:${PATH}"
77+
78+
# Clone Arm(R) Ethos(TM)-U NPU driver stack
79+
mkdir "${ethosu_dir}"
80+
cd "${ethosu_dir}"
81+
git clone "https://review.mlplatform.org/ml/ethos-u/ethos-u-core-driver" core_driver
82+
cd core_driver
83+
git checkout tags/${ethosu_driver_ver}
84+
85+
cd "${ethosu_dir}"
86+
git clone "https://review.mlplatform.org/ml/ethos-u/ethos-u-core-platform" core_platform
87+
cd core_platform
88+
git checkout tags/${ethosu_driver_ver}
89+
90+
# Clone CMSIS
91+
cd "${ethosu_dir}"
92+
git clone "https://github.com/ARM-software/CMSIS_5.git" cmsis
93+
cd cmsis
94+
git checkout -f tags/${cmsis_ver}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
set -u
21+
set -o pipefail
22+
23+
pip3 install -U setuptools
24+
# In a refactor between v2.1.1 and v3.0.0, find_block_configs <appropriate function name> was removed from Vela.
25+
# Since this is still required for the TVM port, it will be reinstated in Vela in a future release.
26+
# Until then, it needs to be pinned to v2.1.1.
27+
pip3 install ethos-u-vela==2.1.1

python/gen_requirements.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@
7575
],
7676
),
7777
),
78+
# Provide support for Arm(R) Ethos(TM)-U NPU.
79+
(
80+
"ethosu",
81+
(
82+
"Requirements for using Arm(R) Ethos(TM)-U NPU",
83+
[
84+
"ethos-u-vela",
85+
],
86+
),
87+
),
7888
# Relay frontends.
7989
(
8090
"importer-caffe2",
@@ -205,6 +215,7 @@
205215
"docutils",
206216
"<0.17",
207217
), # Work around https://github.com/readthedocs/sphinx_rtd_theme/issues/1115
218+
("ethos-u-vela", "==2.1.1"),
208219
("future", None),
209220
("image", None),
210221
("matplotlib", None),

0 commit comments

Comments
 (0)