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 (it will usually work with DisplayPort 1.2 or higher). 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[edit]

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[edit]

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[edit]

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

WaiLin

9 months ago
Score 0++

Have you tested this and verified that it works? If so, how? And which games?

There is an edit button on articles here on the desktop version (not the mobile phone version unless you use a desktop UA) so you can make changes and correct errors. We would greatly appreciate if you do that if you have the time and knowledge.

There will be a field where you have to "explain" your edits when you save. Don't worry about that if it is obvious from your edits that you know what you're doing. Also, this isn't Wikipedia, you don't need to link to "sources". If you tried something and you know it works then you're obviously a good "source". Just don't make stuff up.
avatar

Anonymous (9c67d7bf2b)

4 months ago
Score 0
What about adaptive sync over HDMI? A lot of cheaper 75hz monitors with adaptive sync support but only via HDMI out there...
Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.