Variable refresh rate - ArchWiki

Jump to content

# Variable refresh rate

From ArchWiki

Related articles

- Xrandr
- Xorg
- AMDGPU
- NVIDIA
- Sway

Variable refresh rate (VRR), also referred to as adaptive sync, allows the monitor to adjust its refresh rate to the output signal. This allows for games to eliminate screen tearing with less of the usual downsides of Vsync (such as stuttering). For a comprehensive look at VRR see PC Gaming Wiki.

## Overview

This article or section is out of date.

Reason: It looks like this needs to be updated to reflect the latest Intel GPUs. (Discuss in Talk:Variable refresh rate)

There are multiple implementations of VRR:

- FreeSync is AMD's implementation of VESA's VRR standard, and the phrases are often used interchangeably. FreeSync branded monitors should be compatible with all VESA compatible drivers.
- G-SYNC is NVIDIA's proprietary hardware and software implementation of VRR.
- Intel implements VESA's standard starting with 11th Gen integrated graphics and dedicated GPUs.

For setup purposes, it is necessary to differentiate between "native" G-SYNC monitors that licenses Nvidia's own chip, and G-SYNC Compatible monitors, FreeSync monitors which support a subset of G-SYNC's functionality. [1] Within the category of G-SYNC Compatible monitors, the monitor may or may not be validated by NVIDIA. [2] [3] Even if a VRR monitor has not passed NVIDIA's validation (and thus would not be called G-SYNC Compatible in marketing material), you may still be capable of using it with G-SYNC.

VRR compatibility and implementations
Driver | VESA | G-SYNC
--- | --- | ---
AMDGPU | FreeSync | No
Intel | Yes | No
Nouveau | No | No
NVIDIA | G-SYNC Compatible | G-SYNC

Note Nvidia GPUs older than their 10 series do not support G-SYNC Compatible monitors.

## Hardware configuration

The monitor must be plugged in via DisplayPort. Some displays which implement (at least part of) the HDMI 2.1 specification also support VRR over HDMI. This is supported by the Nvidia driver and is supported by the AMD driver (pre HDMI 2.1) in Kernel 5.13 and later [4].

Some monitors may not support VRR at their maximum refresh rate. For example, a monitor that supports 165Hz may only support VRR when set to use 144Hz or less.

## Xorg configuration

### Enable on AMDGPU

FreeSync is only available if your monitor is compatible with FreeSync, as well as if your GPU is compatible with FreeSync:

  Compatible GPUs include all AMD Radeon™ graphics cards beginning with Radeon™ RX 200 Series, released in 2013, and all newer Radeon consumer graphics products that use GCN 2.0 architecture and later.

#### Using an Xorg conf file

Add the line to your AMDGPU .conf file in the `Section "OutputClass"` block:

    Option "VariableRefresh" "true"

Verify vrr_capable is set to 1 using xrandr:

    $ xrandr --props

    vrr_capable: 1
            range: (0, 1)

xrandr will show the properties for all video output ports; make sure to look at the one that's actually connected to your monitor - the other outputs will report vrr_capable: 0.

#### Multi-monitor configuration

Suppose you have a new 144Hz FreeSync capable monitor and want to use it as your primary monitor and connect your old 60Hz monitor as secondary monitor. In that case you may want to enable the AsyncFlipSecondaries option in your AMDGPU .conf file in the `Section "OutputClass"` block:

    Option "AsyncFlipSecondaries" "true"

This option is available since xorg-server release 21.1.0 and will allow synchronized page flips up to the highest refresh rate your primary monitor supports. Your secondary monitor(s) may exhibit tearing however.

### Enable on NVIDIA

#### Using a Xorg conf file

This article or section needs expansion.

Reason: This section needs info. (Discuss in Talk:Variable refresh rate)

#### Via nvidia-settings

"Native" G-SYNC and validated G-SYNC Compatible monitors should automatically have VRR enabled. To check the state of your monitors, open nvidia-settings and navigate to your GPU (e.g. GPU 0), under which there will be an node for each active monitor (e.g. DP-0, HDMI-0). In each of those monitor frames, the G-SYNC Mode Available indicates the status of G-SYNC support, either: [5] [6]

- G-SYNC, indicating that this is a "native" G-SYNC monitor. Full G-SYNC support is enabled by default.
- G-SYNC Compatible, indicating that this is a validated G-SYNC Compatible monitor. G-SYNC support is enabled by default.
- G-SYNC Unvalidated, indicating that this is an unvalidated G-SYNC Compatible monitor. G-SYNC support is not enabled by default. [7]
- None, indicating that this monitor does not seem to support G-SYNC. Note that there are some FreeSync VRR monitors which are not G-SYNC compatible at all. [8]

If you have an unvalidated G-SYNC Compatible monitor, you can override NVIDIA's default and enable VRR with it:

- In nvidia-settings go to the X Server Display Configuration page, then under the Advanced button is the option to Allow G-SYNC on monitor not validated as G-SYNC Compatible. Click apply.
- Now, under OpenGL settings, check Allow G-SYNC/G-SYNC Compatible. In the same menu, you can check the show G-SYNC indicator option to display an indicator that G-SYNC is working in the top right corner.

Note If a monitor did fail NVIDIA's certification to be G-SYNC compatible, there may be issues with the experience such as poor image quality, flickering, or lack of VRR activation due to limited refresh rate range. [9]

## Wayland configuration

### NVIDIA

VRR Wayland using the proprietary driver requires a Volta GPU architecture or newer.

NVIDIA has shipped VRR Wayland support starting with driver version 525. Until 545, there are forced VSync issues. Past that, there are still remaining issues which are covered by the VRR Wayland thread on NVIDIA forums.

### GNOME

GNOME supports VRR as an experimental feature starting with version 46. Run `gsettings set org.gnome.mutter experimental-features "['variable-refresh-rate']"` to enable the experimental feature, then restart the session by logging out and back in. VRR can then be enabled for each supported monitor in the Display Settings under Refresh Rate. When running on a supported and enabled monitor, GNOME automatically enables VRR for all full screen applications.

### KDE Plasma

Plasma's Wayland session uses the kwin compositor, which should automatically enable VRR for full screen applications [10].

### Sway

Sway supports variable refresh rate. To enable it for all of your outputs you can add the following to the sway configuration, or apply the setting to on a per output basis:

    output * adaptive_sync on

You can verify that your display supports adaptive sync with swaymsg:

    $ swaymsg -t get_outputs

    Output DP-1 'Display Name'
      Adaptive sync: enabled

Note VRR may not work if an application is full screen in sway. Direct scanout must be disabled by launching sway with `-D noscanout`. https://github.com/swaywm/sway/issues/7370#issuecomment-1380986291

### Hyprland

Hyprland supports variable refresh rate. To enable it, you need to add either `vrr = 1` or `vrr = 2`[11] in the misc section of your `hyprland.lua` :

    hl.config({
        misc = {
            vrr = 1,
        },
    })

Alternatively you can define `vrr` as an extra argument for the monitor(s)[12] variable:

    -- Example monitor configuration
    hl.monitor({
        output   = "DP-1",
        mode     = "2560x1440@240",
        position = "0x0",
        scale    = 1,
        vrr      = 1,
    })

    hl.monitor({
        output    = "DP-2",
        mode      = "2560x1440@165",
        position  = "-1440x-600",
        scale     = 1,
        transform = 1,
        vrr       = 1,
    })

`vrr = 1` always enables variable refresh rate, while `vrr = 2` only enables it for fullscreen applications.

You can verify that your display supports adaptive sync with hyprctl:

    $ hyprctl monitors

    Monitor DP-1 (ID 0):
    	...
    	vrr: true
    	...

    Monitor DP-2 (ID 1):
    	...
    	vrr: true
    	...

### niri

Niri supports variable refresh rate. To enable it, you need to add either `variable-refresh-rate` or `variable-refresh-rate on-demand=true`[13] in your output section of your `config.kdl` :

    output "DP-1" {
       variable-refresh-rate
    }

`variable-refresh-rate` always enables variable refresh rate, while `variable-refresh-rate on-demand=true` will only enable VRR when a window matches the variable-refresh-rate window rule[14]. This is helpful to avoid various issues with VRR, since it can be disabled most of the time, and only enabled for specific windows, like games or video players.

You can check whether an output supports VRR:

    $ niri msg outputs

     Output "Display Name" (DP-1)
      ...
      Variable refresh rate: supported

## Testing

VRRTest is a simple testing tool which should work for FreeSync and G-Sync. Install vrrtestAUR, or manually install the love package, clone the repository, then run

    $ love /path/to/cloned/repository/src

With VRR off, if the application's FPS is less than the monitor's native refresh rate then the bars will stutter a lot since frames are being skipped. With VRR active, the bars will always move smoothly across the screen since the screen's refresh rate will match the application's refresh rate. Even with VRR functional you may experience tearing in which case you can also enable the TearFree option for AMDGPU; with both enabled there should be neither stuttering nor tearing (what is the nvidia equivalent?).

If you are using a Nvidia GPU, you can test G-SYNC compatibility with gl-gsync-demoAUR. This program will allow you to test VRR and Vsync so you can observe resulting effects. See project's Readme for more information.

According to this page: "gl-gsync-demo is made with G-SYNC but that does not matter, it will test AMD adaptive sync just fine". However, it may still not work as expected for FreeSync testing.

## Change VRR range of a FreeSync monitor

Freesync monitors usually have a limited range for VRR that are much lower than their maximum refresh rate, or that does not extend to the minimum refresh it is capable of. It should be possible to underclock or overclock the monitor to change the Freesync range.

Warning Overclocking your monitor may cause it to run hot and possibly cause harm. Underclocking, however, should be safe.

### Obtaining the EDID file

External Display Identification Data (EDID) stores driver information about your monitor. By default, this file is sent by your monitor and read on connect.

#### NVIDIA

For NVIDIA users, you will need to extract this file using something like read-edid or nvidia-settings.

#### AMD

For modern AMD GPUs, the kernel should expose a read-only copy of the EDID via the sysfs (i.e. `/sys/class/drm/card0-DP-2/edid`).

### Editing the EDID File

You can edit this file with wxedidAUR.

#### Alternative method (AW EDID Editor)

Sometimes, wxedid will refuse to save the file with an error such as:

    CEA_Set_DTD_Offset(): num_dbc=6, num_dtd=4, dtd_offs=42
    [E!] Assemble EDID FAILED.
    wxedid[2]: src/EDID_main.cpp.864 [-1] [E!] Invalid number of extension blocks

In that case, AW EDID Editor (Windows, runs under Wine) can be used.

The relevant section will be under EDID Base > Detailed Descriptor > Block Descriptor > Block 2, then under Block Descriptor Type > Display > Range Limits.

### Applying the modified EDID

This article or section needs expansion.

Reason: This section needs verification from users with a freesync monitor please consider contributing. (Discuss in Talk:Variable refresh rate)

#### X11

Make a Xorg .conf file for your monitor and add a path to the custom EDID file you have edited. See xrandr to find out the other information about your monitor.

    /etc/X11/xorg.conf.d/10-monitor.conf

    Section "Screen"
        Identifier "Screen0"
        Device "nvidia" # e.g. Radeon, nvidia
        Monitor "DP1"
        Option “CustomEDID” “MONITOR:/home/USER/Desktop/modified-edid.bin”
    EndSection

Note Edit “MONITOR” in the file to be the correct display ID. You can get the display ID with the `xrandr -–query` command.

#### Wayland

The most reliable way to apply the EDID on Wayland is to add your modified EDID to your initramfs (if using one) and then specifying it as a boot parameter.

