Eliminate screen tearing with Intel/Mesa

Thanks for following up, @thomas!

What are the default settings that you used? I also had screentearing when I used the recommended lines:

services.xserver.videoDrivers = [ "modesetting" ];
services.xserver.useGlamor = true;

For me, the easiest way to remove it was to avoid specifying anything for videoDrivers or useGlamor at all. The problems disappeared entirely, however, when I stopped using Gnome and moved to wayland + sway.

I’m interested to hear more about what you settle into with EXWM…I’m interested in that as an alternative window manager :slight_smile:

Don’t have any insight here…Sorry!

What are the default settings that you used? I also had screentearing when I used the recommended lines:
[…]
For me, the easiest way to remove it was to avoid specifying anything for videoDrivers or useGlamor at all.

I tried a few different combinations:

  1. No videoDrivers or useGlamor: the X server failed to start
  2. useGlamor = true and videoDrivers set to [ "modesetting" ]: the X server failed to start
  3. useGlamor = true, and no videoDrivers setting: X server starts, but I get screen tearing
  4. The optional route (intel and DRI settings etc): X server starts, no screen tearing.

I don’t know how much of an effect using the fallback has (the manual seems to imply that it’s not as performant), but I don’t think I’ll notice much of a difference here at all; it’s a work laptop, so will only be used for development, and not the GPU-intensive kind :man_shrugging:

About EXWM: Overall, I think it’s great! I’ve used it for about two years now. It definitely has some issues and edge cases, but there’s also so much you can do with it, so I think it’s worth it. That said, I’ve never really used any other window managers, so I may be missing out :see_no_evil:

1 Like

I wanted to say thank you for this thread, however, it did not resolve my problem.

Using the latest linux kernel solved it however!

boot.kernelPackages = pkgs.linuxPackages_latest;

I was using musnix with a realtime kernel but real time kernels are outdated so that’s why the 11th gen cpu didn’t work with my config.

Right now I’m using the intel drivers but I will try with the modesettings + glamor :wink:

I can safely say right now that my problem was only kernel related. kernel 5.11.4 is not enough, kernel 5.14.1 works perfectly! (Which is the latest)

I can use whatever video parameter so I’ll use the modesetting + glamor one :wink:

Chiming in after about a month and a half of use here.

Turns out that the performance drop from using this alternative setting

  services.xserver.videoDrivers = [ "intel" ];
  services.xserver.deviceSection = ''
    Option "DRI" "2"
    Option "TearFree" "true"
  '';

was far from negligible. As was mentioned in another comment, it made the computer basically unusable. It took me a while to realize that was what it was, though. Maybe I should have suspected it when it came with certain other graphical problems?

As recommended by @joshrule (massive thanks! :pray:), I ended up removing the videoDrivers and useGlamor settings. While that has reintroduced a slight bit of screen tearing (on XFCE + i3), the performance is soo worth it :sweat_smile: By using the videoDrivers = ["modesetting"] option, screen tearing was a bit worse than without.

I don’t know why this combination of settings caused my X server to fail to start previously, but it may have been related to the DE/WM change (none+exwm to xfce+i3), or I might have made a mistake.

Anyway, performance is pretty good, so I’ll tolerate a bit of tearing for now :grinning_face_with_smiling_eyes:

1 Like

I’ve got this problem

It was caused by a problem in the compositor I am using (picom)

On home-manager it was a matter of services.picom.vSync = true; and it’s gone.

3 Likes

Ah, no way! Yeah, that seems to work for me too! :tada: Thanks!

Edit: doesn’t seem to fix it completely at least makes it much better :tipping_hand_man:

2 Likes

@lucasew 's solution fixed it for me as well!