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

gpui/zed: Allow setting a GPU preference #14738

Closed
wants to merge 3 commits into from
Closed

Conversation

mrnugget
Copy link
Member

This adds a new setting:

{
  "gpu": "discrete" // or: "integrated
}

On macOS, this setting will have an effect when selecting the device with which to render windows.

On Linux, it's without an effect.

See: #5124 (comment)

Release Notes:

  • Added a setting that allows users on macOS with Intel machines to define which GPU Zed should use: {"gpu": "discrete"}. The default is "integrated", which is the lower-power GPU.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jul 18, 2024
@mrnugget mrnugget mentioned this pull request Jul 18, 2024
1 task
@emilazy
Copy link
Contributor

emilazy commented Jul 18, 2024

I wonder if a better approach might be to prefer external GPUs, but keep the preference of low‐power GPUs when deciding between built‐in GPUs? That would mean that people using eGPU setups would get the high performance they’ve already opted into by plugging in an external GPU, but Intel MacBook Pros would still get a good experience out of the box, without having to add an additional settings. It would be as simple as changing the sort key to |device| (device.is_removable(), device.is_low_power()).

On the other hand, if there are any Intel MacBook Pro users who really wish that the built‐in discrete GPU was being used, a setting would make more sense.

This adds a new setting:

```jsonc
{
  "gpu": "discrete" // or: "integrated
}
```

On macOS, this setting will have an effect when selecting the device
with which to render windows.

On Linux, it's without an effect.
@mrnugget
Copy link
Member Author

I wonder if a better approach might be to prefer external GPUs, but keep the preference of low‐power GPUs when deciding between built‐in GPUs?

That's a good idea! And a lot simpler. Do you want to open a PR or should I?

@emilazy
Copy link
Contributor

emilazy commented Jul 18, 2024

I don’t mind if you open a PR :) One thing I’m unsure about is how it will behave when an external GPU is unplugged, but presumably any issues there would have already existed in Zed anyway, so it wouldn’t be a regression on the state before my first PR.

@mrnugget mrnugget closed this Jul 18, 2024
mrnugget added a commit that referenced this pull request Jul 18, 2024
For context, see:

- #5124 (comment)
- #14738 (comment)

Short version: on Intel MacBooks it's better to prefer integrated
(`is_low_poer()`) GPUs, except when a user has an eGPU plugged-in, in
which case they very likely want to prefer that.

Before this change, we'd always prefer the integrated GPU, even if an
eGPU was available.

Now, with this change, if a user has

- eGPU
- integrated GPU
- discrete GPU

We'd first prefer eGPU, then integrated, then discrete.
mrnugget added a commit that referenced this pull request Jul 18, 2024
For context, see:

-
#5124 (comment)
-
#14738 (comment)

Short version: on Intel MacBooks it's better to prefer integrated
(`is_low_poer()`) GPUs, except when a user has an eGPU plugged-in, in
which case they very likely want to prefer that.

Before this change, we'd always prefer the integrated GPU, even if an
eGPU was available.

Now, with this change, if a user has

- eGPU
- integrated GPU
- discrete GPU

We'd first prefer eGPU, then integrated, then discrete.



Release Notes:

- Changed preference for GPUs on macOS so that eGPUs are now preferred
over integrated ones (and both of which are preferred over discrete
GPUs) on Intel Macs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants