This directory contains the ArmNN driver for the Android Neural Networks API, implementing the [email protected] HAL.
- Android source tree for Android O MR1 or later, in the directory
<ANDROID_ROOT>
- Mali OpenCL driver integrated into the Android source tree
- Place this source directory at
<ANDROID_ROOT>/vendor/arm/android-nn-driver
- Run setup.sh
- Update the Android build environment to add the ArmNN driver. This ensures that the driver service
is built and copied to the
system/vendor/bin/hw
directory in the Android image. To update the build environment, add to the contents of the variablePRODUCT_PACKAGES
within the device-specific makefile that is located in the<ANDROID_ROOT>/device/<manufacturer>/<product>
directory. This file is normally calleddevice.mk
:
PRODUCT_PACKAGES += [email protected]
- Build Android as normal, i.e. run
make
in<ANDROID_ROOT>
- To confirm that the ArmNN driver has been built, check for driver service executable at
<ANDROID_ROOT>/out/target/product/<product>/system/vendor/bin/hw/[email protected]
- Run the ArmNN driver service executable in the background
adb shell /system/vendor/bin/hw/[email protected] &
- Run some code that exercises the Android Neural Networks API, for example Android's
NeuralNetworksTest
unit tests (note this is an optional component that must be built).
adb shell /data/nativetest/NeuralNetworksTest/NeuralNetworksTest > NeuralNetworkTest.log
- To confirm that the ArmNN driver is being used to service the Android Neural Networks API requests,
check for messages in logcat with the
ArmnnDriver
tag.