protonscr

Total War: Troy - Significantly lower performance with DXVK

dxvkopen d3d11performance
doitsujin/dxvk#4273 · opened 2024-09-18 by ms178 · updated 2025-01-17 · 18 comments · github
1 matching comments, n / p to jump
Mms178 2024-09-18 github

I use this game extensively for benchmarking on Windows and Linux. I've always wondered why the Linux performance showed significantly less performance than the Windows DX11 native version (around 20% and more, depending on which of the three benchmark scenes gets chosen).

To rule out differences in the driver stack or a Kernel issue, I've tested the same DXVK DLL that I use on Linux with Windows and the official AMD Windows driver stack and that revealed that this is not RADV-related or a Linux Kernel issue but due to using DXVK as the performance went down to the same levels as seen on Linux with that machine. I cannot tell if the seen performance delta is expected due to the overhead DXVK comes with or if it points to a defect in DXVK. This issue is meant to make you aware of that high performance delta.

Software information

Total War: Troy, 1440p, Ultra

System information

  • CPU: Intel 14700KF
  • GPU: AMD Radeon 6950 XT
  • Driver: Mesa-git (Linux) and 32.0.12011.1031 (Windows)
  • Proton version: Proton-CachyOS from 2024-08-31
  • DXVK version: 2.4 release version from this Github repo and a self-compiled 2.3 with Clang 18/PGO
  • Windows version: 26100.1742
  • Linux Kernel version: 6.10.8
Mms178 2024-09-18 github

To give you a specific example, with the mentioned settings, we are talking about a difference from 150 fps avg (DXVK) vs 186 fps avg (Windows native) in the first benchmark scene.

Qqinlili23333 2024-10-06 github

image
DX11 native
image
DXVK 813524c146327d8569f2f06efdb82678ed137428

RTX4080Laptop Win11 23H2, 4k with everything max
performance difference is really small on my test

no idea of why

Mms178 2024-10-06 github

This could be due to your Nvidia GPU. I've re-tested it with DXVK 2.4.1 on Windows 11 - Scene 2 this time and could still reproduce significant differences:

With DXVK:
Scene2_W11_DXVK241

Without DXVK:
Scene2_W11_NODXVK

Qqinlili23333 2024-10-07 github

image
image
When I test again this morning, I can also reproduce this performance issue.
Seems in native dx11, game is in independent flip, but with DXVK it's copy with GDI. The DWM copy cost may be the reason of performance impact.
This can describe why under windows dx11 is better than DXVK. But cannot describe why under Linux the performance is still impacted.

I tested some other games with DXVK, they can enter legacy flip in fullscreen.

Qqinlili23333 2024-10-07 github

The game seems cannot be traced with apitrace. Put d3d11.dll, dxgi.dll, dxgitrace.dll in game folder, game cannot launch.
Desktop.zip
trace file really small, and only thousands of createdevice call.

Ddoitsujin maintainer 2024-10-07 github

Unless d3d11.cachedDynamicResources=a somehow improves perf here I don't think this is worth looking into, we're not magically going pull 25% performance out of our arse.

Seems in native dx11, game is in independent flip, but with DXVK it's copy with GDI. The DWM copy cost may be the reason of performance impact.

This is a Vulkan limitation on Windows, we can't really do anything about that short of changing our swap chain to D3D12.

Mms178 2024-10-07 github

Unless d3d11.cachedDynamicResources=a somehow improves perf here I don't think this is worth looking into, we're not magically going pull 25% performance out of our arse.

Seems in native dx11, game is in independent flip, but with DXVK it's copy with GDI. The DWM copy cost may be the reason of performance impact.

This is a Vulkan limitation on Windows, we can't really do anything about that short of changing our swap chain to D3D12.

Note that I've observed the performance delta also on Linux with DXVK and RADV.

Ddoitsujin maintainer 2024-10-07 github

Yes, I'm saying that GDI present is normal on Windows and not going to be the main reason why there is a difference.

I am however saying that it's not reasonable to expect us to compete with native drivers in every game. AMD's D3D11 driver for RDNA onwards is significantly better than the old one was.

Qqinlili23333 2024-10-08 github

This is a Vulkan limitation on Windows, we can't really do anything about that short of changing our swap chain to D3D12.

Yes but I'm still curious about the feature of NVIDIA driver, it can put Vulkan on DXGI swapchain.
image
I tested a native Vulkan game (Rage 2).
image
When choose "Prefer layered on DXGI Swapchain", game enter flip model on DXGI swapchain.
image
When choose "Prefer native", game enter GDI Copy on a pure Vulkan surface.

However, this option seems useless for DXVK. Game with DXVK is in GDI Copy even I set "Prefer layered on DXGI Swapchain" in NVIDIA control panel.
Is there some difference between DXVK and native Vulkan for NVIDIA driver to process it?

Mmbriar 2024-10-08 github

Dgxi swapchain doesn't work for dxvk because dxvk implements dxgi itself, so you would get circular loading. IIRC this was even causing dxvk to straight up not load in the past, so i wouldn't be surprised if nvidia blacklists this feature when the driver detects dxvk.

Qqinlili23333 2024-10-08 github

so i wouldn't be surprised if nvidia blacklists this feature when the driver detects dxvk.

Searched NVIDIA driver sting, found DXVK in strings, seems that's the reason. Thanks.
image

BBlisto91 2024-11-13 github

@ms178 Could you give this a swing again with dxvk 2.5?
A performance issue that hit Total War Warhammer 3 is handled better now. Since the games share somewhat the same engine it is possible it could benefit Troy too.

Mms178 2024-11-13 github

@Blisto91 Thank you for letting me know, I've added this to my to-do list but as I am not on Linux at the moment, it might take some weeks or months. My 6950 XT also died recently and the Vega 64 was showing a less significant performance delta with the dxvk version used for the original report.

Mms178 2024-11-13 github

@Blisto91 I've tested the new version under Windows with the AMD 24.9.1 driver (most recent for Vega), I haven't seen too much of an improvement. Scene 1: 80 fps avg (Windows/dxvk 2.5) vs 85 fps avg (Windows/native) on 1080p/Ultra. The DXVK result is in line with what I've gotten with an older DXVK version before.

BBlisto91 2024-11-13 github

Does running with d3d11.cachedDynamicResources=a in a dxvk config improve it?

Mms178 2024-11-14 github

Does running with d3d11.cachedDynamicResources=a in a dxvk config improve it?

Quite the opposite, using that parameter tanks performance even further to 61 fps avg.

LLeopard1907 2025-01-17 github

https://youtu.be/kmYM78AesJc?si=cHLiSvPewipw6e-G

It seems that engine is problematic with DXVK.

7:47 in that video shows perf gap. Pretty much like this one.

Image

Ddoitsujin maintainer 2025-01-17 github

FWIW if this is anything like Warhammer III then yeah it just won't run particularly well, these games do things that are just inherently inefficient and we're already having a hard time getting double-digit frame rates at all. I don't see much room for improvement on our end here.

DLLs