doitsujin / dxvk

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

GTA IV Frame skipping / jumping lag #1419

Closed NikoBellicRU closed 4 years ago

NikoBellicRU commented 4 years ago

I dont know if you can see this in the video but you can clearly see it in the frametime graph. https://www.youtube.com/watch?v=clxQTkD14y0&feature=youtu.be

Also for some reason there's a bug with gta4Browser.exe that its constantly using 25% of the cpu and really drops performance without stoping it or kill it soon as i enter the game, not sure if its wine/proton problem tho.

steam-12210.log GTAIV_d3d9.log LaunchGTAIV_d3d9.log

doitsujin commented 4 years ago

Low performance is expected on weak hardware, especially if your CPU is slow. There's probably no bug here.

That said, the number of queue submissions seems high, but to look into that we'd need an apitrace as requested by the issue template.

NikoBellicRU commented 4 years ago

Where is that file and whats the name? Also i played this game with d9vk before it was merged with dxvk a while ago and it waas working great i played with all very high settings and now with medium settings that wierd lag happends

telans commented 4 years ago

I encountered this a few days ago, but didn't think this was DXVK's issue as I also have this issue in Modern Warfare Remastered.

I don't think specs are the issue here, I have an i7-4770 & 980 Ti (not the best, but good enough for GTA IV)

I'll try get an apitrace of it.

Iglu47 commented 4 years ago

@NikoBellicRU use this instruction for dx9 games https://github.com/Joshua-Ashton/d9vk/wiki/Making-a-Trace#on-linux

instead editing setting via winecfg try use environment variable through set launch option... for steam games, example WINEDLLOVERRIDES="d3d9,d3d11,d3d10,d3d10core,d3d10_1,dxgi=n,b" DXVK_HUD=full %command%

NikoBellicRU commented 4 years ago

https://drive.google.com/file/d/1RDlcqGlgY2yCfETqUI6YoFlpTJDFd9ML/view?usp=sharing https://drive.google.com/file/d/17h4ugjTxXDnDvhBDWCmlA1-aHKDnIivO/view?usp=sharing

ViNi-Arco commented 4 years ago

Hello @NikoBellicRU , very strange that you can't get a good fps in GTA IV with a higher GPU, I can get between 50~60 FPS on an E8400:

Click here

