Skip to content

OpenGL errors on xorg/swrast with mesa 24.2.1 #339703

@ghpzin

Description

@ghpzin

Issue is mostly for information purposes.
As far as I can tell it is upstream mesa bug and fixed with currently merged MRs in master:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30979
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31013
So waiting for next mesa patch version with these seems to be the best course.


Describe the bug

After mesa update #332413 (24.1.6 -> 24.2.1) a lot of tests fail with errors similar to "GLX extension not found".

Example:
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.terminal-emulators.kitty.x86_64-linux
https://hydra.nixos.org/build/271100383

machine # [0.616] [glfw error 65542]: GLX: GLX extension not found
machine # [0.617] Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.1 drivers.

List of tests that fail (found so far):
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.terminal-emulators.kitty.x86_64-linux
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.terminal-emulators.wayst.x86_64-linux
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.terminal-emulators.darktile.x86_64-linux
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.quake3.x86_64-linux
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.openarena.x86_64-linux
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.warzone2100.x86_64-linux
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.aaaaxy.x86_64-linux
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.qtile.x86_64-linux --- depends on kitty terminal opening

Windows of these apps do not open as a result.
Tested on other variations of VMs and seemingly it does not occur with wayland, occurs on xorg not in VM too.

One other example is alacritty, which prints new error, but still opens window and test passes:
https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.terminal-emulators.alacritty.x86_64-linux
https://hydra.nixos.org/build/271139043

machine # libEGL warning: DRI3: Screen seems not DRI3 capable
machine # libEGL warning: DRI2: failed to authenticate
machine # libEGL warning: DRI3: Screen seems not DRI3 capable
machine # error: XDG_RUNTIME_DIR is invalid or not set in the environment.
machine # MESA: error: ZINK: failed to choose pdev
machine # libEGL warning: egl: failed to create dri2 screen

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix-build -A nixosTests.terminal-emulators.kitty
  2. test fails, kitty window does not open with error:
machine # [0.382] [glfw error 65542]: GLX: GLX extension not found
machine # [0.383] Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.1 drivers.

Additional context

The closest upstream issue I could find:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/11809
Error in logs there:

X server has no GLX extension - required to use OpenGL!

Doing either of these 2 fixes the issue and makes tests pass again:

  1. Revert 77feb16 (commit with mesa update mesa: 24.1.6 -> 24.2.1, now with 100% less Libgbm Thing(tm) #332413)
  2. Add 2 patches from merged MRs:
    https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30979
    https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31013
    First patch just changes error to another error, similar to (https://gitlab.freedesktop.org/mesa/mesa/-/issues/11836):
vm-test-run-terminal-emulator-kitty> machine # [1.325] [glfw error 65542]: GLX: No GLXFBConfigs returned
vm-test-run-terminal-emulator-kitty> machine # [1.326] [glfw error 65545]: GLX: Failed to find a suitable GLXFBConfig
vm-test-run-terminal-emulator-kitty> machine # [1.328] Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.1 drivers.

Second patch depends on first.

nixpkgs diff for patches
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index dc722d44243f..fb15f590a793 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -93,6 +93,7 @@
   ]
 , mesa
 , makeSetupHook
+, fetchpatch
 }:

 let
@@ -139,6 +140,16 @@ in stdenv.mkDerivation {

   patches = [
     ./opencl.patch
+    # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30979
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30979.patch";
+      hash = "sha256-JbrygyjtgNcQlggv1X+3HWf4WRWdtyeEvg3jwthEspM=";
+    })
+    # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31013
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31013.patch";
+      hash = "sha256-J6P7k6SuOqRzmeqiiAc+QgBDp5nIBY+sPwvnQ+hlCW8=";
+    })
   ];

   postPatch = ''

Notify maintainers

Listed mesa maintainers:
@primeos
@vcunat

@K900 (author of update PR)


Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions