Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsync broken and freesync missing #96

Open
aufkrawall opened this issue Jun 15, 2019 · 40 comments
Open

vsync broken and freesync missing #96

aufkrawall opened this issue Jun 15, 2019 · 40 comments
Assignees

Comments

@aufkrawall
Copy link

@aufkrawall aufkrawall commented Jun 15, 2019

Continuation from #16 , as I think situation is too unsatisfying to have no open ticket for it.

  1. Vsync in amdvlk is basically broken. It tears when fps fall below refresh rate. When setting UseFlipHint,1 in amdPalSettings.cfg, it doesn't tear anymore, but looks way too stuttery compared to radv. This seems to be a general issue, as every game I tested shows the same behavior.
    Like I said in the original ticket, use amdgpu.dc=0 or modesetting Xorg DDX for testing, as there is an issue with xf86-video-amdgpu + amdgpu.dc=1:
    https://bugs.freedesktop.org/show_bug.cgi?id=110659

  2. FreeSync is missing. It is implemented in radv since Mesa 19.1 and doesn't comprise many lines of code.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Jul 29, 2019

Any feedback, please?

With the default setting without pageflipping, there is always tearing as soon as fps drop below refreshrate and it looks even more stuttery than without vsync at the same time.

With pageflipping enabled via UseFlipHint,1, there is no more tearing, but the result is much more stuttery than with radv. This is also visible in DXVK's frametime graph, it shows more spikes:
411300_20190729124459_1
411300_20190729124900_1

You are also wasting performance by not enabling pageflipping by default: Even when vsync is disabled, fps are ~3% higher with UseFlipHint,1 (as long as amdgpu.dc=0 is used).

@MojoJojoDojo
Copy link

@MojoJojoDojo MojoJojoDojo commented Jul 30, 2019

I know the Windows driver got broken vsync too.
I don't have a Freesync monitor though.
I reported about this here on AMD Vulkan forums : https://community.amd.com/thread/240310

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Jul 30, 2019

There seems to be something broken in the recent Windows drivers, I'm getting uneven presentation in Serious Sam Fusion. But I think that must be an actual regression, it it used to work without issues before (Edit: The issue on Windows is the application's fault, it incorrectly sets backbuffers).
Though the Linux amdvlk situation on Xorg has always been as bad as it is today.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Sep 17, 2019

Good to see an assignment for this.
The bug regarding amdgpu.dc=1 which I mentioned in the opening post turned out to be a bug in Wine that can be "fixed" by reverting this Wine commit:
wine-mirror/wine@c6b6935

But: As expected, this doesn't touch this amdvlk issue.
Pageflipping being disabled in amdvlk driver by default also affects the native Linux version of Rise of the Tomb Raider, there is tearing despite of the vsync option enabled in the game.
When setting UseFlipHint,1, the tearing is gone, but frame output looks extremely stuttery.
With radv, there is no tearing when enabling vsync and it also looks as smooth as the Windows DX11/12 version on native Windows.

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Sep 18, 2019

Got it, hopefully I can take a look at the stuttery issue with vsync enabled next week.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Sep 18, 2019

Fantastic, thank you. :)
As a side note: It already stutters without vsync when UseFlipHint,1 is used in fullscreen with amdgpu.dc=1.

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Sep 27, 2019

Hi @aufkrawall , is this issue only with dxvk? It's not seen on my end, native Linux. Did you install amdgpu-pro driver? And also, amdgpu.dc = 0 or 1? I'm little confused because it's a long thread continious from #16 . Could you describe again about how to reproduce this issue step by step, including OS, HW, and how to proceed with the Game (I tried with Rise Tomb benchmark, but the issue is not seen)? It will be helpful if there is any simple demo, such as modified vkcube, to reproduce this issue.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Sep 27, 2019

@JacobHeAMD
Here it's also 100% reproducible with native Linux version of Rise of the Tomb Raider by Feral.
With the driver default of UseFlipHint,0, I'm having constant tearing with vsync, despite of always achieving the 75fps for my display's 75Hz refresh rate.
When I set UseFlipHint,1, there is no more tearing, but framerate suffers and it runs at very stuttery ~67fps instead of 75fps:
Screenshot_20190927_104035

Without vsync, it runs with stable 82fps in that scene:
Screenshot_20190927_104013

This is with amdgpu.dc=1. As I mentioned before, this issue does not occur with radv.
I don't know what else to describe. I load any game and the issue is always there with amdvlk.

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Sep 27, 2019

Is it 4k resolution of your monitor? Mine is 2k, that's probably the reason why I don't see it. I'll try 4k monitor later.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Sep 27, 2019

I'm on a 1440p display and the games' render resolution is also set to it and fullscreen mode (so there should be no problem with fullscreen windows to trigger pageflipping on xorg).
It seems pageflipping never kicks in here with amdvlk and driver default of UseFlipHint,0, and enforcing it in the driver via UseFlipHint,1 just leads to something bad. At least that would be my layman interpretation.

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Sep 27, 2019

Could you please tell me which gpu are you using? You can get it by "lspci | grep VGA" in cosole.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Sep 27, 2019

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev ef)

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Sep 29, 2019

I still didn't see this issue, probably I missed something important. Our CQE will try to reproduce it, will take a look if it's reproduced.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Oct 22, 2019

Still broken with v-2019.Q4.1.

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Oct 25, 2019

Hi @aufkrawall , could you please clarify if the tearing happens to "UseFlipHint,1" + vsync on ? Or it just happens to UseFlipHint=0 or vsync off?

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Oct 25, 2019

@JacobHeAMD
"UseFlipHint,1" + vsync on: No tearing, but very stuttery result when fps are below refresh rate
"UseFlipHint,1" + vsync off: tearing, but still bad stutter at the same time
"UseFlipHint,0" + vsync on: tearing (might occur close to the top or bottom of the screen)
"UseFlipHint,0" + vsync off: works normally

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Oct 29, 2019

Hi @aufkrawall , may I know which kernel are you testing with? Is it 5.0?

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Oct 29, 2019

@JacobHeAMD It is 5.3.7. I'd be surprised if it made a difference, as radv just works.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Nov 15, 2019

As expected, the Shadow of the Tomb Raider port by Feral shows tearing with amvlk + vsync, while radv + vsync does not.

Edit: That was with amdvlk-proprietary. amdvlk-open just crashes the game.

@MojoJojoDojo
Copy link

@MojoJojoDojo MojoJojoDojo commented Nov 29, 2019

Now that they fixed AMDVLK on Hybrid Graphics I can see the tearing issues too when playing NI No Kuni Remastered.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Nov 29, 2019

Are you rendering on a different GPU than the one that outputs to display? If yes, that might be a very similar, but actually different issue. I'm also getting tearing with radv/anv when rendering on the IGP of my 6700k while outputting via Polaris dGPU. That might be an Xorg limitation.

But this amdvlk issue is not, it's an amdvlk limitation. ;)

@MojoJojoDojo
Copy link

@MojoJojoDojo MojoJojoDojo commented Nov 29, 2019