![oie_IozPoCp5ShvB](https://user-images.githubusercontent.com/57958460/86496483-09f25380-bd54-11ea-9f59-20d8799fe6ac.png) ![oie_K8cvPfaKxKfR](https://user-images.githubusercontent.com/57958460/86496486-0ced4400-bd54-11ea-9b29-0c86011f5909.png) You can try to disable `gta4Browser.exe`: ![gta4winecfg](https://user-images.githubusercontent.com/57958460/80440312-e687d400-88de-11ea-957c-676411138cd8.png) And use `__GL_THREADED_OPTIMIZATIONS` in `Environment Variables` in Lutris. You can try ThirteenAG's FusionFix and XLivelessAddon: https://github.com/ThirteenAG/GTAIV.EFLC.FusionFix https://bitbucket.org/ThirteenAG/xlivelessaddon/downloads/XLivelessAddon.zip with ThirteenAG's XLiveless I am able to run directly from GTAIV.exe with a higher performance, I have the GTAIV DVD which may be why I have the best performance too

HughJass commented 4 years ago

I also get micro stutters on the steam version, but the redacted version from redacted works fine, overall perfomance is better by about 10 frames. My rig is: Ryzen 5 2600 RX 590 Mesa 20.1-git DXVK various versions, from 1.4.0 to 1.6.0 DXVK also works better than Gallium9 for me

valgusk commented 4 years ago

apitrace steam system info run with default proton 5.0.5 I recorded it on minimal settings to reduce file size, and without using DXVK, as was recommended in post linked by @Iglu47, but if I launch this same slice with default DXVK settings, it has heavy framegraph spikes. This can be heavily reduced by setting maxFrameLatency=1, but it does not fix it completely. Another thing I noticed is that comparing to Wine D3D implementation:

UPDATE: I tried to figure out which version introduced low fps and stuttering and it seems to be something between D9VK-0.30(Froglet) and D9VK-0.40(Croakacola). Froglet is the last version with good performance (where newer versions have 30fps, this one had 70), but I did not try the rc versions inbetween, ended up playing instead of experimenting.

NikoBellicRU commented 4 years ago

Dude nice one that fixed 99% of that problem but when Vsync is ON the problem is still there and kinda worse so aparently this " d3d9.presentInterval = 0 " fixed the game with Vsync ON and this " d3d9.maxFrameLatency = 1 " fixed with it OFF , now the game plays very well some times it has that lag but its like for 1-2 seconds and really not that often, also that happends even on windows sometimes so i guess probably its not fully fixable cause as we know this was a bad port. . .

doitsujin can you check it and merge to next build?

bno1 commented 4 years ago

aparently this " d3d9.presentInterval = 0 " fixed the game with Vsync ON

d3d9.presentInterval = 0 forces Vsync off

NikoBellicRU commented 4 years ago

I tried 1 and 2 both with bad performance so maybe 0 its not the solution for vsync but well at least now the game is playable with it off

NikoBellicRU commented 4 years ago

Ok now i can confirm that this is not only on nvidia, i just upgrated to a rx 570 and still having the same problem either on medium/high or very high settings and im getting like 90fps. The only fix for now is really using this " d3d9.maxFrameLatency = 1 " on dxvk.conf

ArturWroblewski commented 4 years ago

The problem still exists.

Tested on: Ryzen 1700 RAM 32GB Nvidia GTX 1650 4GB See it in the frametime graph on Video:

Grand Theft Auto IV https://youtu.be/GR1NpdFnfZE

Grand Theft Auto The Lost and Damned https://youtu.be/FtghGB0mTKU

Tip for other users: To play comfortably, use the command, PROTON_USE_WINED3D=1 %command% but it limits the fps to 30 or less. The simplest option until the problem with DXVK is not fixed.

K0bin commented 4 years ago

In your video it looks like the frame time spikes are caused by shader compilation. This can't be fixed.

NikoBellicRU commented 4 years ago

In your video it looks like the frame time spikes are caused by shader compilation. This can't be fixed.

I dont think that is the problem, as mencioned this " d3d9.maxFrameLatency = 1 " fixes most of the problem and also when i use frame limit in this game that doesnt happed but soon as it goes under the capped framerate it starts again.

ViNi-Arco commented 4 years ago

@NikoBellicRU Have you tried to disable Vsync in the game instead of using d3d9.presentInterval=0, I tried to use d3d9.maxFrameLatency=1 here and it got really bad, leaving the game default is smooth for me, I could see that there are more people getting along with d3d9.maxFrameLatency=1 for example here: https://www.reddit.com/r/pcgaming/comments/gsn6w8/dxvk_works_magic_on_gta_iv/ I think it's best to leave it as an option for the user to choose as it is

NikoBellicRU commented 4 years ago

Since i installed mesa ACO ppa it got better but it not fully fixed, also i been using that command for a while now cause it was the only way to not get bad performance, its wierd that you had bad experience with it but what i really think its wierd is that this never been a problem for me on wined3d, i just dont get this

WinterSnowfall commented 4 years ago

but what i really think its wierd is that this never been a problem for me on wined3d, i just dont get this

OpenGL (what wined3d is currently using) and Vulkan (what dxvk is using) are fundamentally different, so are their issues and quirks and also how well they work on certain hardware configurations. Issues are not always caused by something someone can fix or optimize on a global level.

If wined3d works just fine for you, why are you not using it? Don't get me wrong, I'd also like to live in a world where we can use a single wrapper to get the best performance out of everything in all cases, but for many reasons I don't think that's remotely feasible.

rafalb8 commented 4 years ago

Limiting FPS to 30 with MangoHud helped with stuttering on DXVK MANGOHUD_CONFIG=fps_limit=30

K0bin commented 4 years ago

PR 1714 should fix the problem.

NikoBellicRU commented 4 years ago

Awesome the game is really good now :) Thanks!

dstrnad commented 4 weeks ago

I’m experiencing the same issue with heavy frame time spikes when running GTA 4 as a non-Steam game using Proton Experimental. FPS is good otherwise. Could you let me know what the final solution is? Is it the command d3d9.maxFrameLatency=1, and where should I put the command? Thanks in advance!

K0bin commented 4 weeks ago

It's almost certainly not the same issue. Please open a new issue and provide logs and an apitrace. (And ideally a video too)