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

[Mobile] How to use GPU acceleration on Android #23194

Open
lizhiwen19900709 opened this issue Dec 25, 2024 · 1 comment
Open

[Mobile] How to use GPU acceleration on Android #23194

lizhiwen19900709 opened this issue Dec 25, 2024 · 1 comment
Labels
api:Java issues related to the Java API platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@lizhiwen19900709
Copy link

Describe the issue

How to use GPU acceleration on Android?The detector model is now too slow to predict!

To reproduce

this.context = context;
env = OrtEnvironment.getEnvironment();

    // 预分配内存
    inputArray = new float[INPUT_SIZE * INPUT_SIZE * 3];
    pixels = new int[INPUT_SIZE * INPUT_SIZE];
    inputBuffer = FloatBuffer.wrap(inputArray);

session = env.createSession(modelPath, sessionOptions);
inputTensor = OnnxTensor.createTensor(env, inputBuffer, new long[]{1, 3, INPUT_SIZE, INPUT_SIZE});
result = session.run(Collections.singletonMap(session.getInputNames().iterator().next(), inputTensor));

Urgency

No response

Platform

Android

OS Version

14

ONNX Runtime Installation

Built from Source

Compiler Version (if 'Built from Source')

No response

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

1.20.0

ONNX Runtime API

Java/Kotlin

Architecture

X64

Execution Provider

Other / Unknown

Execution Provider Library Version

No response

@lizhiwen19900709 lizhiwen19900709 added the platform:mobile issues related to ONNX Runtime mobile; typically submitted using template label Dec 25, 2024
@github-actions github-actions bot added the api:Java issues related to the Java API label Dec 25, 2024
@WangHHY19931001
Copy link

nnapi ep will help you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:Java issues related to the Java API platform:mobile issues related to ONNX Runtime mobile; typically submitted using template
Projects
None yet
Development

No branches or pull requests

2 participants