doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
12.78k stars 823 forks source link

Days Gone 2-3 FPS #2065

Open dreamhunt opened 3 years ago

dreamhunt commented 3 years ago

Hello, I get just 2-3 FPS with this game. It starts normally but as soon as it reaches the main menu and it slows down to 2-3 FPS. I tried to start a new game but I experience the same and it's not just in the main menu. I tried different Wine/Proton/ProtonGE versions and video drivers to no avail. I tried to get an apitrace but the game freezes at start. I installed Windows but it seems I can't get an apitrace even on this sh*t. I think it's a DXVK version for I tied the game with DXVK on Windows and I experience exactly the same 2-3 FPS problem. Without DXVK it's running just fine.

Software information

Name of the game, settings used etc.

System information

Log files

dreamhunt commented 3 years ago

What dll files?

dreamhunt commented 3 years ago

You don't have to replace anything for they are not there. Just put them in the game's exe folder. Look at the DXVK wiki and don't ruin my thread please.

K0bin commented 3 years ago

I tried to get an apitrace but the game freezes at start.

Are you sure it doesn't just take long? Apitrace can make things VERY slow. Waiting a few minutes for a game to load something can certainly happen.

dreamhunt commented 3 years ago

Yes, I know apitrace can make things very slow. I provided a lot apitraces but this indeed freezes the game.

doitsujin commented 3 years ago

Can you try perf top or something to see where it's spending all that time? 2-3 FPS can't just be some random dxvk slowness, the game has to do something really really really dumb for that to happen (probably DXGI related again).

Also, set DXVK_HUD=full and check if there's anything unusual going on.

dreamhunt commented 3 years ago

Yep, the GPU is extremely low utilized: https://i.imgur.com/eaSWhbE.png This is a peak, it sits around 2-3%. Here you are a perf top log: perf.log

Oschowa commented 3 years ago

The perf top output might be more useful if you limit it to the game process with i.e. perf top -s comm,dso,symbol -p $(pgrep gamename.exe) and use a dxvk build that is not stripped. You can use this build of dxvk master if you don't want to build one yourself: https://drive.google.com/file/d/1LqPoQO5Omz_4z92s8Hmmof5ZZ_y_ShkL/view?usp=sharing

dreamhunt commented 3 years ago

Thank you, here is the new log :) perf.log

doitsujin commented 3 years ago

looking at all the memset/memcpy spam there, does d3d11.apitraceMode = True help? (dxvk.conf, see wiki)

dreamhunt commented 3 years ago

I'm at work now but when I get home I'll try it ASAP. Thank you very much for your attention!

ZereoX commented 3 years ago

I've confirmed that d3d11.apitraceMode = True does not resolve or attenuate any of the performance issues encountered.

I've also recorded an APITrace which can be found here: https://drive.google.com/file/d/1vScjsJ6Ml9IHH9yES_Kva8VtKS8bCJLu/view?usp=sharing

dreamhunt commented 3 years ago

That's great, thanks. I can confirm d3d11.apitraceMode = True doesn't help on my end either.

doitsujin commented 3 years ago

Looking at the trace, it doesn't really do anything special, and in fact it replays at ~27 FPS here once it reaches the menu, indicating that the problem is somewhere in the game code rather than DXVK.

Could try vendor ID overrides or something, but not really sure what to do here since we don't seem to be doing anything wrong.

dreamhunt commented 3 years ago

But it's strange the problem, also exists on Windows with DXVK.

dreamhunt commented 3 years ago

I tried: dxgi.customDeviceId = 10de dxgi.customVendorId = 1c06 dxgi.customDeviceId = e366 dxgi.customVendorId = 1002 and: allowMapFlagNoWait But nothing helps.

Ryusennin commented 3 years ago

Out of curiosity, I tried on Win10 and Win7 (because why not) and it does the exact same thing on both systems. The title screen with the motorbike is crawling at 2 fps, although the CPU and GPU barely reach 2%.

Joshua-Ashton commented 3 years ago

Would you be able to see if https://github.com/doitsujin/dxvk/commit/eac94823c82b77530ea2991c83f05dc81711c3e5 has any impact on the game's perf? Artifacts should be available here. https://github.com/doitsujin/dxvk/runs/2630514955

@ZereoX @dreamhunt

gofman commented 3 years ago

