For Edge - For Edge - 1.3 English - UG1354

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2021-02-03
Version
1.3 English
Use the following steps to set up the host for Edge device development.
  1. Download the sdk-2020.2.0.0.sh from here.
  2. Install the cross-compilation system environment.
    ./sdk-2020.2.0.0.sh
  3. Follow the prompts to install.
    Note: The ~/petalinux_sdk path is recommended for the installation. Regardless of the path you choose for the installation, make sure the path has read-write permissions. In this section, it is installed in ~/petalinux_sdk.
  4. When the installation is complete, follow the prompts and execute the following command:
    source ~/petalinux_sdk/environment-setup-aarch64-xilinx-linux
    If you close the current terminal, you need to re-execute the above instructions in the new terminal interface.
  5. Download the vitis_ai_2020.2-r1.3.x.tar.gz from here and install it to the PetaLinux system.
    tar -xzvf vitis_ai_2020.2-r1.3.x.tar.gz -C ~/petalinux_sdk/sysroots/aarch64-xilinx-linux
  6. Clone the Vitis AI repository:
    cd ~
    git clone --recurse-submodules https://github.com/Xilinx/Vitis-AI
  7. To compile the library sample in the Vitis AI Library, take classification for example, execute the following command.
    cd ~/Vitis-AI/demo/Vitis-AI-Library/samples/classification
    bash -x build.sh

    The executable program is now produced.

  8. To modify the library source code, view and modify them under ~/Vitis-AI/tools/Vitis-AI-Library.

    Before compiling the Vitis AI libraries, confirm the compiled output path. The default output path is $HOME/build.

    To change the default output path, modify the build_dir_default in cmake.sh. For example, you can change from build_dir_default=$HOME/build/build.${target_info}/${project_name} to build_dir_default=/workspace/build/build.${target_info}/${project_name}.

    Note: If you want to modify the build_dir_default, it is suggested to modify $HOME only.
  9. Build the libraries all at once by executing the following command.
    cd ~/Vitis-AI/tools/Vitis-AI-Library
    ./cmake.sh --clean

    After compiling, you can find the generated AI libraries under build_dir_default. If you want to change the compilation rules, check and change the cmake.sh in the library’s directory.

    Note: All the source codes, samples, demos, and head files can be found under ~/Vitis-AI/tools/Vitis-AI-Library.