For Edge - For Edge - 3.5 English - UG1354

Vitis AI Library User Guide (UG1354)

Document_ID
UG1354
Release_Date
2023-06-29
Version
3.5 English
To set up the host for Edge device development, follow these steps:
  1. Clone the Vitis AI repository:
    $ cd ~
    $ git clone https://github.com/Xilinx/Vitis-AI
  2. Install the cross-compilation system environment.
    $ cd Vitis-AI/board_setup/vek280
    $ ./host_cross_compiler_setup.sh
    Note:
    • ~/petalinux_sdk_2023.1 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_2023.1.
    • For Zynq UltraScale+ MPSoC and VCK190 boards, refer to Vitis AI 3.0: https://github.com/Xilinx/Vitis-AI/tree/v3.0.
  3. When the installation is complete, follow the prompts and execute the following command:
    $ source ~/petalinux_sdk_2023.1/environment-setup-cortexa72-cortexa53-xilinx-linux
    Note: If you close the current terminal, you need to re-execute the above instructions in the new terminal interface.
  4. To compile the library sample in the Vitis AI Library using classification as an example, execute the following command.
    $ cd ~/Vitis-AI/examples/vai_library/samples/classification
    $ bash -x build.sh

    The executable program is now produced.

  5. To modify the library source code, view and modify it under ~/Vitis-AI/src/vai_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, modify $HOME only.
  6. Build the libraries all at once by executing the following command.
    $ cd ~/Vitis-AI/src/vai_library
    $ ./cmake.sh --clean

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

    Note: All the source codes, samples, demos, and header files can be found in the ~/Vitis-AI/src/vai_library location.