Enable vertical sync on amd gpu

I have a radeon rx580 gpu and I’m seeing a lot of screen tearing. How do I enable vertical sync for this gpu? This is my xserver config:

  services.xserver = {
    enable = true;
    displayManager.startx.enable = true;
    layout = "us";
    videoDrivers = [ "amdgpu" ];
    libinput.enable = true;
    libinput.naturalScrolling = true;
  };

Thanks.

Not sure about gnome and kde, but for window managers, you need a compositing manager. In my experience, compton eliminates tearing. I think you can just start compton in an X11 session to try it out.

1 Like

picom replaces compton

@Flakebi @nrj I tried running the compton command but it didn’t fix the tearing. I also tried adding this to my config and restarting the xserver but the tearing was still there:

  services.picom = {
    enable = true;
    vSync = "opengl-swc";
    backend = "glx";
  };

This config fixed the tearing:

  services.picom = {
    enable = true;
    vSync = true;
  };

I’m using

services.xserver.deviceSection = ''Option "TearFree" "true"''; # For amdgpu.

This config works too.