Closed ghost closed 1 year ago
@JackJollimore sgemm.c
is the source, you can't run it directly, you have to compile it. Like this:
$ cc sgemm.c -lOpenCL -lclblast
$ ./a.out
Completed SGEMM with status 0
Thank you. I'll post elsewhere.
@JackJollimore
sgemm.c
is the source, you can't run it directly, you have to compile it. Like this:$ cc sgemm.c -lOpenCL -lclblast $ ./a.out Completed SGEMM with status 0
similar question for me: clGetPlatformIDs
return -1001 in my Android APP rather than Termux.
Any suggestions? The details are list #511
Hi,
My device has native OpenCL support, and I want to use CLBlast. I don't own a p.c. so installing NDK is not an option.
Ultimately, I want to use llama.cpp with CLBlast enabled, but CLBlast is giving me a hard time.
For more context:
The closest I've gotten to running llama.cpp with CLBlast enabled is by following this method:
pkg update pkg upgrade apt install clang cmake cmake-curses-gui opencl-headers ocl-icd
Install CLBlast: cd git clone https://github.com/CNugteren/CLBlast.git cd CLBlast cmake -B build \ -DBUILD_SHARED_LIBS=OFF \ -DTUNERS=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr cd build make -j8 make install
Build llama.cpp: cd git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp/ cmake -B build -DLLAMA_CLBLAST=ON cd build make -j8
But then there's the platform error from llama.cpp:
main: build = 0 (unknown) main: seed = 1685721363 ggml_opencl: clGetPlatformIDs(NPLAT, platform_ids, &n_platforms) error -1001 at /data/data/com.termux/files/home/zllama/ggml-opencl.cpp:344
I don't know how to make CLBlast function, then I'm hoping to make it so that llama.cpp recognizes the platform.
clinfo;
I rebuilt with the -DSAMPLES=ON enabled, just to see if I can get any thing to run with CLBlast.
So, I chmod +x sgemm.c, then ./sgemm.c to which I receive:
Any direction on this matter is appreciated!