HOWTO enable Adaptive Vertical Sync (Freesync) on AMD GPUs

From LinuxReviews
Jump to navigationJump to search
Amdlogo.png

You can enable Variable Refresh Rate adjustment (VRR) on GNU/Linux if you have a AMD graphics card and a display capable of variable refresh. The monitor does not have to use the AMD "Freesync" standard for this to work, VRR can be enabled on any display following the VESA DisplayPort 1.4 VRR specification. VRR is disabled by default; enabling it is a simple matter of setting the X configuration option VariableRefresh to true.

You do not need a "Freesync" branded monitor. You do need one with support for variable refresh rates using either Freesync or the VESA DisplayPort VRR standard.

Requirements

Amd-information.jpg

You will need a display which is either capable of doing AMD Freesync OR able to do vertical refresh synchronization using the VESA standard. You will also need:

  • Linux 5.0+ (Any recent kernel will do)
  • Mesa 19.0+ for OpenGL and Mesa 19.1+ for Vulkan VRR support
  • A display connected using DisplayPort. VRR is currently not supported on displays connected using HDMI (unless that's changed, it's still the case with Linux 5.9.1).

You can run xrandr --prop | less and search for vrr_capable by pressing / or xrandr --prop |grep vrr to just get the vrr_capable: setting. If you have one or more monitors that say vrr_capable: 1 then congratulations, your display has variable refresh rate support. Note that vrr_capable: 1 does not mean it's enabled, it just means it's supported.

Check your monitors menu if you suspect that it may support VRR and it's connected using DisplayPort and xrandr shows it as vrr_capable: 0. There are some "office" monitors with VRR support that are shipped with VRR turned off. ASUS PB27U is one example of a monitor that can do VRR if you enable it in the display settings.

Configuration

All you need to enable "Freesync"/VRR is a line that says Option "VariableRefresh" "true" to a configuration file named something like 20-radeon.confin the folder /etc/X11/xorg.conf.d/. That's it. Here's an example:

File: /etc/X11/xorg.conf.d/20-radeon.conf
Section "Device"
  Identifier "AMD"
  Driver "amdgpu"
  # 8-bit or 10-bit colors 24 or 30
  # Using 10-bit breaks Chromium and Chrome
  DefaultDepth    24
  Option "TearFree" "1"
  Option "VariableRefresh" "true"
EndSection
Kemonomimi rabbit.svg
Note: The folder /etc/X11/xorg.conf.d/ does not exist on default Ubuntu installations. It will be used if it exists. Simply sudo mkdir /etc/X11/xorg.conf.d/ and place the configuration file(s) you want in that folder.

The Option "TearFree" "1" is not required for Option "VariableRefresh" "true" and either setting can be used without the other. TearFree will enable triple buffering which will eliminate tearing in games with a broken vsync implementation and also prevent tearing in a lot of other cases. xfwm4 4.12 is one prime example of something which requires this setting.

grep VariableRefresh /var/log/Xorg.0.log will show AMDGPU(0): VariableRefresh: enabled if this setting is read and it will show AMDGPU(0): VariableRefresh: disabled if it's not. Do be aware that the log will say AMDGPU(0): VariableRefresh: enabled as long as X understands that you've set Option "VariableRefresh" "true", this does not show if it's working or not. X will happily log VariableRefresh: enabled even if there are no VRR capable displays connected.

One last minor detail: You will also need Option "DRI" "3" if you are using Xorg >= 1.18.3. That's a very old Xorg version so your Mesa and kernel versions are probably too old to use VRR if your Xorg version is that old.

Limitiations

There are some caveats to be aware of.

  • VRR/Freesync will only work if games or and applications that are running full screen.
    • Window-managers like xfwm4 needs to have a configuration option like Display fullscreen windows in an overlay directly enabled.
  • There does not appear to be any way to get MangoHud or other software to show the true display rate. It's hard to verify if it's working if you don't have a monitor capable of showing FPS on-screen.
  • There's almost no software with actual VRR support. Like no games. At all.

The small and simple test application "Unofficial OpenGL G-SYNC Demo for Linux" available at github.com/dahenry/gl-gsync-demo is a quick and easy way to verify that adaptive sync is working. It is made with G-SYNC but that doesn't matter, it will test AMD adaptive sync just fine (it will crash if you try to turn vsync on/off by pressing V). Turn on your monitors FPS counter (if it has one) and run that and you should see the monitors FPS overlay display change. That should make you happy until you try some games... SuperTuxKart does NOT support variable refresh rate, neither does CS:GO or anything else for that matter.

Feel free to leave a comment below if you are aware of any worthwhile games that actually support the technology on GNU/Linux. It seems very much like VRR is something you can enable and test but not actually use for anything practical.

avatar

Anonymous user #1

6 months ago
Score 0++

Hello - i was fighting with this stuff for hours until i figured out what is/was wrong: I'm using PopOS 19.10 which is Gnome. so there are actually 2 instances of X running.

flip@pop-os:~$ cat ~/.local/share/xorg/Xorg.0.log | grep Variable [ 75.393] (==) AMDGPU(0): VariableRefresh: disabled


flip@pop-os:~$ cat ~/.local/share/xorg/Xorg.1.log | grep Variable [ 15.503] (**) AMDGPU(0): Option "VariableRefresh" "true" [ 15.588] (**) AMDGPU(0): VariableRefresh: enabled

So make sure you check the correct log file if things were done properly in 10-amdgpu.conf or whatever you are trying to do. It might work but you were looking in the wrong log file to begin with.

Good luck
avatar

Anonymous user #2

2 months ago
Score 0++

Hi,

Thanks for that info, I had the same issue on Pop!_OS, running cat ~/.local/share/xorg/Xorg.0.log | grep Variable would always say that it was disable, but it was showing up as enable in cat ~/.local/share/xorg/Xorg.1.log | grep Variable.

Thanks for the info.
Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.