doitsujin / dxvk

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

Memory leak with Nvidia Ansel #3432

Open SirSAC opened 1 year ago

SirSAC commented 1 year ago

On native (D3D11) works just fine with 30-40 FPS average but with DXVK it tries to load but then becomes and stays stuck (screenshot below), no Windows freeze and rest of the system functionality works fine.

Software information

"ffxv.exe" Final Fantasy XV Windows Edition Benchmark Everything on "Off" and at "Low" image

System information

Apitrace file(s)

I don't know on Windows how without installing another program.

Log files

ffxv_d3d11.log (https://tempfile.io/en/7ce4c4Qft370UNJ/file) ffxv_dxgi.log (https://tempfile.io/en/szViktJyXa1VDOX/file)

Blisto91 commented 1 year ago

I'm not exactly sure i'm reading the stats correctly but i think you might be running out of vram and or memory?

If you have already followed https://github.com/doitsujin/dxvk/wiki/Windows you could also try making a file called dxvk.conf next to where the log files generated and insert dxgi.nvapiHack = False. Tho i don't actually think this will do anything. It seems to run fine on my AMD system on Linux.

K0bin commented 1 year ago

I don't know on Windows how without installing another program.

We have a guide on how to use apitrace: https://github.com/doitsujin/dxvk/wiki/Using-Apitrace

doitsujin commented 1 year ago

I don't really understand what your problem is but the game itself works fine with DXVK.

Blisto91 commented 1 year ago

With dxgi.nvapiHack = False is loading but then crashes without any message why.

What do you mean. That it gets further?

Someone know the option for swapchain

I'm not sure what you mean. There's a option in the Nvidia control panel where you can switch Vulkan present method

Blisto91 commented 1 year ago

I believe that it works on Windows without dxvk. In your first screenshot your memory usage shows higher (at the border even) then your new one. Can't say exactly if that is why it is crashing, but looks suspicious to my eye.

I tried on Windows now and haven't encountered any issues. More vram is used with dxvk, but i expected that. I'm not seeing any indication of a leak as vram stays fairly stable once you are in and regular memory only rises at a similar pace to native d3d11

Note that i am using the 1.3 version of the bench as i dunno where you get the 1.2 Screenshot 2023-05-19 182116 Screenshot 2023-05-19 182241

Edit: telling the game I'm on Nvidia doesn't seem to change anything (on Linux at least) so i don't think any Nvapi or amd ags issues is going on

Redundanz commented 1 year ago

Proof that it runs extraordinarily well on Windows with DXVK.

image

Now go fix your tampered with "super optimized" Frankenstein system.

Blisto91 commented 1 year ago

Now go fix your tampered with "super optimized" Frankenstein system.

I don't know if it was intended that way but your wording comes off as a bit agressive, similar to your earlier comment. If it is then please refrain from that as it doesn't add anything.

Redundanz commented 1 year ago

I intended to instruct the author to go fix his obviously customized / non-standard install of Windows. And why would i sugar coat this? Because that is part of his problem. He opens issues which end up being Windows troubleshoot posts that have no real connection with DXVK except it incidentally being the catalyst to invoke them. And it's not that he couldn't test this himself by using an untouched proper install, since he clearly pretends to come at all this from a semi-invested developer point of view rather than a "just a user who is having an issue with his favorite game to be resolved and then be gone".

Iglu47 commented 1 year ago

Final Fantasy XV Windows Edition Benchmark (v1.3) Everything on "Off" and at "Low" trace: https://drive.google.com/file/d/1wDkbQSS3DbH9u_ymYxSjTu6sxUU_I3C8/view?usp=share_link

Iglu47 commented 1 year ago
  1. I confirm that when using DXVK on Windows with Final Fantasy XV Benchmark there is a memory leak issue or something like that. Graphics settings don't matter. I checked, the problem can be reprodused with dxvk legacy. I also checked - the problem can be reprodused on 531.79, 531.68, 516.94, 512.95, 471.96 versions of nvidia drivers.
screenshot of memory consumption

![memory](https://github.com/doitsujin/dxvk/assets/25866099/e5a12616-31a6-4762-9ffb-9abe936afc0c) 11gb - dedicated gpu memory 8gb - shared gpu memory

  1. I did some more testing, looks like the problem is "how NVIDIA Ansel interacts with Vulkan" or something. At least removing AnselSDK64.dll from the benchmark folder helps as a workaround. This probably prevents Ansel from being used, so the problem goes away. As far as I understand Ansel does not work on Wine, so that explains why Linux does not have this problem.

@SirSAC Could you temporarily remove AnselSDK64.dll and confirm that this solves the initially described problem?