Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use GPU Acceleration on Android? #47

Open
tomerh2001 opened this issue Feb 2, 2024 · 3 comments
Open

How to use GPU Acceleration on Android? #47

tomerh2001 opened this issue Feb 2, 2024 · 3 comments

Comments

@tomerh2001
Copy link

The guide mentioned setting up GPU delegation for IOS, but how can I do it in Android?

@mrousavy
Copy link
Owner

mrousavy commented Feb 5, 2024

As of today, there is no GPU acceleration available on Android. I didn't add it yet. If you need GPU acceleration on Android, consider contacting me through my agency Margelo, and we can develop that feature for you 👍

@jslok
Copy link

jslok commented Feb 6, 2024

I have tried to enable nnapi acceleration but not sure what I am missing. The below will cause the camera to show a white screen for about 20 seconds on init, then the model will fail to load. The interpreter ends up null and throws error "Failed to create TFLite interpreter from model". I am open to hints if you are willing to point me in the direction, Marc.

In TensorflowPlugin.cpp:

#include <tensorflow/lite/delegates/nnapi/nnapi_delegate_c_api.h>

TfLiteNnapiDelegateOptions nnapi_options = TfLiteNnapiDelegateOptionsDefault();
auto delegate = TfLiteNnapiDelegateCreate(&nnapi_options);
TfLiteInterpreterOptionsAddDelegate(options, delegate);

Also tried with TfLiteInterpreterOptionsSetUseNNAPI but same result.

@mrousavy
Copy link
Owner

mrousavy commented Feb 6, 2024

Yea I tried that as well but didn't investigate further.
If you find something let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants