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.
For UDO with CPU Runtime implementation
UDO package
For UDO with V68 DSP Runtime implementation
UDO package
Quantized DLC (HTP-enabled), see Preparing a model with UDO
DSP implementation lib, see Compiling a UDO package
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_cmakelistsFor 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:
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
Open the Developer Powershell which comes with the Visual Studio
Execute the environment setup script, set the environment variable
$env:QNN_SDK_ROOTand 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>Run the cmake instruction below to compile the UDO package:
cmake --build <build_dir> --config release --target installThe 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