Closed brokenisuseless closed 5 years ago
Logs? Hardware / Driver?
Just as a note, if you are experiencing stutter (it is unclear what exactly your problem is), this is to be expected since all shaders have to be recompiled.
I may be experiencing a similar issue. Playing The Witcher 3 on my Intel UHD620 (kabylake mobile i7) using ANV from mesa GIT, using proton 3.16-7 with the stock DXVK 0.96, when replacing the dlls with DXVK 1.0 ones, I have the following experience:
1) First everything is super choppy as it recompiles shaders (To be expected). 2) This gets better after a few minutes, but the performance does not feel right. 3) I reverted to 0.96 and performance is back to where it was.
I will try and get some more info for you, I don't know yet if the issue is overall frame rate, or a jitter issue, just that it is quite large.
With DXVK 0.96:
With DXVK 1.0:
With DXVK 1.0 the framerate has a significant slowdown, more jitter, and the whole scene is rendered too dark.
Can you bisect this please? All your issues seem to be Intel-specific, the game still renders perfectly fine on everything else and performance on my Polaris card has actually improved slightly.
Not that I'd call 17 FPS playable in the first place.
Yeah, it was on battery, plugged in I get closer to 20. I'm busy setting up a cross compiler, as I only have access to Linux ,so will report once I get it to build anything.
Yeah, it was on battery, plugged in I get closer to 20.
You could achieve a bit more fps by reducing the resolution to 720p, 1080p is really taxing on a mobile chipset.
I had stuttering in The Witcher 3 after updating from v0.96 to v1.0 me too (RX 580 with RADV).
After deleting witcher3.dxvk-cache
file, problem was solved for me.
Ok, I failed to get a build env that worked (changed mingw threading model, but then ld broke), but I found these near daily builds: https://haagch.frickel.club/files/dxvk/
So here is my almost-bisect-log:
r1938.af92bc9 — 19.1 r1939.35c7d68 — 19.1 → v0.96 r1948.c360a19 — 19.2 r1949.e5a06d3 — 17.8 → Initial performance regression introduced here: https://github.com/doitsujin/dxvk/commit/e5a06d3f4a103a54cd4eb51970fedee405d1d698 r1955.a437899 — 17.9 r1967.5ea8648 — 17.9 r1971.746562d — 17.8, dark → Dark rendering appears in 1968 - 1971 (https://github.com/doitsujin/dxvk/commit/7ed91872b60523e1ac6056b98b823240e712b5b0 https://github.com/doitsujin/dxvk/commit/9f8c1d08a68ca88f48b0e7af013f5e851a8fc9a9 https://github.com/doitsujin/dxvk/commit/fd445f7b4dce02617de194b2e338df36e0c752ef https://github.com/doitsujin/dxvk/commit/746562de5a606efbf09a267195dfa7175c7b3a7f) r1976.cbaeca8 — 17.9, dark r1980.be22756 — 17.8, dark r1983.20ea74f — 17.9, dark r1990.d12a8e0 — 17.6, dark r1991.6d814b2 — 17.6, dark r1995.e03b574 — 16.4, dark, jitter → Jitter starts between 1992 - 1995 (https://github.com/doitsujin/dxvk/commit/2231caaa9e0d5ec93652b990095cee421906959e https://github.com/doitsujin/dxvk/commit/a6d1fe07f2b4c2b596f586ccb875bf5ae68b7780 https://github.com/doitsujin/dxvk/commit/b6804a95b74d4ab8d7b0adab9ee128b06f25e55b https://github.com/doitsujin/dxvk/commit/e03b574cc14fa7333f1636e983f86b3ab9a2edcf) r2000.10140f4 — 16.4, dark, jitter → v1.0 r2001.7118685 — 16.7, dark, jitter r2007.d011102 — 16.6, dark, jitter r2011.a40d8d4 — 16.8, dark, jitter
There are three distinct regression points: FPS drop, Dark rendering, and jitter (with another performance regression). Each was quite easy to reproduce.
@doitsujin I hope this will help you somewhat?
It would be more helpful if you could pinpoint the exact commit which introduces the dark rendering, but that would require a working build environment. What trouble are you having setting it up? Thing is, this particular issue doesn't really make sense and only seems to affect Intel drivers.
The initial performance regression was introduced by an optimization which improves performance on AMD drivers and does not seem to affect Nvidia negatively. I do not plan to revert this change or add a second code path, ideally this should be fixed in the driver.
The jitter issue is most likely caused by e03b574cc14fa7333f1636e983f86b3ab9a2edcf, which reportedly improves frame time consistency on Nvidia and does not have any negative impact on AMD. Disabling this for Intel should be easy, but might not be desireable.
Thanks for the analysis Philip
The build env issue is bizzarre, its almost like when I changed the param to build a pthread MinGW64, the linker still thinks it is Win32 threads. But I verified that I followed the instructions, so, unsure what I actually did wrong. I'm open to building those three missing versions in a Docker image, which it seems that one can find instructions for on that site. I primarily just have a lack of time to get much done right now. So haven't tried that route yet.
I have a suspicion the dark rendering may be related the the gamma/brightness slider in the game. I moved it up near the max, to work around my non-ideal notebook monitor.
Will you have time to work with the ANV driver developers re the performance regression introduced by the optimisation? I'm sure you can provide much more insightful comments than me.
Re the jitter issue, it would also be useful to talk to an ANV dev?
Looks like 1.0 does indeed break gamma (for everyone), and I already know why. Unfortunately a proper fix is rather ugly to implement.
Hello doitsujin, I have an interesting observation - with Nvidia 418.43 and DXVK 1.0 DMC 5 is extremly dark but with 396.54 and again DXVK 1.0 it's just fine and there aren't gamma issues at all.
@mozo78 This is not a gamma issue, see #956. There's already a workaround for that in latest master
.
Yes I know but I just wanted to inform you for the driver role in this case too :)
It doesn't matter because it is completely unrelated to any of the issues discussed in this thread. Please post such comments to the appropriate threads.
Looks like 1.0 does indeed break gamma (for everyone), and I already know why. Unfortunately a proper fix is rather ugly to implement.
I hate those, when doing the simple thing is wrong, and the right thing unnecessarily complex. ∴ I'll await your instruction if you want me to do more testing for you.
I could confirm that at least e5a06d3 causes performance regression.
I tried to look into which and how shaders are affected by the change but I'm keep getting crash in driver in push constants code when replaying trace... And I don't have knowledge to make a guess about the performance regression without seeing the shaders. I'm trying to diff native code of the shaders with and without that commit but I always meet some unexpected obstacles....
I think you better file a bug against ANV since I'm not able to check it quickly.
What that commit does is change constant buffer loads as follows:
layout(binding = X)
uniform cb0_t {
vec4 m[...];
} cb0;
vec4 r0;
void main() {
...
// before
vec4 tmp = cb0.m[0];
r0.xy = tmp.xy;
// after
r0.xy = vec2(cb0.m[0].x, cb0.m[0].y);
...
}
This is useful on AMD drivers in cases where components of a single UBO elements are used in different scopes, since the compiler can combine multiple loads into one but not split one load into multiple loads.
I wrestled with some tooling and found that it is most likely due to the increased register spilling:
@jekstrand ^ any chance you could take a look at this?
@grigi can you test whether this build fixes your stutter issues in Witcher 3? dxvk-anv.tar.gz
This is useful on AMD drivers in cases where components of a single UBO elements are used in different scopes, since the compiler can combine multiple loads into one but not split one load into multiple loads.
Ugh... I've been meaning to write a UBO/SSBO load-combining pass for some time now but it hasn't happened. I guess we need to stick it on the list. @werman, how'd you like to write your first NIR optimization pass? Let's chat on IRC.
@jekstrand Yes, I could try, I already walked out of the office and would be able to chat only tomorrow.
Actually... I realized I already have the pass written and laying around in a branch. I wrote it earlier this week for something completely unrelated. I'll get it cleaned up and post it here after a bit.
Here's the pass and I have it wired up for ANV:
https://gitlab.freedesktop.org/jekstrand/mesa/commits/wip/nir-lower-array-of-vec
It's a bit annoying that driver and app have to be fighting over this but oh, well. I already had the pass written so it's not that hard to just tweak a few things and turn it on. @werman, could you please let me know if it helps.
@grigi can you test whether this build fixes your stutter issues in Witcher 3? dxvk-anv.tar.gz
I'll test it this afternoon.
fwiw 1.0.1 already includes that patch so you could try that as well. It should also fix your gamma issue.
@jekstrand Yes it helps, all spillings are gone.
I have similar issue with Final Fantasy XiV. Using dxvk up to 0.96 gives rock solid 60+ fps. When I switched to 1.0 and later 1.0.1 fps constantly kept changing between 35-60 and giving occasional performance issues. I'm using the latest nvidia vulkan drivers (arch).
@doitsujin The Jitter is vastly improved with 1.0.1 (and a 7-8% speedup) and the brightness/gamma issue has been resolved too :-) Thank you!
I had issue with 9.6 playing world of warcraft. Mini hangs I will call it. I starting having some other issues, and discovered there is an issue with amdgpu and linux kernel 4.19, I think I found it on the arch forum. So I looked and had the same kernel errors. I then built kernel 4.20 and installed it.(error in logs vanished) World of warcraft played flawlessly, totally awesome. That was about 12 hours ago nothing changed on this box except I updated to 1.0, and now the mini hangs are back and worse than before
I am running debian testing I just uninstalled 1.0 and reinstalled 9.6, everything works great again