Skip to content

Android LiteRT-LM GPU generation fails without libOpenCL.so declaration (WebGPU sampler missing) #1998

Closed

Description

@leehack

On Android, a LiteRT-LM model loaded with ComputeDevice.gpu (or auto that picks GPU) in an app without the libOpenCL.so uses-native-library declaration, or on a device with no loadable OpenCL, loads fine and then every generation fails:

LlamaException: C API 1.0 stream failed: LiteRT-LM reported code -1: UNKNOWN: UNKNOWN: Can not find OpenCL library on this device.

llamadart retries on CPU only at engine creation, so the app gets a GPU engine that can't generate. Regression from 0.18.x (prebuilt samplers); runtime cause and fix belong to leehack/litert-lm-native#120.

Evidence: Test Lab W1 (Galaxy S24, Gemma 4 E2B), llamadart-evidence/issue-174/0.19.10/results/W1/. With the declaration (the documented setup) the same runs pass.

Plan: fix in litert-lm-native, repin. Consider a llamadart-side mitigation (typed error / CPU retry on this failure) if the runtime fix slips.

Activity

  1. leehack commented on Nov 13, 2026

    @leehack
    OwnerAuthor

    Triage: bug, priority:P2, regression (0.18.x → 0.19.x). Area: LiteRT-LM / Android GPU. Owner fix: leehack/litert-lm-native#120. In 0.19.10 scope per the regression rule (plan #1995).

  2. added
    bug
    priority:P2
    on Nov 13, 2026
  3. leehack commented on Nov 14, 2026

    @leehack
    OwnerAuthor

    2026-11-14 owner/main checkpoint: owner#121 fixed#120 and v0.19.1-5 is published (bb4e7709/upstream7a03724c). It links the missing Android WebGPU top-k sampler and validates seven exports; no new public C ABI is required.

    Consumer#2003,6b18ff51, adopts it on main/local with S24 Gemma4 WebGPU no-OpenCL first-token/schema receipts and separate OpenCL20/20 qualifier evidence. Public core0.19.9 still ships-4 and remains affected on the reported route; core/LiteRT companion0.19.10 publication is still required. Closure is source adoption, not an already-public fix.

    Until then the documented OpenCL setup or CPU workaround remains relevant; do not infer CPU retry after a successful GPU load. Androidx64 and Pixel/Mali WebGPU are not qualified here, and owner#51's Qwen binding limit remains P1/open. Strict-schema GPU admission is separate#174/#2006, not implied by artifact publication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions