atagen

monolith

public
Star0
Watch0

Commit b262ec719ab6

tarball

atagen <boss@atagen.co>2026-10-19 07:56 UTC

1 file changed+10-0
monolith: exit when the GPU is lost or hung

A lost device left every later frame failing with a warning over a frozen screen. After each dispatch the loop now stops the way msg quit does when the renderer reports device_lost, so the session can restart the compositor.
Modified file: crates/monolith/src/state.rs+10 additions
@@ -228,6 +228,7 @@ impl State {
228228 }
229229 self.confirm_lock();
230230 self.complete_captures();
231+ self.exit_if_gpu_lost();
231232 if std::mem::take(&mut self.dirty.snapshot) {
232233 crate::ipc::broadcast(self);
233234 self.publish_workspaces();
@@ -236,6 +237,15 @@ impl State {
236237 let _ = self.core.display.flush_clients();
237238 }
238239
240+ /// A lost or hung GPU cannot be recovered in place, so the loop stops the
241+ /// way `msg quit` does and the session restarts the compositor.
242+ fn exit_if_gpu_lost(&self) {
243+ if monolith_render_vk::device_lost() {
244+ tracing::error!("the GPU was lost or stopped responding, exiting");
245+ self.core.signal.stop();
246+ }
247+ }
248+
239249 pub fn resize_output(&mut self, size: Size<i32, Logical>) {
240250 if let Some(host) = self.backend.nested() {
241251 let o = host.output_id;