Fix Wayland crash on Nvidia by disabling explicit sync (#474)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Carlos Simon
2026-08-13 18:41:50 -07:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent 7e2db7799b
commit c3fc3fb68a
+12
View File
@@ -1,5 +1,17 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
// On Nvidia + Wayland, WebKit2GTK's DMA-BUF renderer triggers a protocol error (71) due to
// an explicit sync bug (https://bugs.webkit.org/show_bug.cgi?id=280210). Disabling explicit
// sync via the Nvidia driver avoids the crash without disabling hardware acceleration.
#[cfg(target_os = "linux")]
if std::env::var("__NV_DISABLE_EXPLICIT_SYNC").is_err()
&& std::env::var("WAYLAND_DISPLAY").is_ok()
&& std::path::Path::new("/sys/module/nvidia").exists()
{
// SAFETY: called before any threads are spawned.
unsafe { std::env::set_var("__NV_DISABLE_EXPLICIT_SYNC", "1") };
}
tauri_app_client_lib::run();
}