dxvk icon indicating copy to clipboard operation
dxvk copied to clipboard

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

Open MrEWhite opened this issue 2 years ago • 7 comments

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

  • GPU: Nvidia RTX 3090
  • Driver: 516.79
  • DXVK version: v1.10.2
  • Windows 11 Pro

Log files

GTAIV_d3d9.log

MrEWhite avatar Jul 25 '22 20:07 MrEWhite

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.

K0bin avatar Jul 25 '22 21:07 K0bin

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.

MrEWhite avatar Jul 25 '22 21:07 MrEWhite

Does it also occur on Linux?

Evernow avatar Aug 01 '22 19:08 Evernow

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

DaveACG avatar Sep 09 '22 07:09 DaveACG

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

Did you observe this on Linux?

Evernow avatar Sep 09 '22 14:09 Evernow

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. :)

DaveACG avatar Sep 09 '22 18:09 DaveACG

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.

MrEWhite avatar Sep 09 '22 21:09 MrEWhite

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

FNsi avatar Jul 02 '23 00:07 FNsi

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.

netborg-afps avatar Jul 02 '23 20:07 netborg-afps

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...

FNsi avatar Jul 03 '23 01:07 FNsi

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.

netborg-afps avatar Jul 03 '23 20:07 netborg-afps

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...

FNsi avatar Jul 03 '23 23:07 FNsi

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

mirh avatar Jul 04 '23 23:07 mirh

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.

netborg-afps avatar Jul 05 '23 12:07 netborg-afps

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...

FNsi avatar Jul 05 '23 12:07 FNsi

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.

netborg-afps avatar Jul 05 '23 12:07 netborg-afps

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?

FNsi avatar Jul 05 '23 12:07 FNsi

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.

netborg-afps avatar Jul 05 '23 12:07 netborg-afps

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😅

FNsi avatar Jul 05 '23 12:07 FNsi

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

K0bin avatar Jul 05 '23 12:07 K0bin

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.

FNsi avatar Jul 05 '23 12:07 FNsi

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.

netborg-afps avatar Jul 05 '23 13:07 netborg-afps

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.

MrEWhite avatar Jul 05 '23 17:07 MrEWhite

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.

FNsi avatar Jul 14 '23 03:07 FNsi