This document provides a step-by-step guide to set up the build environment for the MediaTek ExercuTorch libraries.
Before you begin, ensure you have the following prerequisites installed and configured:
$PATH environment variable.export PATH=<path_to_buck>:$PATH
$ANDROID_NDK environment variable is set to the path where the NDK is located.export ANDROID_NDK=<path_to_android_ndk>
Download the following libraries from MediaTek's NeuroPilot portal (link to be added):
libneuronusdk_adapter.mtk.so: This universal SDK contains the implementation required for executing target-dependent code on the MediaTek chip.libneuron_buffer_allocator.so: This utility library is designed for allocating DMA buffers necessary for model inference.export NEURON_BUFFER_ALLOCATOR_LIB=<path_to_buffer_allocator>
Follow the steps below to set up your build environment:
ExercuTorch Official Tutorial: Refer to the Setting up ExercuTorch guide for detailed instructions on setting up the ExercuTorch environment.
Build Script: Once the prerequisites are in place, run the mtk_build.sh script to start the build process.
./mtk_build.sh
Push MediaTek universal SDK to the device: push libneuronusdk_adapter.mtk.so to the phone and export it to the $LD_LIBRARY_PATH environment variable before executing ExercuTorch with MediaTek backend.
export LD_LIBRARY_PATH=<path_to_usdk>:$LD_LIBRARY_PATH