Skip to content

Latest commit

 

History

History
147 lines (107 loc) · 5.23 KB

SetupV2H.md

File metadata and controls

147 lines (107 loc) · 5.23 KB

Installation

Requirements

Requirements are listed below.

  • OS : Ubuntu 20.04
  • Python : 3.8.10
  • Package : git
  • Evaluation Board: RZ/V2H EVK
  • Related Software Version:

To install DRP-AI TVM1 without Dockerfile, see Installing DRP-AI TVM1.
To install DRP-AI TVM1 with Dockerfile, see Installing DRP-AI TVM1 with Docker for RZ/V2H.

Installing DRP-AI TVM1 (RZ/V2H)

1. Preparation

Before installing DRP-AI TVM1, please follow the instruction below to install the software listed in Requirements.

Install DRP-AI Translator

Download the DRP-AI Translator from the Software section in DRP-AI and install it by following the User's Manual.
The following example shows a case where downloaded software is stored under /tmp/ and run as the root user.

cd /opt
apt update && DEBIAN_FRONTEND=noninteractive apt install -y git wget unzip curl libboost-all-dev libeigen3-dev build-essential python3-pip libgl1-mesa-dev
chmod +x /tmp/DRP-AI_Translator_i8-v1.03-Linux-x86_64-Install
/tmp/DRP-AI_Translator_i8-v1.03-Linux-x86_64-Install

export PYTHONPATH=${PWD}/DRP-AI_Translator_i8/drpAI_Quantizer:${PYTHONPATH}

Install RZ/V Software

  1. Download the RZ/V2H AI SDK from Renesas Web Page.

  2. Install SDK .
    The following example shows a case where downloaded software is stored under /tmp/ .

cd /tmp
unzip RTK0EF0180F0*000SJ.zip */poky*sh 
chmod a+x ./ai_sdk_setup/poky-glibc-x86_64-core-image-weston-aarch64-rzv2h-evk-ver1-toolchain-3.1.*.sh
./ai_sdk_setup/poky-glibc-x86_64-core-image-weston-aarch64-rzv2h-evk-ver1-toolchain-3.1.*.sh -y

2. Install the minimal pre-requisites

Please follow the steps below by root or sudo user.

# Install packagess
apt update
DEBIAN_FRONTEND=noninteractive apt install -y software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt update
DEBIAN_FRONTEND=noninteractive apt install -y build-essential cmake \
libomp-dev libgtest-dev libgoogle-glog-dev libtinfo-dev zlib1g-dev libedit-dev \
libxml2-dev llvm-8-dev g++-9 gcc-9
apt install -y libboost-all-dev libeigen3-dev
apt install -y libgl1-mesa-dev

pip3 install --upgrade pip
pip3 install scipy==1.5.4 psutil
pip3 install cython==3.0.11
pip3 install decorator attrs
pip3 install torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cpu
pip3 install tensorflow tflite tqdm

# Install onnx runtime
wget https://github.com/microsoft/onnxruntime/releases/download/v1.18.1/onnxruntime-linux-x64-1.18.1.tgz -O /tmp/onnxruntime.tar.gz
tar -xvzf /tmp/onnxruntime.tar.gz -C /tmp/
mv /tmp/onnxruntime-linux-x64-1.18.1/ /opt/

3. Clone the respository

cd ~/YOURWORKDIR
git clone --recursive https://github.com/renesas-rz/rzv_drp-ai_tvm.git drp-ai_tvm

cd drp-ai_tvm

4. Set environment variables

Run the following commands to set environment variables. Note that environment variables must be set every time when opening the terminal.

export TVM_ROOT=$PWD                                        # or path to your own cloned repository.
export TVM_HOME=${TVM_ROOT}/tvm
export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}
export SDK=/opt/poky/3.1.31                                 # or path to your own Linux SDK.
export TRANSLATOR=/opt/DRP-AI_Translator_i8/translator/     # or path to your own DRP-AI Translator.
export QUANTIZER=/opt/DRP-AI_Translator_i8/drpAI_Quantizer/ # or path to your own DRP-AI Quantizer.
export PRODUCT=V2H                                          # Product name (The case of V2L, V2M, and V2MA is not described in this document.)

5. Setup DRP-AI TVM1 environment

cd $TVM_ROOT
bash setup/make_drp_env.sh

Installing DRP-AI TVM1 with Docker (RZ/V2H)

1. Preparation for Docker

Before installing DRP-AI TVM1 with Docker, please prepare the following files in the working directory using the software listed in Requirements.

2. Download Dockerfile

wget https://raw.githubusercontent.com/renesas-rz/rzv_drp-ai_tvm/main/DockerfileV2H -O DockerfileV2H

3. Build docker image

unzip RTK0EF0180F0*000SJ.zip */poky*sh
mv ai_sdk_setup/* .
docker build -t drp-ai_tvm_v2h_image_${USER} -f DockerfileV2H .

4. Run docker image

mkdir data
docker run -it --name drp-ai_tvm_v2h_container_${USER} -v $(pwd)/data:/drp-ai_tvm/data drp-ai_tvm_v2h_image_${USER}

The local $(pwd)/data is mounted to /drp-ai_tvm/data on the Docker container by the above command option.
For example, you can use this directory to copy files created on the Docker container to your local environment.

Footnotes

  1. DRP-AI TVM is powered by EdgeCortix MERA™ Compiler Framework. 2 3 4 5 6 7 8 9