Closed PedroVNasc closed 1 year ago
Did you try --useclblast 0 1
as that seems to be the index of your device?
Yes, I tried 0 1, 1 0 and 1 1. All of them result in this output.
Then I suspect you may have linked with an incorrect or incomplete CLBlast library. Which ones did you install?
For Arch Linux: Install cblas openblas and clblast. For Debian: Install libclblast-dev and libopenblas-dev.
I have installed the Debian ones previously, but they didn't work either. Then I tried to manually compile CLBlast following some instructions in an issue thread of llama cpp.
The latter made llama work but not kobold. Still, I will remove the current CLBlast install and try again with the Debian one just in case I did something wrong.
I just tried that and also tried the new version you just released yet it didn't work, same error as before.
It got even stranger.
I compiled and runned only the bit where it doens't find any opencl devices to try and comprehend what is happening. And it returns the correct devices:
Platform:0 Device:0 - Clover with ICELAND (iceland, LLVM 15.0.7, DRM 3.52, 6.4.6-76060406-generic)
Platform:0 Device:1 - Clover with AMD Radeon Vega 8 Graphics (raven, LLVM 15.0.7, DRM 3.52, 6.4.6-76060406-generic)
So it isn't the problem. Then, out of curiosity I decided to use kobold with sudo and it started to work.
For some reason, kobold can't find any opencl devices unless I run it with sudo.
After using sudo worked, I suspected it had to do with the environment kobold is running. I have anaconda installed so I tried deactivating it to see if kobold would work and it indeed worked.
It seems that python environment may mess with the way opencl works, I'm not sure if you want to "fix" it or if it can or should be fixed but maybe a warning should be added about that.
So, I tried kobold cpp and although CLBlast is working (processing is indeed faster) if at any point it starts to use BLAS to process, it breaks and outputs gibberish or throws a segmentation fault.
I still didn't try llama to see if the same happens, but I expect it to behave the same way.
I don't use linux myself so unfortunately it will be hard for me to troubleshoot. Have you tried with a different model?
Yes I tried llama, airoboros and pygmalion. I will try to investigate a bit further but just by getting CLBlast working, the processing time got way faster.
I haven't learned much yet and won't be able to study this issue anytime soon and as I'm currently able to use CLBlast and it is much faster than BLAS anyway, I'll close this issue.
If I find anything later, I'll open another issue or a PR.
Expected Behavior
I was trying to use CLBlast in koboldcpp after verifying it works with llamacpp.
Current Behavior
It throws
ggml_opencl: clGetPlatformIDs(NPLAT, platform_ids, &n_platforms) error -1001 at ggml-opencl.cpp:968
no matter which plataform or device I choose.In llamacpp I was able to select my gpu using
GGML_OPENCL_PLATFORM=Clover GGML_OPENCL_DEVICE=1 ./main ...
Environment and Context
I'm using a Ubuntu like system (Pop!OS) on a laptop with an AMD APU an a AMD dGPU which isn't too great but it's still better than the CPU.
Failure Information (for bugs)
I messed a bit with the code to find out what was happening and it seems koboldcpp can't find any OpenCL devices.
clinfo -l
output: Platform #0: Clover +-- Device #0: ICELAND (iceland, LLVM 15.0.7, DRM 3.52, 6.4.6-76060406-generic) `-- Device #1: AMD Radeon Vega 8 Graphics (raven, LLVM 15.0.7, DRM 3.52, 6.4.6-76060406-generic)Steps to Reproduce
Failure Logs
If it didn't work with llamacpp, I wouldn't even have bothered to open an issue, as it could've been a problem with my laptop, but seeing that it works well with llama, I just don't understand why it doens't with koboldcpp.