android / ai-samples

Apache License 2.0
102 stars 14 forks source link

Required LLM feature not found #3

Open abaker opened 1 month ago

abaker commented 1 month ago

Trying to run sample on two devices (Pixel 8 Android 15 with "Enable on-device GenAI Features" enabled, Pixel 9 Pro w/ GrapheneOS w/play services & AICore installed), and I get the following error:

2024-10-01 12:18:07.410 15763-15763 EntryChoiceActivity     com.google.ai.edge.aicore.demo       E  Failed to check model availability. (Ask Gemini)
                                                                                                    com.google.ai.edge.aicore.UnknownException: AICore failed with error type 2-INFERENCE_ERROR and error code 8-NOT_AVAILABLE: Required LLM feature not found
                                                                                                        at com.google.ai.edge.aicore.GenerativeAIException$Companion.from$java_com_google_android_apps_aicore_client_client(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:7)
                                                                                                        at com.google.ai.edge.aicore.GenerativeModel$prepareInferenceEngine$2.invokeSuspend(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:9)
                                                                                                        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)
                                                                                                    Caused by: com.google.ai.edge.aicore.InferenceException: AICore failed with error type 2-INFERENCE_ERROR and error code 8-NOT_AVAILABLE: Required LLM feature not found
                                                                                                        at com.google.ai.edge.aicore.GenerativeAIException$Companion.from$java_com_google_android_apps_aicore_client_client(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:4)
                                                                                                        at com.google.ai.edge.aicore.GenerativeModel.getAiFeature(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:9)
                                                                                                        at com.google.ai.edge.aicore.GenerativeModel.access$getAiFeature(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:1)
                                                                                                        at com.google.ai.edge.aicore.GenerativeModel$getAiFeature$1.invokeSuspend(Unknown Source:14)
                                                                                                        ... 5 more

Clicking "Run the demo" buttons results in a toast that "Model is unavailable yet and downloading in background"

wilsoncastiblanco commented 1 month ago

I got the same error, I think there are extra steps to install native libraries on the device since I saw this on the logcat Unable to open libpenguin.so: dlopen failed: library "libpenguin.so" not found.

I'm running the demo on a Samsung Galaxy S24.

