Giter VIP home page Giter VIP logo

android-nn-driver's Introduction

Arm NN Android Neural Networks driver

This directory contains the Arm NN driver for the Android Neural Networks API, implementing the HIDL based [email protected], [email protected], [email protected] and [email protected] HALs.

For Android 11 and lower, the NNAPI uses HIDL based HALs.

For Android 12 and Android 13, the NNAPI HAL revision uses AIDL instead of HIDL, and HIDL is deprecated.

For Android 14 the compatibility matrix no longer includes support for HIDL HAL revisions: https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android14-qpr1-release/compatibility_matrices/compatibility_matrix.8.xml

For more information about supported operations and configurations, see NnapiSupport.txt

For documentation about integrating this driver into an Android tree, see Integrator Guide

For FAQs and troubleshooting advice, see FAQ.md

License

The android-nn-driver is provided under the MIT license. See LICENSE for more information. Contributions to this project are accepted under the same license.

Individual files contain the following tag instead of the full license text.

SPDX-License-Identifier: MIT

This enables machine processing of license information based on the SPDX License Identifiers that are available here: http://spdx.org/licenses/

android-nn-driver's People

Contributors

alered01 avatar arovir01 avatar catcor01 avatar colm-in-arm avatar dbeck-arm avatar dereklambertiofarm avatar eanoca01 avatar ellnor01 avatar ferbal01 avatar finnwilliamsarm avatar francismurtagh-arm avatar james-conroy-arm avatar janeil01 avatar jimfly01 avatar keidav01 avatar kevinarm avatar matteoarm avatar matthewarm avatar matthewsloyanarm avatar mikejkelly avatar narumol-arm avatar nattapat-arm avatar nikraj01 avatar ruomei avatar sadikarm avatar saoirsearm avatar surmeh avatar telmoarm avatar teresaarm avatar zingo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-nn-driver's Issues

Cannot compile android-nn-driver 21.08

Hi,
I am not able to compile android-nn-driver 21.08, here is the error I get:

ArmnnPreparedModel_1_2.cpp:722:31: error: no matching function for call to 'MicrosecondsDuration'
        timing.timeOnDevice = MicrosecondsDuration(timeTaken.second, timeTaken.first);
                              ^~~~~~~~~~~~~~~~~~~~
ArmnnPreparedModel_1_2.cpp:38:15: note: candidate function not viable: no known conversion from 'time_point<std::chrono::system_clock, [...]>' to 'time_point<std::chrono::steady_clock, [...]>' for 1st argument
unsigned long MicrosecondsDuration(TimePoint endPoint, TimePoint startPoint)

At line 700 we can see that timeTaken is of type armnn::InferenceTimingPair which is defined such as:

using HighResolutionClock = std::chrono::high_resolution_clock::time_point;
using InferenceTimingPair = std::pair<HighResolutionClock, HighResolutionClock>;

inside armnn v21.08

while timepoint is defined as

using TimePoint = std::chrono::steady_clock::time_point;

inside ArmnnPreparedModel_1_2.cpp line 31

I am not a c++ expert, so maybe there is a magical option I can use to make this work? I am cross compiling using clang

I can work an a patch if needed.

Thanks

Questions about Android Q support

Hi ARM-software,

I'm using android-nn-driver well until Android P.
However, it is not possible to build in the Android Q recently.
Do you have any plans to support the Android Q? When?

Regards
HJ

Root access needed?

Hi @MatthewARM ,

Is root access needed to integrate Android NN driver?
Does Android O 8.1 device with ARM processor (say Huawei P20) come with Android NN driver pre-installed?

Thanks!

Missed OP

I tried to run tflitedemo example and found the message,

ArmnnDriver: ConvertConv2d: not supported by armnn

Will you have the plan to add it?

version 1.4 & AIDL interface for Android 14

I notice that the Andorid 14 request the min version of NN-service is 1.4, and require AIDL interface.
I would like to know the release plan for the version supported Android 14.
thanks a lot

ARM Android-nn-driver Build Issue

I'm trying to build the android-nn-driver by cloning it and pushing to ANDROID_ROOT following the integration guide. Currently the steps to generate the driver from the below step is unclear.
Update the Android build environment to add the Arm NN 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 variable PRODUCT_PACKAGES within the device-specific makefile that is located in the <ANDROID_ROOT>/device// directory. This file is normally called device.mk
I'm seeing the device.mk files & its dependent mk files in build of cloned repo (git clone https://android.googlesource.com/platform/manifest). Not clear about the linkage between the ADB shell and the android google source cloned repo.
device/ directory is in android google source clone & vendor/ directory is in adb shell ANDROID_ROOT. Please explain the linkage between these two.

Can someone explain/provide the clear steps to build the android-nn-driver using the android emulator & ADB shell.

Problem running driver

I am building [email protected], pushing it to device and running it manually through adb shell. When I try to run I am getting error:

09-24 04:00:22.692 9611 9611 I Manager : Found interface armnn
09-24 04:00:22.692 3235 3235 W hwservicemanager: getTransport: Cannot find entry [email protected]::IDevice/armnn in either framework or device manifest.

Any suggestion how to fix it?

How much memory consumption between 18.03-18.05 and 18.05-18.08?

In 18.05 release note, there is
"In general, the amount of RAM needed for a loaded network has been reduced by 20-30% compared to release 18.03."

And in 18.08 release note, there is
"This release of Arm NN integrates the latest Compute Library and adds improvements to thread-safety, memory consumption and overall performance."

I got information about memory usage in issue:
#8

But when I tried in 18.05, it looks like more than 2 * model size.
What version should I use to get better memory usage?

linux boost

pradeep.k@PradeepK-LaptopU:~/.../boost_1_64_0$ ./b2 install --user-config=$HOME/armnn-devenv/boost/user-config.jam \

toolset=gcc-arm link=static cxxflags=-fPIC --with-filesystem
--with-test --with-log --with-program_options -j16
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/tools/build/src/tools/gcc.jam:84: in gcc.init from module gcc
error: toolset gcc initialization:
error: provided command 'aarch64-linux-android-clang++' not found
error: initialized from /home/pradeep.k/armnn-devenv/boost/user-config.jam:1
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/tools/build/src/build/toolset.jam:43: in toolset.using from module toolset
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/tools/build/src/build/project.jam:1052: in using from module project-rules
/home/pradeep.k/armnn-devenv/boost/user-config.jam:1: in modules.load from module user-config
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/tools/build/src/build-system.jam:249: in load-config from module build-system
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/tools/build/src/build-system.jam:385: in load-configuration-files from module build-system
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/tools/build/src/build-system.jam:524: in load from module build-system
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build from module
/home/pradeep.k/armnn-devenv/boost/boost_1_64_0/boost-build.jam:17: in module scope from module

Is there a way to use android-nn-driver on existing smartphones?

Hi ARM-software,

I have a question about ARM HAL driver ([email protected]).
(I am new to the Android build system. So my question would be trivial.)
I refered to #2 and #4.

I have a galaxy s10+ device and I'd like to run tf-lite with ARM GPU by using android-nn-api path. In order to accelerate ARM GPU by using android-nn-api on smart phones, do I have to build this android-nn-driver in manual? (Isn't there prebuilt android-nn-driver?)
I'm also wondering it's possible to copy this driver([email protected]) to the existing target without flashing full image.

Regards,
Dongjin.

If I have a built image, can I manually run the serivce?

Hi ARMer,

I have a built image, and if I don't build-in the nn driver and just build service and *.so, then put them to my fomer image specific directory. run it manually, will it work?

Why ask this?

  • Because I try to run it in emulator, this emulator is from android studio. I don't want to change the emulator image to myself built.

What about my try?

  • fail. T_T.

Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.