Software Installation
Development Environment Deployment
Development Machine Preparation
In the previous section, we introduced the necessary preparations before using Docker containers. To help you quickly use the toolchain, we provide a Docker image containing the complete development environment, which greatly simplifies the deployment process of the development environment. The following will provide a detailed explanation of how to deploy the Docker container.
If you have downloaded the offline image, you need to use the following command to load the image locally first.
You can start the Docker container corresponding to the current OE version by running the following script directly from the first level of the OE package(the script will automatically pull the image from the official Docker hub if there is no local image):
Where data is the path to the evaluation dataset folder. Please create the path before running the command, otherwise loading problems may occur.
If you want to use the CPU version of the Docker image, you need to add the cpu parameter:
The download links for the relevant publicly available evaluation datasets that the OE package samples rely on can be accessed by referring to the introduction in section Dataset Download.
If you want to start the Docker container manually, you can refer to the following command, where {version} is the OE version number you are currently using.
For your convenience, we provide CPU Docker and GPU Docker for you to choose on demand.
-
Since the environment variables
PATHandLD_LIBRARY_PATHare configured during the build process of the OE Docker image, not using the recommended way (e.g., docker attach) to enter the container may result in the environment variables not being loaded correctly, which may lead to the use of abnormalities in tools such as Cmake, GCC, CUDA, and so on. -
If you want the Docker container to exit without removing it, use the command line
docker run -itto start it manually, without the--rmoption. -
If you want the Docker container to run background after startup, add the
-doption after the command linedocker run -it, the container ID will be returned after the container is started, and then you can enter the container again with the commanddocker exec -it {container ID} /bin/bash.
Local Manual Installation
In the previous section, we introduced the two quantization schemes and the environment dependencies and related instructions for Horizon's open-source efficient model training. This section will introduce you to the method of local manual installation of the environment. We recommend that after completing floating-point model training, you prioritize the simple and easy-to-use PTQ quantization scheme, and only switch to the QAT quantization scheme when accuracy issues cannot be resolved.
To manually install the environment locally, simply run the script below to complete the environment installation in one click.
The installation script will automatically check the environment. If there are missing dependencies or configurations, it will interrupt the installation process and give suggestions to fix it, as shown below:
Run the script again after adding the dependencies as suggested.
-
If you need to generate a board-side executeable program, use the cross-compilation tool
aarch64-none-linux-gnu-gccandaarch64-none-linux-gnu-g++. Its version isArm GNU Toolchain 12.2.Rel1. -
If you need to generate an X86 simulation environment executable program, use the
X86 gcc, if the script suggests that gcc/g++ versions are incorrect, you need to recreate the gcc and g++ soft links as gcc-12.2.0 and g++-12.2.0 after the required versions are installed. -
If you need to generate an QNX environment executable program, use the
aarch64-unknown-nto-qnx8.0.0-gccandaarch64-unknown-nto-qnx8.0.0-g++, and please note that due to license reasons, the QNX cross-compiler is not delivered with the OE package. If you need to obtain the QNX cross-compiler, please contact Horizon. -
For host-side (x86) dependent libraries (
isl,gmp,mpc,mpfr, etc.), if you use lib/x86_64-linux-gnu, please specify them byLD_LIBRARY_PATHin the compiled project if the compilation reports errors. -
If there is a glibc library version conflict problem during compilation, for example: the error of undefined symbols for
xxx@GLIBC_xxx, please specify the path toaarch64-none-linux-gnu/libof the toolchain by using-rpath-linkin the compiled project, and at the same time add-lxxxto the compiled project, for example:-lpthread.In addition, you should pay special attention to the variable
SRCS(boxed below) that records the source file. It is better to put it in front of the${LIBS}link library, otherwise it may also report undefined symbols.
-
The installation script will automatically check the environment. If there are missing dependencies or configurations, it will interrupt the installation process and you can run the script again after adding the dependencies as suggested.
-
After the installation script is completed successfully, it will add path and other information to the
~/.bashrcsystem environment variable(The environment variableLD_LIBRARY_PATHis often used and it is recommended that you check that the environment variable is as expected), runsource ~/.bashrcto make the current terminal configuration take effect.
Runtime Environment Deployment
In the previous section, we introduced the necessary preparations for the dev board before inference execution. Next, we will explain the board-side tools required for model inference execution and their installation methods.
Board Side Tool Installation
Supplementary Tools
Some of the supplementary tools of the toolchain are not included in the system image, but can be copied to the dev board by running the installation script in the OE package in the host environment, as follows:
Where ${board_ip} is the IP address you set for the dev board. Make sure that you can successfully access this IP on the development PC.
After the supplementary files are successfully installed, please restart the dev board and execute hrt_model_exec --help on the dev board to verify if the installation is successful.
DEB Deployment Package
To simplify the board-side deployment process, the UCP provides a DEB deployment package. After the package is installed, you can directly call the relevant tools through the command line to automatically install the required binaries and related dependencies, quickly set up and run UCP-related applications, greatly improving the convenience and efficiency of system configuration.
For detailed information about the DEB deployment package, please refer to the Overview - DEB Deployment Package in the UCP section.
Since the J6B platform runs the QNX operating system, the DEB packaging tool is not currently supported.
