Skip to content

Commit

Permalink
Don't panic on GPU hang (zed-industries#14974)
Browse files Browse the repository at this point in the history
Fixes: zed-industries#12766
Fixes: zed-industries#14022

Release Notes:

- linux: Fix panic when GPU is temporarily unavailable.
  • Loading branch information
ConradIrwin authored Jul 22, 2024
1 parent f597c29 commit a955968
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/gpui/src/platform/blade/blade_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use blade_graphics as gpu;
use blade_util::{BufferBelt, BufferBeltDescriptor};
use std::{mem, sync::Arc};

const MAX_FRAME_TIME_MS: u32 = 1000;
const MAX_FRAME_TIME_MS: u32 = 10000;

#[cfg(target_os = "macos")]
pub type Context = ();
Expand Down Expand Up @@ -412,7 +412,8 @@ impl BladeRenderer {
fn wait_for_gpu(&mut self) {
if let Some(last_sp) = self.last_sync_point.take() {
if !self.gpu.wait_for(&last_sp, MAX_FRAME_TIME_MS) {
panic!("GPU hung");
log::error!("GPU hung");
while !self.gpu.wait_for(&last_sp, MAX_FRAME_TIME_MS) {}
}
}
}
Expand Down

0 comments on commit a955968

Please sign in to comment.