Skip to content

OpenCL can select discrete GPU by default? #1546

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

Closed
DickyQi opened this issue May 21, 2023 · 5 comments
Closed

OpenCL can select discrete GPU by default? #1546

DickyQi opened this issue May 21, 2023 · 5 comments
Assignees

Comments

@DickyQi
Copy link

DickyQi commented May 21, 2023

I have Old MacBook Pro with one intel GPU and one AMD discrete GPU. I am using OpenCL ggml, and ggml default choose Intel GPU. I hope ggml can using discrete GPU by default, or we can set GPU device though API?

@SlyEcho
Copy link
Collaborator

SlyEcho commented May 22, 2023

It is possible to select the OpenCL device with an environment variable:

export GGML_OPENCL_DEVICE=1
./main ....

You can use numbers 0, 1, 2 ... or you can use string matching, like GGML_OPENCL_DEVICE=AMD but what strings to use depends on what info the OpenCL platforms give. You can use the clinfo command to see what is there.

@SlyEcho
Copy link
Collaborator

SlyEcho commented May 22, 2023

Actually, I need to write the documentation for this part. It doesn't seem to be anywhere.

@jp-aa
Copy link

jp-aa commented Jun 2, 2023

Actually, I need to write the documentation for this part. It doesn't seem to be anywhere.

Is there a way to do this for cuda devices? I have no idea how to tell it to use my other gpu

@SlyEcho
Copy link
Collaborator

SlyEcho commented Jun 3, 2023

Is there a way to do this for cuda devices? I have no idea how to tell it to use my other gpu

You just list the devices that are visible to the application:

CUDA_VISIBLE_DEVICES=1 ./main ...

@SlyEcho
Copy link
Collaborator

SlyEcho commented Jun 3, 2023

README now should have info about GPU selection for CUDA and OpenCL.

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

3 participants