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

Added support to select GPU using metal on Apple Intel or Apple Silicon using --main-gpu index #8962

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ifeanyipossibilities
Copy link

@ifeanyipossibilities ifeanyipossibilities commented Aug 10, 2024

@github-actions github-actions bot added examples ggml changes relating to the ggml tensor library for machine learning Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels Aug 10, 2024
@ifeanyipossibilities
Copy link
Author

Added support to select GPU using metal on Apple Intel or Apple Silicon using --main-gpu index

Copy link
Owner

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • deviceIndex -> device
  • use snake_case
  • use 4 spaces indentation

@mofosyne mofosyne added the Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix label Aug 10, 2024
@@ -3295,8 +3334,8 @@ void ggml_backend_metal_capture_next_compute(ggml_backend_t backend) {
GGML_CALL ggml_backend_t ggml_backend_reg_metal_init(const char * params, void * user_data); // silence warning

GGML_CALL ggml_backend_t ggml_backend_reg_metal_init(const char * params, void * user_data) {
return ggml_backend_metal_init();
return ggml_backend_metal_init((int) (intptr_t) user_data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the user_data set?

@slaren
Copy link
Collaborator

slaren commented Aug 10, 2024

This is not the correct way to implement multiple device support. It would need a different buffer type for each device, and it would need to register one backend for each device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apple Metal https://en.wikipedia.org/wiki/Metal_(API) examples ggml changes relating to the ggml tensor library for machine learning Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants