-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Switch to a single GPU context in Blade #20853
base: main
Are you sure you want to change the base?
Conversation
d3ff403
to
677c1a6
Compare
Does merging this PR mean dropping support for those Intel and Nvidia machines, at least temporarily? |
Yes, I think so. One of the challenges here is to even gather information to understand who is affected. We know it's about Linux systems with both Intel and Nvidia. I think, both X11 and Wayland are affected, possibly in different ways. The current workaround in Blade is checking for the prime-select: // See https://github.com/canonical/nvidia-prime/blob/587c5012be9dddcc17ab4d958f10a24fa3342b4d/prime-select#L56
fn is_nvidia_prime_forced() -> bool {
match fs::read_to_string("/etc/prime-discrete") {
Ok(contents) => contents == "on\n",
Err(_) => false,
}
} However, I recall issue threads in Zed where users were still having issues, and thus we tried other things. But I didn't get sufficient feedback about what actually worked. That's the most recent I see - #17022 (comment) If I had, say, |
Here is what I gathered - kvark/blade#205
|
* Fixes registration of event handler for xinput-2 device changes, revealed by this improvement. * Pushes `.unwrap()` panic-ing outwards to callers. * Includes a description of what the X11 call was doing when a failure was encountered. * Fixes a variety of places where the X11 reply wasn't being inspected for failures. * Destroys windows on failure during setup. New structure makes it possible for the caller of `open_window` to carry on despite failures, and so partially initialized window should be removed (though all calls I looked at also panic currently). Considered pushing this through `linux/x11/client.rs` too but figured it'd be nice to minimize merge conflicts with #20853.
…21079) * Fixes registration of event handler for xinput-2 device changes, revealed by this improvement. * Pushes `.unwrap()` panic-ing outwards to callers. * Includes a description of what the X11 call was doing when a failure was encountered. * Fixes a variety of places where the X11 reply wasn't being inspected for failures. * Destroys windows on failure during setup. New structure makes it possible for the caller of `open_window` to carry on despite failures, and so partially initialized window should be removed (though all calls I looked at also panic currently). Considered pushing this through `linux/x11/client.rs` too but figured it'd be nice to minimize merge conflicts with #20853. Release Notes: - N/A
0a192a8
to
0822e3d
Compare
I think we should proceed with this and have a bold note around the Linux/Windows releases recommending to update the driver in case Zed fails to start. That is the best solution for both X11/Wayland presentation issues and "KHR_dynamic_rendering". |
Also thinking that it would help for the users to have a workaround in case they are affected, and the user isn't able to fix it at the platform level (e.g. by updating the drivers). Perhaps, we could have a Zed configuration option to force a specific Device ID? Feedback on kvark/blade#207 would be welcome! |
If this gets merged and will negatively impact many users, we should consider doing it on a Wednesday afternoon after releases. That way we'll get 7days of feedback in dev and the opportunity to gather data / improve error messaging before it lands in Preview. |
3da76e1
to
c5e48f9
Compare
Apologies for the long wait on a review. Summary of the problem:
If that's the state of the world, I think I'm ok with merging this, with a big warning label that you might need to update your drivers. I'd like to get a second opinion from @ConradIrwin first though. |
FWIW, my current workflow for using Zed on Linux (Wayland) is to check out this branch and run it. |
Closes #17005
Release Notes:
High Level
Blade got a proper support for Surface objects in kvark/blade#203.
That was mainly motivated by Zed needing to draw multiple windows. With the Surface API, Zed is now able to have the GPU context tied to the "Platform" instead of "Window". Practically speaking, this means:
Concerns
Metal-rs dependency is switched to https://github.com/kvark/metal-rs/tree/blade, since upstream isn't responsive in merging changes that are required for Blade. Hopefully, temporary.we can also hack around it by just transmuting the texture references, since we know those are unchanged in the branch. That would allow Blade to use it's own version of Metal, temporarily, if switching metal-rs in the workspace is a concern.