Ya but the thing is when i use "UseFlipHint,1" like you said the tearing stops and gets replaced by stutters (unless that's also part of "very similar issue" you meant).
The Intel GPU renders the desktop while the game uses the dgpu ya (its a laptop).
Also the tearing does not happen on RADV.

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Jan 3, 2020

Hi @aufkrawall , would you mind to try the latest amdvlk driver?

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Jan 4, 2020

As broken as ever with 2019.Q4.5-1 from Arch repo.

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Jan 6, 2020

Do you mean it's same as before no matter if UseFlipHint is turned on or off?

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Jan 7, 2020

Ok, it definitely has improved with UseFlipHint,1, it seems to look normal now without vsync in fullscreen.

However, despite of having improved, UseFlipHint,1 + vsync still looks more choppy than radv. It's not that obvious anymore, but still definitely worse. Also DXVK's frame time graph still mirrors this:
Screenshot_20200107_145456
Screenshot_20200107_145251

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Jan 7, 2020

Thanks! I'll take a look the issue of "UseFlipHint,1 + Vsync".

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Jan 7, 2020

You likely need to get into frame rates below the display's maximum refresh rate to trigger it. In my layman terms, it appears to me like an issue of the logic that decides how frame draws are repeated to match the refresh rate as good as possible.

@MojoJojoDojo
Copy link

@MojoJojoDojo MojoJojoDojo commented Feb 28, 2020

The issue with tearing on fixed referesh rate displays is still a thing :X (at least on Windows) .

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Mar 27, 2020

However, despite of having improved, UseFlipHint,1 + vsync still looks more choppy than radv. It's not that obvious anymore, but still definitely worse. Also DXVK's frame time graph still mirrors this:
Screenshot_20200107_145456
Screenshot_20200107_145251

@JacobHeAMD May I ask if this is fixed, now that page flipping is turned on by default in amdvlk?

@JacobHeAMD
Copy link
Member

@JacobHeAMD JacobHeAMD commented Mar 27, 2020

@aufkrawall , I think it's not fixed since it's not seen at my end. I will try to add timestamp log to check the issue when I have time. The flip is enabled by default now.

@Degerz
Copy link

@Degerz Degerz commented Apr 20, 2020

Adaptive refresh can now be manually enabled in the PAL settings.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Jul 10, 2020

Could somebody please retest the situation with vsync and page flipping when frame rate is below refresh rate (see Hitman 2 screenshots above)?

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Aug 1, 2020

@JacobHeAMD
Vsync still badly affects rendering frame times as shown above. This is with amdvlk 2020.Q3.2 & RX 480 on Xorg.
It's nice that FreeSync works well once activated, but vsync triple buffer/flipping should be fixed regardless.

@MojoJojoDojo
Copy link

@MojoJojoDojo MojoJojoDojo commented Aug 3, 2020

Enabling vsync still gives me tearing no matter the game.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Aug 3, 2020

@MojoJojoDojo Perhaps you have an amdPalSettings.cfg at some path you forgot and in which you set UseFlipHint,0? I think since it's set to 1 by default in more recent drivers, it shouldn't tear anymore.

But unlike with radv, vsync with amdvlk still gives me oscillating frame time graph and thus more stutter in any game when fps are below maximum refresh rate and FreeSync is disabled:
Screenshot_20200803_110221

Some competitor btw. fixed their Vulkan triple buffered fifo mode in a recent driver. ;)

@MojoJojoDojo
Copy link

@MojoJojoDojo MojoJojoDojo commented Aug 24, 2020

Is there a way to set UseFlipHint,1 on the Windows Vulkan driver?
Would be helpful to stop the tearing I get there (LInux driver is fine ofc).
Opened another issue about this just in case #182.
Vsync works good on the WIndows intel gpu driver.

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Aug 24, 2020

@JacobHeAMD If I understood you right, you said you couldn't reproduce. So does your DXVK frame time graph (DXVK_HUD=frametimes) look flat with vsync enabled and fps below refresh rate? It certainly doesn't here. Please check if you have EnableAdaptiveSync set, having adaptive sync enabled completely masks the issue.

Recent test with RX 480, amdvlk v-2020.Q3.4, Linux 5.8/5.9-rc, xorg-server 1.20.8, xf86-video-amdgpu 19.1.0, Proton 5.0-9 and latest Hitman 2 version via Steam, compositor entirely disabled, fullscreen:

amdvlk with vsync capping fps at refresh rate (85Hz) as GPU can deliver enough fps = flat:
Screenshot_20200824_183313

amdvlk when dropping below 85fps GPU bound = spiky:
Screenshot_20200824_183326

radv when dropping below 85fps GPU bound = flat (minor variance in GPU frame time like without vsync):
Screenshot_20200824_183419

amdvlk definitely feels more stuttery than radv when fps are below refresh rate when vsync is enabled (the result of both drivers is entirely free of tearing), it's not just a cosmetic issue in DXVK frame time graph. Could you please have another look?

@aufkrawall
Copy link
Author

@aufkrawall aufkrawall commented Sep 28, 2020

I'm starting to think that vsync is notoriously broken in Windows version of amdvlk as well. This is with Adrenalin 20.9.1 & DXVK:

Vsync off:
863550_20200928184034_1

Vsync on:
863550_20200928184022_1

Does anybody even care?

@MojoJojoDojo
Copy link

@MojoJojoDojo MojoJojoDojo commented Oct 11, 2020

I guess they are banking on people using Freesync monitors and not using non-freesync/laptop monitors.
I guess I am stuck with using RADV for awhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.