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

android litert -fregister-allocation=64 bug #528

Open
sungerk opened this issue Jan 20, 2025 · 1 comment
Open

android litert -fregister-allocation=64 bug #528

sungerk opened this issue Jan 20, 2025 · 1 comment
Assignees
Labels
status:awaiting user response awaiting user response status:need more data need more data type:gpu delegate Issue with GPU delegation

Comments

@sungerk
Copy link

sungerk commented Jan 20, 2025

Process: com.geenk.zto.sys, PID: 13270
java.lang.RuntimeException: java.lang.IllegalArgumentException: Internal error: Failed to apply delegate: Failed to build program executable - Invalid build optionserror: unknown build option '-fregister-allocation=64'

                                                                                                Falling back to OpenGL
                                                                                                TfLiteGpuDelegate Init: No shader implementation for transpose
                                                                                                TfLiteGpuDelegate Prepare: delegate is not initialized
                                                                                                Node number 257 (TfLiteGpuDelegateV2) failed to prepare.
                                                                                                Restored original execution plan after delegate application failure.
                                                                                                	at com.zto.ai.machine_vision.c.d(Detector.java:41)
                                                                                                	at c1.a.a(DetectPackage.java:10)

mobile phone :PBBM00 Android 9

implementation("com.google.ai.edge.litert:litert-support:1.0.1")
implementation("com.google.ai.edge.litert:litert-gpu:1.0.1")
implementation("com.google.ai.edge.litert:litert-gpu-api:1.0.1")
implementation("com.google.ai.edge.litert:litert-metadata:1.0.1")

this is my code
`
public void init(Context context, String modelPath) {
CompatibilityList compatList = new CompatibilityList();
Interpreter.Options options = new Interpreter.Options();
if (compatList.isDelegateSupportedOnThisDevice()) {
options.setUseNNAPI(true);
GpuDelegate delegate = new GpuDelegate(compatList.getBestOptionsForThisDevice());
options.addDelegate(delegate);
} else {
options.setUseXNNPACK(true);
options.setNumThreads(4);
}
try {
MappedByteBuffer mappedByteBuffer = FileUtil.loadMappedFile(context, modelPath);
this.interpreter = new Interpreter(mappedByteBuffer, options);
initializeTensorShapes();
} catch (Exception e) {
throw new RuntimeException(e);
}
}

@pkgoogle
Copy link

Hi @sungerk, what model are you using?

@pkgoogle pkgoogle self-assigned this Jan 24, 2025
@pkgoogle pkgoogle added status:need more data need more data status:awaiting user response awaiting user response type:gpu delegate Issue with GPU delegation labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:awaiting user response awaiting user response status:need more data need more data type:gpu delegate Issue with GPU delegation
Projects
None yet
Development

No branches or pull requests

2 participants