doitsujin / dxvk

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

Input Lag in Grand Theft Auto IV / Episodes from Liberty City #2755

Open MrEWhite opened 2 years ago

MrEWhite commented 2 years ago

If I use DXVK on GTA IV, I get input latency that doesn't occur when running the game without it. It happens if I use v-sync or not, so I have no clue what the issue could be here. Happens with any mixture of settings/resolution/frame rate, and happens with dxgi.maxFrameLatency & d3d9.maxFrameLatency set to 1.

It's not an unbearable amount of input lag, but it's most definitely noticeable when compared to running the game without DXVK.

Software information

Disc version of Grand Theft Auto IV on Patch 1.0.8.0

System information

Log files

GTAIV_d3d9.log

K0bin commented 2 years ago

I can't really tell you anything except that it feels perfectly fine on my system.

Make sure you don't have any Vulkan layers like overlays or recording tools installed. Those could mess things up.

MrEWhite commented 2 years ago

I can't really tell you anything except that it feels perfectly fine on my system.

Make sure you don't have any Vulkan layers like overlays or recording tools installed. Those could mess things up.

I don't have anything like that installed.

Evernow commented 2 years ago

Does it also occur on Linux?

DaveACG commented 2 years ago

Can second this. DXVK produces a significant amount of input lag compared to DX9 in GTA IV.

Evernow commented 2 years ago

Can second this. DXVK produces a significant amount of input lag compared to DX9 in GTA IV.

Did you observe this on Linux?

DaveACG commented 2 years ago

Can second this. DXVK produces a significant amount of input lag compared to DX9 in GTA IV.

Did you observe this on Linux?

Whoops no, Windows. My error, forgot that dxvk on Windows is more of an 'off label' usage of it. :)

MrEWhite commented 2 years ago

Does it also occur on Linux?

Sorry I forgot to reply to this, but I don't have a Linux install, so I couldn't test it.

FNsi commented 1 year ago

I have a strong input lag in fallout4/ Skyrim in linux...

netborg-afps commented 1 year ago

I have a strong input lag in fallout4/ Skyrim in linux...

Do you have v-sync enabled? Which causes a few frames to get rendered ahead if the cpu is faster than the gpu/v-sync limit. You should definitely try setting dxgi.maxFrameLatency & d3d9.maxFrameLatency to 1, default is 3.

FNsi commented 1 year ago

You should definitely try setting dxgi.maxFrameLatency & d3d9.maxFrameLatency to 1, default is 3.

How can I set dxvk.conf in heroic game launcher? It's not working by putting dxvk.conf to the game fold, either the system32/wow64...

netborg-afps commented 1 year ago

You should definitely try setting dxgi.maxFrameLatency & d3d9.maxFrameLatency to 1, default is 3.

How can I set dxvk.conf in heroic game launcher? It's not working by putting dxvk.conf to the game fold, either the system32/wow64...

I only got one game to test there, but it was working out to put the dxvk.conf into the folder where the game exe is. Alternatively you can set the environment variable DXVK_CONFIG_FILE=/xxx/dxvk.conf in the Heroic launcher settings. Using DXVK_LOG_LEVEL=info and DXVK_LOG_PATH=/some/directory might help to see if it's loading the config.

Also I just found out that you probably want newest graphics driver and bleeding edge dxvk, the latency control was added after v.2.2.

FNsi commented 1 year ago

Also I just found out that you probably want newest graphics driver and bleeding edge dxvk, the latency control was added after v.2.2.

That only happens in Bethesda games, I have no clue for it...

mirh commented 1 year ago

What if you tinker with dxgi.numBackBuffers & d3d9.numBackBuffers?

netborg-afps commented 1 year ago

What if you tinker with dxgi.numBackBuffers & d3d9.numBackBuffers?

I have been measuring this, it's not doing much anymore, at least after the recent addition of latency objects.

But I would assume, the Bethesda games might use internal buffering on top. Have never played the games you mentioned, but in Quake Champions, this seems also to be the case, one (or two?) extra frame(s) of latency cause of the engine (I have measured this in Windows), maybe cause they have GPU memory transfer somewhere, or what do I know.

In case this would be an engine-thing, the only thing that helps reducing latency, is to up the frame rate.

FNsi commented 1 year ago

Thanks for help! More information might concern: 1.the mouse is working well without input latency...

2.in windows all good.

3.I am using igpu. (Amd 680m) which could run the ultra settings in 2k/27~40fps in windows.

4.I didn't test the buffer setting yet, but I will.

5.interval setting is not working.

I think the problem is the memory transferring...

netborg-afps commented 1 year ago

Like I said, you probably want to get a bleeding-edge dxvk, possibly proton-GE-8-10 or compile it yourself. Also newest graphics drivers? Then setting dxgi.maxFrameLatency & d3d9.maxFrameLatency to 1 should do wonders.

iGPU should not have any issues with memory transfer?! I just thought maybe their engines would put a "pipeline-step" in there to account for such things.

FNsi commented 1 year ago

iGPU should not have any issues with memory transfer?! I just thought maybe their engines would put a "pipeline-step" in there to account for such things.

I mean, there must be multi copies in that special case, I am using wine-ge-proton8-8, also wine 8.0, lutris-ge-proton8-7, none of those working fine in both games.

But obviously what I mentioned does not happened in windows, with or without dxvk, they are working fine to play around even with tons of mods.

Or it's amd driver problem if intel igpu working fine in Linux?

netborg-afps commented 1 year ago

Hmm, I'm still a bit new to this, but wine-ge-proton doesn't include dxvk? You need a newest dxvk (2.2 is too old for this to work).

I've been invested a bit into this latency topic. From what I gathered, on Windows drivers reduce latency while they won't on linux?! (I have nvidia) But you can improve latency like discussed above.

FNsi commented 1 year ago

I've been invested a bit into this latency topic. From what I gathered, on Windows drivers reduce latency while they won't on linux?! (I have nvidia) But you can improve latency like discussed above.

yep I am using 2.2 dxvk. No much clue😅

K0bin commented 1 year ago

FYI Skyrim and Fallout 4 don't use DXGI waitable objects, so I'm not sure whether new DXVK versions make any difference there.

FNsi commented 1 year ago

FYI Skyrim and Fallout 4 don't use DXGI waitable objects, so I'm not sure whether new DXVK versions make any difference there.

That proofed what I said...

But obviously what I mentioned does not happened in windows, with or without dxvk, they are working fine to play around even with tons of mods.

netborg-afps commented 1 year ago

You can compile newest dxvk from master, or look where you can find it precompiled. I am sure this helps if you are using v-sync, even when the game doesn't use waitable objects. For non-v-sync I have not tested yet.

MrEWhite commented 1 year ago

GTA IV certainly feels a bit better with the latest DXVK from the master branch (from actions). Not better than native mind you, but less latency.

FNsi commented 1 year ago

Guys today I did increase my igpu vram to 8g, the lag is nearly disappeared. I have a wide guess: it's due to the copies from ram to vram. Which shouldn't happen in igpu.