protonscr

Poor performance in AVICII Invector (Unity 2019.2.10f1)

dxvkclosed d3d11performancecan't reproduce
doitsujin/dxvk#2293 · opened 2021-09-13 by adolfintel · updated 2021-09-24 · 20 comments · github
Aadolfintel 2021-09-13 github

The Unity game AVICII Invector runs very slow on DXVK, about 1/5th of the framerate that I get on WineD3D or natively on Windows.

With WineD3D the game is playable in 1080p, or even 1440p (on my miserable RX550) but on DXVK the performance is in the range of 10-30fps for 1080p and 5-20fps for 1440p and I can't figure out why, usually DXVK runs significantly better, especially with Unity games.

Rendering is correct, no instability in the game itself. WineD3D does not render the game correctly.

Software information

  • AVICII Invector, latest steam version
  • Manjaro 21 with Linux 5.14 kernel
  • Xorg
  • Tested with and without gamescope, ESYNC, DXVK_ASYNC, no difference

System information

  • GPU: AMD RX550
  • Driver: RADV POLARIS (Mesa 21.2.1)
  • Wine version: 6.16 (ge), 6.17-staging
  • DXVK version: both 1.9.1 and current master

Log files

Apitrace

https://downloads.fdossena.com/avicii.trace.tar.xz

Ddoitsujin maintainer 2021-09-13 github

Is your VRAM full by any chance? Your card only has 2GB which is the minimum requirement for the game on Windows, and DXVK can always do with a little more. That said, while replaying the trace it tops out at ~800 MB so it really shouldn't be an issue.

Not really seeing any obvious problem here, and protondb reports also don't complain about performance. Also please check whether you're GPU-bound or CPU-bound (DXVK_HUD=fps,gpuload).

Aadolfintel 2021-09-13 github

Nope, even at 1440p it doesn't even get to 1GB of usage, this is a very lightweight game.

It's 100% GPU bound, even at 640x480.

Anything else that I can try?

Ddoitsujin maintainer 2021-09-13 github

Note that background applications also eat VRAM.

It's 100% GPU bound, even at 640x480.

That kind of implies that something is taking a very slow data path though. There's no reason for this to happen (unless.... we're not talking about an external GPU, are we?)

On my end, even the trace replays at well over 100 FPS without the GPU breaking a sweat, so not sure what else it could be.

Aadolfintel 2021-09-13 github

Just to be sure I started Xorg without DE or any other application, it's not a VRAM issue, it runs the same. Besides, if it was insufficient VRAM wouldn't WineD3D be affected too?
The PC is a desktop, PCI-E x16, so it's not a bandwidth issue (unless it's the bandwidth between the GPU and the VRAM, which isn't great on this card).
I could try with my GTX1080 if you want, but it will probably brute force past this.

Are you aware of any "trick" specific to unity games that I may have overlooked? I'm kinda new to linux gaming but I'm a developer too so I can try anything that comes to your mind.

Aadolfintel 2021-09-16 github

A quick update on this.

As I suspected, I wasn't able to replicate the issue on either a GTX1080 or a 6900XT, they both have virtually identical performance compared to WineD3D. I also tried an R9 290X, getting lower performance with DXVK than WineD3D but still very playable. I cannot explain why this specific game hates the RX550 so much when other unity games, heavier ones, run way better.

The only thing out of the ordinary that I see is that WineD3D fakes the GPU ID and pretends to be an ATI Radeon HD5600 Series card. Faking the GPU ID and name with DXVK had no effect so I don't think that's the problem.

I should point out that the RX550 doesn't get hot at all despite DXVK claiming 100% GPU usage, which makes me thing of a GPU-VRAM bandwidth limitation. Is DXVK more bandwidth hungry than WineD3D?

KKron4ek 2021-09-17 github

Out of curiosity i just tried the game on RX 560 and it works good with DXVK (both 1.9.1 and current master), over 200 FPS most of the time at 1680x1050, WineD3D gives slightly better performance though. That's on Mesa 21.2.1 and linux 5.10. It's really weird that it works so badly on RX 550.

Aadolfintel 2021-09-17 github

@Kron4ek Very strange indeed. What's your wine version?

KKron4ek 2021-09-17 github

Wine-Staging 6.17, i also tried Proton 6.3-6 - the game performs pretty much identically in both cases. Also, your apitrace replays well for me.

Aadolfintel 2021-09-17 github

Just tested both from your builds, no change.
Would a trace taken from outside be useful? Capturing the vulkan calls generated by DXVK

KKron4ek 2021-09-17 github

I see we have different kernel versions, maybe there is a regression in 5.14? I doubt that, but who knows. You could try 5.10.

Aadolfintel 2021-09-17 github

No luck :(
I'll try to capture a vulkan trace and see if it reveals anything

Aadolfintel 2021-09-17 github

I captured a single frame using RenderDoc, it's here if it can be useful: https://downloads.fdossena.com/avicii.renderdoc.tar.xz

640mb seems quite a lot for a single frame, but I'm not familiar with RenderDoc so I don't know if that's normal.

KK0bin maintainer 2021-09-17 github

Is it a D3D11 or Vulkan Renderdoc capture?

Aadolfintel 2021-09-17 github

@K0bin Vulkan. There's a D3D11 capture in the original post

Ddoitsujin maintainer 2021-09-17 github

Vulkan captures are not portable, which means it's unlikely anyone will be able to open it unless they also have a Polaris GPU and the same driver.

Aadolfintel 2021-09-17 github

I just noticed some very odd behavior while capturing with RenderDoc.
Some times (1 in 5 or so), when the game is launched with renderdoccmd capture wine "AVICII Invector.exe", it runs properly, but not if I launch it directly.
I see no difference in the captures though, odd.

Aadolfintel 2021-09-17 github

I just tested the game with AMDVLK instead of RADV and it runs properly, so it may not be a DXVK bug.

OOschowa 2021-09-20 github

Can you try on RADV with this commit reverted https://gitlab.freedesktop.org/mesa/mesa/-/commit/4889cd7345ecbea4703ff15bd8b9409ae816f93c ?

edit: after reading the report properly, this probably won't help, but might as well try..

Aadolfintel 2021-09-20 github

@Oschowa no change

Aadolfintel 2021-09-24 github

I'm closing this, it was a VRAM bandwidth issue.

Proton versions

Launch options