Direct answer
A backend-initialization error means the requested execution path did not become ready; it does not by itself identify a bad model, unsupported phone, or failing inference task. Record the exact backend request, runtime and native package revisions, manifest or packaging prerequisites, device/ABI identity, model artifact, and the full initialization error stage. Distinguish the application’s setting from what the engine actually initialized. If the API only returns success or an exception and does not expose the final device execution path, report that distinction as unobservable rather than claiming an accelerator was used. Use staged checks. Confirm the model file can be found and opened before attributing failure to backend setup. Then verify backend-specific prerequisites documented by the runtime, such as optional native libraries or a library directory where applicable. Check that the app bundle or install artifact contains the ABI-compatible files needed for that exact path. Initialization can fail because the library cannot load, a dependency is absent, or the backend rejects the configuration; these are different from an operator failure after initialization. The LiteRT-LM Kotlin guide shows a default CPU backend and describes GPU/NPU setup inputs, but it does not promise every configuration succeeds on every device. Preserve the first failure. Capture app build, Android version, ABI, resolved runtime version, artifact identity, backend request, and error message with sensitive content removed. Do not repeatedly toggle GPU/NPU settings, delete the model, or silently retry until logs no longer represent the initial condition. If a documented CPU diagnostic path succeeds, that only indicates that the tested artifact and task can proceed through that configuration; it is not evidence about accelerator support or comparative speed. Define fallback policy explicitly. The app may ask the user to try a documented path, or choose a fallback if product behavior permits, but it must update visible state to match observed initialization. A failed accelerator request cannot remain labeled GPU-ready after CPU fallback. A fallback also needs its own task acceptance check; initialization success alone is not feature success. If all paths fail, return the classified initialization issue with a recovery step rather than repeatedly downloading an intact model. Avoid unsupported claims about vendor-specific directories, ABI coverage, or accelerator availability. Record exactly what documentation and package structure were checked, which values were requested, and what result was observed. The project has no complete device benchmark dataset, so this article describes diagnosis and reporting—not a support table, speed result, or guarantee that fallback is always possible.
The app requests GPU but engine initialization throws before inference
A release candidate selects an accelerator in settings. The native engine throws during initialization; no task prompt has been sent. A second path has not been tried, and the app currently still displays the requested backend as selected.
Decision
Freeze the original failure, inspect documented runtime dependencies and ABI packaging, classify initialization separately from load and inference, and expose fallback state honestly.
Expected outcome
Support can identify the stage that failed and the user sees either a tested fallback or a clear setup error rather than a false ready indicator.
Evidence to collect
The claim becomes reviewable only when the following evidence is attached to the same artifact and test run:
- Backend request and diagnostics
- Physical-device configuration
- Fallback and failure record
A runtime comparison is publishable only when artifact identity, build configuration, selected backend, task fixture, and failures are recorded.
Implementation workflow
- Freeze request and build identity. Record backend preference/request, app build, Android/API version, ABI, runtime artifact/version, native package versions, model identity, and full redacted initialization error. Do not alter settings until the first state is preserved.
- Verify artifact access independently. Check that the exact model file exists, is readable, and reaches the documented load boundary. An artifact path or format failure should remain separate from backend initialization and should not be “fixed” by changing an accelerator flag.
- Check documented native prerequisites. Inspect the runtime guide for required optional libraries, manifest declarations, or library directories for the requested path. Verify the installed APK/split contains compatible native files for the device ABI; do not infer inclusion from the source tree or universal debug package.
- Reproduce with one controlled configuration change. If documentation supports a diagnostic backend, preserve the original request and repeat with the same artifact and fixture while changing only that field. Record whether the engine initializes, whether the backend is observable, and whether a representative task completes.
- Apply visible, bounded fallback policy. Update UI state to the backend actually initialized when known; otherwise mark it unconfirmed. Limit retry attempts, keep the original error available for support, and provide a clear repair or user-choice action if no path initializes.
Keep each transition observable. A failure should identify the stage, artifact, runtime, and recovery action without logging private user content.
Acceptance criteria
- Backend request, engine initialization result, observed execution path, model load, and task outcome are separate fields/states.
- Native prerequisite and ABI checks use the exact installed artifact rather than source-tree presence or an unrelated universal APK.
- A fallback is visible and its representative task is checked; no UI state implies accelerator success after another path was selected.
- The report makes no broad device-support or speed claim without exact configuration records and raw measurements.
Decision table
| Dimension | Choice or evidence | How to interpret it |
|---|---|---|
| Backend request | User setting or EngineConfig preference | Intent only; not proof that native setup completed or that this path executed. |
| Initialization result | Engine successfully created/initialized or returned error | Confirms a setup stage; a later task can still fail and actual accelerator identity may remain unknown. |
| Observed task path | Runtime/backend evidence plus representative task | Strongest scoped evidence for this tested configuration; not a device-family guarantee. |
Failure patterns to prevent
- Assuming configuration means execution
- Reporting fallback as preferred backend
Also prevent silent fallback, unpinned artifacts, missing cancellation, and conclusions that combine unlike configurations. Store unsuccessful runs alongside successful ones.
Minimum reproducibility record
| Layer | Record |
|---|---|
| Device | Manufacturer, model, chipset, RAM class, operating-system build |
| Software | Application version and git commit |
| Model | Family, variant, revision, format, file length, hash, quantization |
| Runtime | Name, revision, requested backend, observed backend evidence |
| Workload | Fixture revision, input hash, prompt hash, output policy |
| Outcome | Completed, failed, cancelled, fallback, and privacy-safe diagnostics |
Release checklist
- ☐ The primary query is answered without an unsupported number.
- ☐ Every artifact and runtime is pinned.
- ☐ The representative task and failure policy are explicit.
- ☐ Lifecycle, cancellation, cleanup, and fallback are tested.
- ☐ User-content and network boundaries are documented.
- ☐ Result wording applies only to the recorded configuration.
- ☐ The page links to raw method or evidence when results are added.
Sources and related evidence
- Google LiteRT overview
- Cove benchmark method
- LiteRT-LM Kotlin API and backend initialization guide
- LiteRT-LM Android build and run instructions
Chinese deployment and troubleshooting content is organized in the .奇连 AI 端侧专题.
Frequently asked questions
Does selecting GPU in settings mean the model is using GPU?
No. A setting records a request. Initialization may fail, fall back, or leave actual execution identity unavailable. Store requested and observed states separately.
Should I delete and download the model after backend initialization fails?
Not before classifying the failure. If the model file opened and the error occurs during backend setup, redownloading may not address missing native libraries, ABI packaging, or configuration.
Can a CPU fallback be called a successful GPU initialization?
No. It is a different execution path. Update visible state and test the task under the fallback; do not report the original accelerator request as active execution.