From 90ad0010ece3bd667af79ac3de905a0c90b837bd Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 27 Jan 2022 12:32:13 +0100 Subject: [PATCH] app: disable Vulkan on X11 According to https://gioui.org/issue/347 and https://github.com/godotengine/godot/issues/43714 choosing the integrated Intel GPU on a multi-GPU system with NVIDIA doesn't work well in X11. According to Godot, forcing the use of the discrete (NVIDIA) GPU works around the problem. This change disables Vulkan on X11 instead, which is a more conservative and targeted fix. Disabling Vulkan on X11 will reduce testing of Vulkan, but - Pierre is making Wayland the default driver on Linux, where Vulkan is enabled. - The OpenGL driver will be exercized more. Fixes: https://todo.sr.ht/~eliasnaur/gio/347 Signed-off-by: Elias Naur --- app/os_x11.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/os_x11.go b/app/os_x11.go index 97525bec..c95e5d95 100644 --- a/app/os_x11.go +++ b/app/os_x11.go @@ -118,9 +118,13 @@ var ( newX11VulkanContext func(w *x11Window) (context, error) ) +// X11 and Vulkan doesn't work reliably on NVIDIA systems. +// See https://gioui.org/issue/347. +const vulkanBuggy = true + func (w *x11Window) NewContext() (context, error) { var firstErr error - if f := newX11VulkanContext; f != nil { + if f := newX11VulkanContext; f != nil && !vulkanBuggy { c, err := f(w) if err == nil { return c, nil