Skip to content

Commit

Permalink
app: disable Vulkan on X11
Browse files Browse the repository at this point in the history
According to

https://gioui.org/issue/347 and
godotengine/godot#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 <[email protected]>
  • Loading branch information
eliasnaur committed Jan 27, 2022
1 parent 1bad440 commit 90ad001
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/os_x11.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90ad001

Please sign in to comment.