I justed debugged the game and yes, it needs GetFrameStatistics and GetLastPresentCount to return some about correct values (I didn't try with the referenced commit though yet, used my own WIP debug changes to check).

dreamhunt commented 3 years ago

@Joshua-Ashton, thanks but I really don't know how to use this. I can compile DXVK, I can apply patches but I don't know how to use this commit to apply it to the source in order to compile it :(

gofman commented 3 years ago

I guess SyncRefreshCount should not be the same as PresentCount, the SyncRefreshCount counts vblanks, not presents. Not sure yet what exactly is critical for the game. In my local debug stuff I just count vblanks as (QPC / vblank_interval_in_qpc_units) and SyncQPCTime as vblanks * vblank_interval_in_qpc_units

dreamhunt commented 3 years ago

Can you give me the dlls with this commit to try it or explain to me how to get the changes in order to compile them?

Joshua-Ashton commented 3 years ago

I linked a build in my message.

dreamhunt commented 3 years ago

Unfortunately it doesn't help: Screenshot_20210520_173824

ZereoX commented 3 years ago

@Joshua-Ashton Same results using the build artifacts linked above.

Edit: This was ran with DXVK's DXGI on Proton 6.3-4. I've also confirmed the same result is also observed on Windows.

Joshua-Ashton commented 3 years ago

You'll need to set WINEDLLOVERRIDES=dxgi=n, sorry I did not mention that.

I will also get the game and test it myself.

gofman commented 3 years ago

@Joshua-Ashton For reference, here is the patch on top of Proton's dxgi which help here (100+ fps on menu). 0001-dxgi-Return-some-sensible-values-from-proxy_swapchai.txt

dreamhunt commented 3 years ago

You'll need to set WINEDLLOVERRIDES=dxgi=n, sorry I did not mention that.

I will also get the game and test it myself.

Yes, it's set to native :)

@Joshua-Ashton For reference, here is the patch on top of Proton's dxgi which help here (100+ fps on menu). 0001-dxgi-Return-some-sensible-values-from-proxy_swapchai.txt

Can you give me this dxgi? Or can I apply the patch to DXVK's source and should it work? Edit: Hmm, tried and it seems it can't be applied. can't find file to patch at input line 15 Perhaps you used the wrong -p or --strip option?

Joshua-Ashton commented 3 years ago

Will look at this again later today once I finish rehearsals for a show I am in :)

Kron4ek commented 3 years ago

@gofman Thank you, this patch indeed solves the performance problem in this game.

danielhurt commented 3 years ago

No idea how to apply this patch. Thank you for coming up with a solution though.

AntonioR-dev commented 3 years ago

Could someone link patched files? I'm here because of the same issue but i don't understand how to patch

Kron4ek commented 3 years ago

Patched dxgi for Proton 6.3-4. Extract and replace dxgi.dll.so (but first back it up) in steamapps/common/Proton 6.3/dist/lib64/wine.

And remove WINEDLLOVERRIDES=dxgi=n from the game Launch Options, if it's present there.

dxgi.dll.so.zip

AntonioR-dev commented 3 years ago

Any option for windows? I am ad amd gpu user and I would like to use dxvk instead of dx11 to get better performance

dreamhunt commented 3 years ago

Then use Linux ;) Thank you, Kron4ek, working great!

danielhurt commented 3 years ago

Then use Linux ;) Thank you, Kron4ek!

Thanks, worked for me.

PlayX83 commented 3 years ago

it seems there is a little bug with the patch. if I set vsync to 60 the cap is 30, if I set it to 30 the cap is 15

doitsujin commented 3 years ago

Can you test https://github.com/doitsujin/dxvk/tree/dxgi-memes ?

dreamhunt commented 3 years ago

Yes! And it's working much faster than dxgi.dll.so. With your build the game is running over 240 FPS and with the patched dxgi.dll.so ~75-80!

dreamhunt commented 3 years ago

Opps, the performance difference is due Wine versions. With Proton 6.3-4 and the newest Wine versions it's slow but with Wine-Staging-Tkg 5.15 it flies! Anyway, your build is working great. Thank you!

danielhurt commented 3 years ago

Any fixes for Windows?

DadSchoorse commented 3 years ago

the branch should work on windows

AntonioR-dev commented 3 years ago

the branch should work on windows

Could you please add some guide to compile dlls on windows or maybe add the compiled dlls? I’mnot that practical with this stuff, i just wanted to play days gone with amd gpu :)

Joshua-Ashton commented 3 years ago

There are builds for every commit if you click the checkmark for it.

DadSchoorse commented 3 years ago

or if you want the direct link: https://github.com/doitsujin/dxvk/suites/2793793675/artifacts/62048006

danielhurt commented 3 years ago

What I was looking for, thanks.

Doyyyy commented 3 years ago

or if you want the direct link: https://github.com/doitsujin/dxvk/suites/2793793675/artifacts/62048006

Did this and allthough my fps are way better now in all areas, they immediately drop down to 10-20 every few seconds as soon as I start moving. Makes the game unplayable for me

dreamhunt commented 3 years ago

I tried Proton and Wine and I don't have such problem. The game is running very well.

K0bin commented 3 years ago

@Doyyyy Are you sure what you're seeing isn't just shader compilation stutter? In that case it should get better as you keep playing.

Doyyyy commented 3 years ago

Oh yeah that could be it. I'll test that.

AntonioR-dev commented 3 years ago

I am testing this on windows and so far I can tell that everything is fine except for the fact that the game now does not recognize HDR monitor. I don't know if this is an issue or it is normal behaviour