Low Frame Rate Compensation (with Adaptive Sync) fails to prevent tearing on Linux (works fine on Windows 10)

Monitor: Alienware AW2518HF (VRR range: 48-240 Hz, non validated).
GPU: GTX 1070ti

Distros tested: Ubuntu 19.04 (fresh install), Kubuntu 18.04
Tested driver versions: 430.40, 430.26 and 418.56
Window managers tested: Mutter, Kwin (no composition), Openbox

-The expected behavior-
When my fps dip below my monitor’s minimum VRR range value (48), the frames sent to my monitor are supposed to be multiplied to a value landing inside of my VRR range in order to still prevent tearing.

-The problem-
Using my monitor’s OSD, I can see that frames get indeed multiplied but, unlike what happens in Windows 10, the number of frames shown by my monitor’s OSD keeps jumping erratically in and out of my monitor’s VRR range and I can clearly see screen tearing.

Example: if I limit a game (or a test application) to run at a stable 46fps, my monitor’s OSD keeps jumping back and forth between 46 and 230 extremely fast. When I use the same software on Windows with the same settings, my monitor’s OSD shows a stable number (multiple of 46), adaptive sync is working correctly and tearing is nowhere to be seen.

Almost seems like frame multiplication is not occurring for certain frames…

And just to be clear: adaptive sync is working as intended when my fps land inside of my VRR range. What is failing here is only LFC.

-How to reproduce-
Cross platform software recommended:

  • Download the AppImage for Linux (or the zip file for Windows) and run the application.
  • Use the right arrow key to slow down the grey bar (keep it pressed for a while especially on very high refresh rate monitors).
  • Optional: press the b key once to enable busy waiting for more stable frame times.
  • Use the down arrow key to drop the fps sufficiently below your minimum VRR range value.
  • Observe screen tearing occur despite LFC and Adaptive Sync being active (if you can't clearly see tearing right away, slow down the grey bar a little more or drop a few more fps).
  • Repeat the process on Windows to see that tearing gets correctly prevented under the same conditions.
  • I could also reproduce this with other software like the Pendulum Demo running with Wine+DXVK but VRRTest is multi-platform and easier to install.

    It took me a long time to notice this in games as I rarely hit these low frame rates on this machine but all the testing I did seems to point at a driver bug…
    Hopefully you guys can reproduce this.
    nvidia-bug-report.log.gz (1.12 MB)