llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Misc. bug: Rpc-server does not use opencl backend on Android.

Open belog2867 opened this issue 1 year ago • 6 comments

Name and Version

ggml_opencl: using kernels optimized for Adreno (GGML_OPENCL_USE_ADRENO_KERNELS) version: 4727 (c2ea16f2) built with Android (11349228, +pgo, +bolt, +lto, -mlgo, based on r487747e) clang version 17.0.2 (https://android.googlesource.com/toolchain/llvm-project d9f89f4d16663d5012e5c09495f3b30ece3d2362) for x86_64-unknown-linux-gnu

Operating systems

Other? (Please let us know in description)

Which llama.cpp modules do you know to be affected?

Other (Please specify in the next section)

Command line

./rpc-server --port 8880

Starting RPC server on 127.0.0.1:8880, backend memory: 15160 MB

Problem description & steps to reproduce

If you use vulkan, it can be used normally in Android, but opencl will prompt that you are using the cpu backend.

Llama-cli can use gpu when using opencl.

First Bad Commit

No response

Relevant log output

create_backend: using CPU backend

belog2867 avatar Feb 19 '25 10:02 belog2867

Please ask me if you need any other information.

belog2867 avatar Feb 19 '25 11:02 belog2867

OpenCL is not included in rpc_server.cpp. It needs to be updated.

foldl avatar Feb 20 '25 11:02 foldl

I tried to add everything related to opencl according to rpcserver code, but eventually a compilation error occurred.

belog2867 avatar Feb 20 '25 11:02 belog2867

I modified the code and now it compiles successfully, but an error is thrown when the model is loaded. tensor->extra populated by the backend, this is currently unsupported.

version: 4746 (4806498b) built with clang version 19.1.7 for aarch64-unknown-linux-android24

rpc-server.cpp.txt

belog2867 avatar Feb 20 '25 13:02 belog2867

When I use the --rpc parameter of LLMA-CLI, it will not use the gpu (terminal using LLMA-CLI) of opencl, but vulkan will use both LLMA-CLI and rpc-server. This seems to be a problem with the ggml-opencl header file. Maybe opencl is not supported by the upstream or not updated in time.

belog2867 avatar Feb 21 '25 11:02 belog2867

It seems that this is a problem with rpc, and its code is out of date.

belog2867 avatar Feb 24 '25 22:02 belog2867