Warning Overriding EDID with this method is port-specific and will not work properly if the monitors are physically re-ordered to another connector. It is not recommended to perform any change in hardware connectors while using this method. Unplugging monitors should be safe, but great care is required to re-attach them in the same connectors to prevent potential damage from applying an EDID incompatible with another monitor.

Firstly, create the required folder:

    # mkdir /usr/lib/firmware/edid

Now, add your modified EDID inside it. Here we will use `vrr.bin` as the filename, but it can be anything:

    # cp modified_edid.bin /usr/lib/firmware/edid/vrr.bin

Then, add the file to the initramfs:

    /etc/mkinitcpio.conf

    …
    FILES=(/usr/lib/firmware/edid/vrr.bin)
    …

Finally, add the command line parameter using your boot loader configuration. The required parameter is `drm.edid_firmware=<connector>:<path>`. As example, to override the EDID for port DP-2, using the file located at `/usr/lib/firmware/edid/vrr.bin` the following needs to be added:

    drm.edid_firmware=DP-2:edid/vrr.bin

Regenerate the initramfs and reboot. You should be able to use the extended VRR range now.

## Tips and tricks

You may follow one of the guides of people changing the freesync range on Windows: [15][16]

Process of overclocking on Linux (works only on NVidia GPUs): [17]

### Remove applications from blacklist

Mesa has a list of blacklisted applications to avoid unexpected behavior, you can edit this blacklist here:

    /usr/share/drirc.d/00-mesa-defaults.conf

## Troubleshooting

### Monitor occasionally drops signal with FreeSync enabled

This is most likely due to firmware issues or driver issues causing the refresh rate to fall below the minimum safety margin[18]. You can mitigate it by raising the minimum vertical refresh range.

#### Using wxedid

See #Editing the EDID File or refer to this tutorial.

#### NVIDIA

Alternatively, you can edit the VertRefresh property in your Xorg configuration file (the following example was generated by nvidia-settings):

    /etc/xorg.conf.d/20-nvidia.conf

    Section "Monitor"
       # HorizSync source: edid, VertRefresh source: edid
       Identifier     "Monitor0"
       VendorName     "Monitor Vendor"
       ModelName      "Monitor Model"
       HorizSync       223.0 - 223.0
       VertRefresh     48.0 - 144.0
       Option         "DPMS"
    EndSection

### Monitor does not show up as VRR capable in Wayland, despite supporting it

For some devices (such as laptop displays), GNOME/Plasma may not recognize VRR capability under Wayland, despite the display supporting it (and advertising support via EDID.

This may be caused by your greeter (such as GDM/SDDM) running on X11, while your desktop session is running on Wayland. To fix this, configure your greeter to use Wayland instead (see: SDDM#Wayland).

## Known issues

- Wayland is supported as of KDE Plasma 5.22 (any compatible GPU) and Sway (no Nvidia) [19] [20]. GNOME Wayland is supported starting with version 46 as an experimental feature.
- If you want to use G-SYNC and possibly Freesync on X11, only the G-SYNC/Freesync monitor must be connected.
  - On X11, multiple monitors in a single X display will break G-SYNC/Freesync, however, this problem does not exist on Wayland.
  - A secondary monitor set as copy/duplicate of the primary monitor does not break G-SYNC/Freesync on the primary monitor.
  - If on X11, if you want to use multiple monitors and still use G-SYNC/Freesync, you can create a new X display which only covers the G-SYNC/Freesync monitor and run games there.
- Compositors will most likely need to be disabled before the OpenGl/Vulkan program is started (disabling compositors is not relevant or necessary on Wayland [21]).
- On X11, Mesa blacklists many applications including video players.
- Although tearing is much less noticeable at higher refresh rates, FreeSync monitors often have a limited range for their VRR of 90Hz, which can be much lower than their max refresh rate. See Change VRR Range of a FreeSync Monitor.

Categories:

- Graphics
- X server
- Gaming

Hidden categories:

- Pages or sections flagged with Template:Out of date
- Pages or sections flagged with Template:Expansion

Variable refresh rate
Add topic