Speed up your runtime environment Deployment of arm-based devices

本文最后更新于:2022年7月29日 晚上

Introduction

Generally, it is not complicated to deploy the indispensable runtime environment of deep learning on arm-based devices. Unfortunately, the prior problem of deploying the environment is the awful download speed under a closed network. Here are some methods to speed up your environment deployment.

Apt sources list

Although we deploy the deep learning runtime environment through the python-pip package tool, however, to install python-pip and some fundamental packages on ubuntu for arm, it is necessary to modify the apt source setup.
First, open /etc/apt/sources.list and replace the text with the following content.

1
2
3
4
5
6
7
8
9
10
11
12
13
# basic software source of Tsinghua university
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse

# preposed software source
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse

If you are in Ubuntu 20.10, you should place the following content:

1
2
3
4
5
6
7
8
9
10
11
12
13
# basic software source of Tsinghua university
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse

# preposed software source
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse

And you can apply the following script to replace the apt source of Huawei:

1
2
wget -O /etc/apt/sources.list https://repo.huaweicloud.com/repository/conf/Ubuntu-Ports-bionic.list
apt-get update

Python-pip mirror source

The simplest method is the following script:

1
2
3
4
5
6
# replace proper mirror source with https:xxx
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
or
pip config set global.index-url http://pypi.douban.com/simple
or use
pip install xxx -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

Then you can apply pip install xxx and Enjoy it.