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

Manual CLBlast device and platform number #1368

Closed
daniandtheweb opened this issue May 8, 2023 · 4 comments
Closed

Manual CLBlast device and platform number #1368

daniandtheweb opened this issue May 8, 2023 · 4 comments

Comments

@daniandtheweb
Copy link
Contributor

Using CLBlast on some devices (like my Radeon 5700XT) the program defaults to device id 0 and platform id 0, that causes the following error:

Initializing CLBlast (First Run)...
Attempting to use: Platform=0, Device=0 (If invalid, program will crash)
Using Platform: Clover Device: AMD Radeon RX 5700 XT (navi10, LLVM 15.0.7, DRM 3.52, 6.3.1-zen1-1-zen)
fatal error: cannot open file '/usr/share/clc/gfx1010-amdgcn-mesa-mesa3d.bc': No such file or directory

When I manually edit the platform id inside the source to 1 however makes the program behave as expected using the GPU for the prompt evaluation:

Initializing CLBlast (First Run)...
Attempting to use: Platform=1, Device=0 (If invalid, program will crash)
Using Platform: AMD Accelerated Parallel Processing Device: gfx1010:xnack-

My suggestion is to add a launch option to manually choose the desired platform and device id similarly to the --useclblast option of koboldcpp.

@sw
Copy link
Contributor

sw commented May 9, 2023

It should be possible to set the CLBLAST_PLATFORM environment variable to achieve this, but I haven't tested it.

@SlyEcho
Copy link
Collaborator

SlyEcho commented May 9, 2023

There are two environment variables you can set: GGML_CLBLAST_PLATFORM and GGML_CLBLAST_DEVICE (just numbers)

(Personally I think there should be a command line argument, and it's not really CLBlast that it's controlling, but OpenCL in general. CUDA doesn't have any way to control the GPU selection right now, @slaren?)

@slaren
Copy link
Member

slaren commented May 9, 2023

CUDA doesn't have any way to control the GPU selection right now, @slaren?

The environment variable CUDA_VISIBLE_DEVICES should work.

@daniandtheweb
Copy link
Contributor Author

Thanks @SlyEcho for the info. I also think that a command line argument would be the best but I guess that for now I can just close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants