nix-community / nixpkgs-wayland

Automated, pre-built packages for Wayland (sway/wlroots) tools for NixOS. [maintainers=@colemickens, @Artturin]
510 stars 45 forks source link

Latest nixpkgs-wayland breaks GLX on wayland #438

Closed dmayle closed 8 months ago

dmayle commented 8 months ago

I use nixpgs-wayland with the nvidia driver, and that ensures that my experience under sway is flicker free.

Sometime over the last month, GLX stopped working. If I remove the nixpkgs-wayland overlay, I get GLX working again (but now with all of the flickering).

With the nixpkgs-wayland overlay, EGL and Vulkan work just fine, but GLX fails to load hardware (mesa only)

[nix-shell:~]$ GBM_BACKEND=nvidia-drm __GLX_VENDOR_LIBRARY_NAME=nvidia LIBGL_DEBUG=verbose glxinfo -B
name of display: :0
X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  0
  Current serial number in output stream:  29
[nix-shell:~]$ LIBGL_DEBUG=verbose glxinfo -B
name of display: :0
MESA-LOADER: dlopen(/run/opengl-driver/lib/dri/zink_dri.so)
did not find extension DRI_CopySubBuffer version 1
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/douglas/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/douglas/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/douglas/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/douglas/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/douglas/.drirc: No such file or directory.
DRI3 not available
failed to load driver: zink
MESA-LOADER: dlopen(/run/opengl-driver/lib/dri/swrast_dri.so)
did not find extension DRI_Kopper version 1
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/douglas/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/douglas/.drirc: No such file or directory.
did not find extension DRI2_Flush version 1
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Mesa (0xffffffff)
    Device: llvmpipe (LLVM 16.0.6, 256 bits) (0xffffffff)
    Version: 23.3.3
    Accelerated: no
    Video memory: 128746MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 4.5
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 0 MB, largest block: 0 MB
    VBO free aux. memory - total: 123969 MB, largest block: 123969 MB
    Texture free memory - total: 31 MB, largest block: 31 MB
    Texture free aux. memory - total: 123969 MB, largest block: 123969 MB
    Renderbuffer free memory - total: 31 MB, largest block: 31 MB
    Renderbuffer free aux. memory - total: 123969 MB, largest block: 123969 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 1968074 MB
    Total available memory: 2096820 MB
    Currently available dedicated video memory: 31 MB
OpenGL vendor string: Mesa
OpenGL renderer string: llvmpipe (LLVM 16.0.6, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 23.3.3
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.5 (Compatibility Profile) Mesa 23.3.3
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.3.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
Artturin commented 8 months ago

You should bisect and report the issue to the offending projects repo

dmayle commented 8 months ago

Okay, I'm working to do that now. Previous revision 511bd3364d5bab789093d774c7c276d9b7e51011 is good, while revision 791da42b6442870964b11ea28cf5932a76483548 is no longer working:

[douglas@beast:~/src/nix-config]$ git diff
diff --git a/flake.lock b/flake.lock
index 2100970..c4d0c11 100644
--- a/flake.lock
+++ b/flake.lock
@@ -278,11 +278,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1706386306,
-        "narHash": "sha256-YCiWq2bSt+fKxnYpP9PJ52cthm8dkHUuEVFkwJDauSw=",
+        "lastModified": 1703725031,
+        "narHash": "sha256-PYxvnZcqn66Orlfmr/t/f5ywLYnGhP2oDAFlsQ0GFOQ=",
         "owner": "nix-community",
         "repo": "nixpkgs-wayland",
-        "rev": "791da42b6442870964b11ea28cf5932a76483548",
+        "rev": "511bd3364d5bab789093d774c7c276d9b7e51011",
         "type": "github"
       },
       "original": {
dmayle commented 8 months ago

Revision b2b2ac38df53cdcae172302a11ae34448f4a2598 is good

dmayle commented 8 months ago

Revision b40e4b779702ff40c4e6ef072dccf47c8f077702 is bad, while revision b2b2ac38df53cdcae172302a11ae34448f4a2598 is good.

BTW: I'm using the following command to only update nixpkgs-wayland:

nix flake lock --update-input nixpkgs-wayland --override-input nixpkgs-wayland github:nix-community/nixpkgs-wayland/$REV
dmayle commented 8 months ago

Revision 237c5549c149a261165d1116a513c7df84ced1d7 is good

dmayle commented 8 months ago

Revision d93ff536c8fecffaf2dc09db3b14b2c8fcbcab7c is bad

dmayle commented 8 months ago

Revision 904707f5522c7414a634c14f29f96f108b6d2d27 is good

dmayle commented 8 months ago

Revision 75f79ac32cc3ec8d37b8c2f08b17275f2487384f is bad

dmayle commented 8 months ago

The offending commit is 298b728f5bb64eca3a57e7767cc649cfecf308fb, which is responsible for updating sway-unwrapped.

Previously, sway was at revision fa294a9094b673e99e5de0c456dc5a6b9ff7db55 from January 2nd.

This commit brings sway up to revision ae33f4eb37a8ee647907e4fef72c6a488b8b1138 from January 19th

Artturin commented 8 months ago

https://github.com/swaywm/sway/issues/7897

dmayle commented 8 months ago

That's exactly the issue. It looks like good progress is being made on fixing the issues. I'm freezing my nixpkgs-wayland for the moment until all of the various broken pieces get picked up (XWayland, libva, and sway)

Artturin commented 8 months ago

You can launch sway with -Dlegacy-wl-drm

dmayle commented 8 months ago

Is that a runtime flag, or a compile-time flag?

On Tue, Jan 30, 2024 at 10:03 AM Artturi @.***> wrote:

You can launch sway with -Dlegacy-wl-drm

— Reply to this email directly, view it on GitHub https://github.com/nix-community/nixpkgs-wayland/issues/438#issuecomment-1917603745, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQLWNG2EZNWDWCA6PB72TYREYVNAVCNFSM6AAAAABCNPOYE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJXGYYDGNZUGU . You are receiving this because you modified the open/close state.Message ID: @.***>

dmayle commented 8 months ago

That is a runtime flag! Once the new sway hits nixpgs-wayland (if it hasn't already), I'll give it a shot.

colemickens commented 8 months ago

Merged last week, I'd expect it to be there. Let us know. This is probably why I've had to run Steam under gamescope.

Artturin commented 8 months ago

Mpv was segfaulting for me and that flag fixed it