Note not sure if this is something that could cause the error (don't think so) but, the steps talk about verifying the release version:

Check out the AICore APK version in the Play store (under "about this app" tab) to confirm it starts with 0.thirdpartyeap

but, the beta version downloaded was 0.release.qc8650.prod_aicore_20240822.00_RC05.676804926

MillionthOdin16 commented 1 month ago

I have the same error messages and issue as OP. I'm running the most recent Android 15 beta on Pixel 9 pro XL. I followed the specific instructions added to the readme as well, but no luck.

aicore version 0.thirdpartyeap.prod_aicore_20240822.00_RC05.676804926 com.google.android.aicore

private compute version 1.0.release.667904832 com.google.android.as.oss

tzhang997 commented 1 month ago

Please ensure that you are only running the demo on Pixel 9 series device.

If you are seeing Required LLM feature not found error, please ensure that you have followed the instructions to set up your testing environment (Prerequisites & Update APKs sections especially).

MillionthOdin16 commented 1 month ago

If you are seeing "Required LLM feature not found" error, please ensure that you have followed the instructions to set up your testing environment (Prerequisites & Update APKs sections especially).

I followed all the steps on my Pixel 9 and made sure that the apps are the correct version, but it's unable to download the model. I don't get any indication that there is any download progress at all.

Additionally, "0.thirdpartyeap.prod_aicore_20240822.00_RC05.676804926" appears to break all AI Core functionality for existing apps such as screenshots, phone call notes, and recorder summarization. Using the beta version of AI Core doesn't even allow the downloading of models for those tools. I had to unenroll in the beta and roll back to the normal release in order to successfully redownload the models after clearing the app data.

I'm wondering if there's an issue with downloading models on the EAP version?

SilverDestiny commented 1 month ago

If you are seeing "Required LLM feature not found" error, please ensure that you have followed the instructions to set up your testing environment (Prerequisites & Update APKs sections especially).

I followed all the steps on my Pixel 9 and made sure that the apps are the correct version, but it's unable to download the model. I don't get any indication that there is any download progress at all.

Additionally, "0.thirdpartyeap.prod_aicore_20240822.00_RC05.676804926" appears to break all AI Core functionality for existing apps such as screenshots, phone call notes, and recorder summarization. Using the beta version of AI Core doesn't even allow the downloading of models for those tools. I had to unenroll in the beta and roll back to the normal release in order to successfully redownload the models after clearing the app data.

I'm wondering if there's an issue with downloading models on the EAP version?

For Pixel 9, try to uninstall the sample app then install the sample app again to see whether it could fix the download issue (maybe reboot as well).

For other functionalities not working in EAP version, we'll fix it in the next AICore release. Thanks for reporting the issue!

TommyPeace commented 1 month ago

S24 Ultra

Failed to check model availability.
com.google.ai.edge.aicore.ConnectionException: AICore failed with error type 4-CONNECTION_ERROR and error code 601-BINDING_FAILURE: AiCore service failed to bind.
    at com.google.ai.edge.aicore.GenerativeAIException$Companion.from$java_com_google_android_apps_aicore_client_client(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:2)
    at com.google.ai.edge.aicore.GenerativeModel$prepareInferenceEngine$2.invokeSuspend(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:9)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)
  Caused by: java.lang.SecurityException: Not allowed to bind to service Intent { cmp=com.google.android.aicore/com.google.android.apps.aicore.service.multiuser.AiCoreMultiUserService }
    at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:2203)
    at android.app.ContextImpl.bindService(ContextImpl.java:2060)
    at android.content.ContextWrapper.bindService(ContextWrapper.java:878)
    at com.google.android.gms.internal.aicore.zzcf.zzf(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:1)
    at com.google.android.gms.internal.aicore.zzcf.zzb(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:3)
    at com.google.android.gms.internal.aicore.zzcg.zzp(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:3)
    at com.google.android.gms.internal.aicore.zzcg.zzh(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:1)
    at com.google.android.gms.internal.aicore.zzcg.zza(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:1)
    at com.google.ai.edge.aicore.GenerativeModel.getAiFeature(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:2)
    at com.google.ai.edge.aicore.GenerativeModel.createLlmService(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:2)
    at com.google.ai.edge.aicore.GenerativeModel.access$createLlmService(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:1)
    at com.google.ai.edge.aicore.GenerativeModel$prepareInferenceEngine$2.invokeSuspend(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:5)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 
    at java.lang.Thread.run(Thread.java:1012) 
MillionthOdin16 commented 1 month ago

For Pixel 9, try to uninstall the sample app then install the sample app again to see whether it could fix the download issue (maybe reboot as well).

Yes, I've tried installing, rebooting, uninstalling and reinstalling, clearing app data for it and AI core, and as much as I can possibly think of.

I can't get to do anything other than give me an error message. The size of the EAP AI core data never exceeds 26 MB either.

MillionthOdin16 commented 1 month ago

S24 Ultra

They've stated it only supports the pixel 9 at the moment, so I don't think it will work.

kenkawakenkenke commented 1 month ago

Also confirming I see the same issue and stack trace as OP on a Pixel 9:

Same thing for the minimal example in the "Get started" page (https://developer.android.com/ai/gemini-nano/experimental#run-inference), I get the "Required LLM feature not found" error.

schitzoidimbolism commented 1 month ago

Also confirming I see the same issue and stack trace as OP on a Pixel 9:

  • I've followed all the steps on (https://developer.android.com/ai/gemini-nano/experimental), except for the line "that you are logged in with only the account that you intend to use for testing"; I have several accounts on my device. Perhaps this makes a difference?
  • Android AI Core: 0.thirdpartyeap.prod_aicore_20240822.00_RC05.676804926
  • Private Compute Service APK: 1.0.release.658389993

Same thing for the minimal example in the "Get started" page (https://developer.android.com/ai/gemini-nano/experimental#run-inference), I get the "Required LLM feature not found" error.

Can you please update this thread when you get a solution? I see the same stacktrace after following all steps except dẹleting all accounts except the enrolled one as well, but assumed I was stuck because I'm on a pixel 8. Apicore beta and PCS are the correct versions and enrollment is complete.

HuixingWong commented 1 month ago

I also encountered this problem.

sam43 commented 1 month ago

Encountered same issue on Google Pixel 8 Pro and stack trace are following:

I've followed all the steps on (https://developer.android.com/ai/gemini-nano/experimental), except for the line "that you are logged in with only the account that you intend to use for testing"; I have several accounts on my device. Perhaps this makes a difference? Android AI Core: 0.thirdpartyeap.prod_aicore_20240822.00_RC05.676804926 Private Compute Service APK: 1.0.release.658389993 Same thing for the minimal example in the "Get started" page (https://developer.android.com/ai/gemini-nano/experimental#run-inference), I get the "Required LLM feature not found" error.

StackTrace::

 com.google.ai.edge.aicore.demo       E  Failed to check model availability. (Ask Gemini)
                           com.google.ai.edge.aicore.UnknownException: AICore failed with error type 2-INFERENCE_ERROR and error code 8-NOT_AVAILABLE: Required LLM feature not found
                          at com.google.ai.edge.aicore.GenerativeAIException$Companion.from$java_com_google_android_apps_aicore_client_client(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:7)
                         at com.google.ai.edge.aicore.GenerativeModel$prepareInferenceEngine$2.invokeSuspend(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:9)
                         at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                         at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
                         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                         at java.lang.Thread.run(Thread.java:1012)
 Caused by: com.google.ai.edge.aicore.InferenceException: AICore failed with error type 2-INFERENCE_ERROR and error code 8-NOT_AVAILABLE: Required LLM feature not found
                         at com.google.ai.edge.aicore.GenerativeAIException$Companion.from$java_com_google_android_apps_aicore_client_client(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:4)
                         at com.google.ai.edge.aicore.GenerativeModel.getAiFeature(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:9)
                         at com.google.ai.edge.aicore.GenerativeModel.access$getAiFeature(com.google.ai.edge.aicore:aicore@@0.0.1-exp01:1)
                         at com.google.ai.edge.aicore.GenerativeModel$getAiFeature$1.invokeSuspend(Unknown Source:14)
                         at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
                         at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) 
                         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 
                         at java.lang.Thread.run(Thread.java:1012) 
bcdj commented 1 month ago

For people who are encountering this issue on Pixel 9 devices, are your devices rooted? AICore is not available on rooted devcies.

MillionthOdin16 commented 1 month ago

For people who are encountering this issue on Pixel 9 devices, are your devices rooted? AICore is not available on rooted devcies.

I'm not rooted, running most recent version of Android 15 beta.

enduringstack commented 1 month ago

@bcdj if device is root,is there any methods using aicore?

mnasrallah301 commented 1 month ago

Are there any updates? I get the same error "Required LLM feature not found" despite following all instructions. It's sad that I can't test it

SilverDestiny commented 1 month ago

@bcdj if device is root,is there any methods using aicore?

No. AICore only works on unrooted devices.

tzhang997 commented 1 month ago

Thanks folks for reporting this issue. For those of you testing on Pixel 9 series devices, could you please capture a bug report and share it with us here? It will help us root cause the issue.

gauravzero commented 1 month ago

Hi, what about Pixel 8a non rooted devices. I followed the instructions but things didn’t work. As per the docs it says I can enable AIcore on it.

Thanks

On Wed, 16 Oct 2024 at 2:35 AM, tzhang997 @.***> wrote:

Thanks folks for reporting this issue. For those of you testing on Pixel 9 series devices, could you please capture a bug report and share it with us here https://issuetracker.google.com/issues/new?component=1657650&template=0&pli=1? It will help us root cause the issue.

— Reply to this email directly, view it on GitHub https://github.com/android/ai-samples/issues/3#issuecomment-2415153178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJQP6MVZJKSXGCWWHGP6OHTZ3V7QXAVCNFSM6AAAAABPGBUEMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJVGE2TGMJXHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

asthagarg2428 commented 1 week ago

Thanks folks for reporting this issue. For those of you testing on Pixel 9 series devices, could you please capture a bug report and share it with us here? It will help us root cause the issue.

As per Gemini nano documentation there are many supported devices mentioned along with Pixel 9, what is the hard dependency of this sample project on Pixel 9?