Compiling a UDO package for Windows

Overview

This section provides information about how to prepare essential artifacts on Linux and compiling udo package on Windows.

As explained in Overview of UDO, This section explains detailed UDO library compilation flow on Windows.

Build Environment on Windows

  • CMake version minimum requirement 3.21

  • MSVC v143 ARM64 build tools

Essential Components

Listed below are the required components which need to be generated on Linux.

Create CMake UDO package

This step is performed on Linux, and the package can be used in both Linux and Windows.
Add argument \-\-gen_cmakelists when using snpe-udo-package-generator. e.g:
snpe-udo-package-generator --config_path <config_path> --output_path <output_path> --gen_cmakelists

For more information about the tool to create a UDO package refer to Creating a UDO package

Compiling a Windows UDO for Registration Library and CPU Implementation Library (Optional) on Devices

This step is performed on Windows, meaning that users have to copy the whole package from Linux to Windows.
Steps to compile the UDO Registration library on arm64 are as below:
  1. Copy the following item to a desired path on Host machine

    • UDO package from Linux

    • Qualcomm® AI Direct SDK

    • toolchain file from $SNPE_ROOT/share/SNPE/SnpeUdo/cmakefiles/CMakeWindows.cmake

  2. Open the Developer Powershell which comes with the Visual Studio

  3. Execute the environment setup script, set the environment variable $env:QNN_SDK_ROOT and run CMake commands

    & "$SNPE_ROOT\bin\envsetup.ps1"
    $env:QNN_SDK_ROOT = <path_to_qnn_sdk_root>
    cd <path_to_udo_package>
    cmake -S . -B <build_dir> -A arm64 -DCMAKE_TOOLCHAIN_FILE=<path_to_toolchainfile>
    
  4. Run the cmake instruction below to compile the UDO package:

    cmake --build <build_dir> --config release --target install
    

The expected artifacts after compiling are

  • The UDO CPU implementation library: <UDO-Package>/libs/arm64_windows/Udo<UDO-Package>ImplCpu.dll

  • The UDO package registration library: <UDO-Package>/libs/arm64_windows/Udo<UDO-Package>Reg.dll