-
Notifications
You must be signed in to change notification settings - Fork 302
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
Make in Termux (Android) #247
Comments
I wrote a guide of how to build LlamaCpp at Termux. KoboldCpp is very similar. It's currently at PR at LlamaCpp's GitHub repo. You can check it there. @LostRuins , you find it would be good bring a similar version to Koboldcpp's Readme also? I had a lot of fun playing with KoboldCpp and SillyTavern at an airplane flight. |
Just checked and it was merged today: ggerganov#1828 (review) |
I'll try it, thanks. I'll reply and let you know if kobold.cpp builds as expected. |
@gustrd i'll add a hotlink to that document |
After ensuring CLBlast is installed, I use <cp ./include/clblast.h ~/koboldcpp> I navigate to koboldcpp then use.. It compiles as expected, but it doesn't run with CLBlast.
Using gustrds method, then I get no a platform error i.e.:
The method belpw allows a platform, but koboldcpp crashes.
Thanks. |
clinfo is working? What is it's output? |
Also make sure you are using the latest Termux, unrooted, from F-Droid. It was only tested with it. The one from Play Store has several issues. |
I'm aware, thanks. clinfo does not produce a platform
Brother, please read my message: LD_LIBRARY_PATH=/vendor/lib64:$PREFIX/lib is required to enable OpenCL through CLBlast on my device. The method: GGML_OPENCL_PLATFORM 0 GGML_OPENCL_DEVICE 0 export LD_LIBRARY_PATH=/system/vendor/lib64:$LD_LIBRARY_PATH is an unresponsive instruction - it submits without approval or error. Trying commands like,
The method LD_LIBRARY_PATH=/vendor/lib64:$PREFIX/lib clinfo alows OpenCL to function:
I don't need help running llama.cpp. I came to this repository for assistance with koboldcpp. |
That's strange, because at my device KoboldCpp runs correctly with the same instructions:
Good luck. |
It's something else to see the way that PR slipped by without much testing. Then koboldcpp adopted it without question. Anyway, there's no response about building with CMake, so there's nothing else to troubleshoot. |
Yeees exactly 💯 |
Can confirm this issue still exists on newest koboldcpp. Device: POCO F5 |
To anyone still having trouble building with Termux, try following the step-by-step build instructions on the Readme. That should at minimum get it up and running. These instructions do not cover GPU acceleration - for that you are on your own. |
Some new references that sadly CLBlast in Android is buggy: ggerganov#7016 |
Hi,
I'm trying to build kobold concedo with make LLAMA_OPENBLAS=1 LLAMA_CLBLAST=1, but it fails.
Details
u0_a1282@localhost ~> cd koboldcpp/ u0_a1282@localhost ~/koboldcpp (concedo)> make LLAMA_OPENBLAS=1 LLAMA_CLBLAST=1 I llama.cpp build info: I UNAME_S: Linux I UNAME_P: unknown I UNAME_M: aarch64 I CFLAGS: -I. -I./include -I./include/CL -I./otherarch -I./otherarch/tools -Ofast -DNDEBUG -std=c11 -fPIC -DGGML_USE_K_QUANTS -pthread -s -pthread I CXXFLAGS: -I. -I./examples -I./include -I./include/CL -I./otherarch -I./otherarch/tools -O3 -DNDEBUG -std=c++11 -fPIC -pthread -s -Wno-multichar -Wno-write-strings -pthread I LDFLAGS: I CC: clang version 16.0.6 I CXX: clang version 16.0.6
aarch64-linux-android-clang++ -I. -I./examples -I./include -I./include/CL -I./otherarch -I./otherarch/tools -O3 -DNDEBUG -std=c++11 -fPIC -pthread -s -Wno-multichar -Wno-write-strings -pthread ggml.o ggml_v2.o ggml_v1.o expose.o common.o gpttype_adapter.o k_quants.o -shared -o koboldcpp.so
aarch64-linux-android-clang++ -I. -I./examples -I./include -I./include/CL -I./otherarch -I./otherarch/tools -O3 -DNDEBUG -std=c++11 -fPIC -pthread -s -Wno-multichar -Wno-write-strings -pthread ggml_failsafe.o ggml_v2_failsafe.o ggml_v1_failsafe.o expose.o common.o gpttype_adapter_failsafe.o k_quants_failsafe.o -shared -o koboldcpp_failsafe.so
aarch64-linux-android-clang++ -I. -I./examples -I./include -I./include/CL -I./otherarch -I./otherarch/tools -O3 -DNDEBUG -std=c++11 -fPIC -pthread -s -Wno-multichar -Wno-write-strings -pthread ggml_openblas.o ggml_v2_openblas.o ggml_v1.o expose.o common.o gpttype_adapter.o k_quants.o -lopenblas -shared -o koboldcpp_openblas.so
aarch64-linux-android-clang++ -I. -I./examples -I./include -I./include/CL -I./otherarch -I./otherarch/tools -O3 -DNDEBUG -std=c++11 -fPIC -pthread -s -Wno-multichar -Wno-write-strings -pthread ggml_openblas_noavx2.o ggml_v2_openblas_noavx2.o ggml_v1_failsafe.o expose.o common.o gpttype_adapter.o k_quants_noavx2.o -lopenblas -shared -o koboldcpp_openblas_noavx2.so
aarch64-linux-android-clang++ -I. -I./examples -I./include -I./include/CL -I./otherarch -I./otherarch/tools -O3 -DNDEBUG -std=c++11 -fPIC -pthread -s -Wno-multichar -Wno-write-strings -pthread ggml_clblast.o ggml_v2_clblast.o ggml_v1.o expose.o common.o gpttype_adapter_clblast.o ggml-opencl.o ggml_v2-opencl.o ggml_v2-opencl-legacy.o k_quants.o -lclblast -lOpenCL -lopenblas -shared -o koboldcpp_clblast.so
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_command_queue**, std::__ndk1::default_delete<_cl_command_queue*>, std::__ndk1::allocator<_cl_command_queue*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::__shared_ptr_pointer<_cl_mem**, std::__ndk1::default_delete<_cl_mem*>, std::__ndk1::allocator<_cl_mem*>>'; recompile with -fPIC
ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:326: koboldcpp_clblast] Error 1
u0_a1282@localhost ~/koboldcpp (concedo) [2]>
To clarify, using make to build with OpenBlas works as expected, but building CLBlast fails.
More context: when I build something like llama.cpp, then I must use CMake otherwise it fails locate the CLBlast library, but I remember seeing an error saying don't build like that. Does that still apply to this situation?
Here's clinfo;
Thank you!
The text was updated successfully, but these errors were encountered: