From 12e5a4b744dd1a6398e33c4139e07d120b4a8509 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 4 Jun 2026 10:02:09 +0300 Subject: [PATCH] fix(windows): default to DX12/Vulkan so AMD GL driver can't crash startup (#55) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some Windows hybrid-GPU laptops the AMD OpenGL driver (atio6axx.dll) access-violates the instant wgpu enumerates its GL backend at startup, killing the app before any window appears — even though DX12 works fine. The crash is inside AMD's proprietary GL ICD, so it can't be fixed app-side; instead default WGPU_BACKEND to dx12,vulkan on Windows so the GL ICD is never touched. An explicit user-set WGPU_BACKEND still wins, so GL remains available via override. Co-Authored-By: Claude Opus 4.8 --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index 423b97df7..d420e6cf5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,5 +17,14 @@ mod ui; mod update_check; fn main() -> iced::Result { + // On some Windows hybrid-GPU laptops the AMD OpenGL driver (atio6axx.dll) + // access-violates the moment wgpu enumerates its GL backend at startup, + // killing the app before any window appears — even though DX12 would work + // fine (#55). Restrict wgpu to DX12/Vulkan so the GL ICD is never touched. + // An explicit user-set WGPU_BACKEND still wins. + #[cfg(target_os = "windows")] + if std::env::var_os("WGPU_BACKEND").is_none() { + std::env::set_var("WGPU_BACKEND", "dx12,vulkan"); + } app::run() }