vkd3d-proton icon indicating copy to clipboard operation
vkd3d-proton copied to clipboard

VKD3D_CONFIG=dxr significantly increases VRAM usage in Guardians of the Galaxy

Open simifor opened this issue 1 year ago • 15 comments

The benchmark of the game goes from taking 5.5-6GB of VRAM with VKD3D_CONFIG=nodxr to completely filling it when using VKD3D_CONFIG=dxr. The issue can be observed with amdvlk 2024.Q1.1, and radv with any commit since https://gitlab.freedesktop.org/mesa/mesa/-/commit/374bd4e1bef25ba2aeef6016ac35b41df07f3a99

Increased VRAM usage also lowers the performance in radv and amdvlk, specially in the former.

Software information

Guardians of the Galaxy with most things on low or disabled, ray tracing is also disabled. Marvel's Guardians of the Galaxy_20240117_184742 (this card has 8GB of VRAM, the game misreports the total amount when going past its limits)

System information

  • GPU: 6600
  • Driver: 23.3.0/git
  • Wine version: 8
  • VKD3D-Proton version: 2.11

2.11 and later will display this issue by default as it sets VKD3D_CONFIG=dxr, in previous versions the user would have to set that up themselves for it to appear

simifor avatar Feb 02 '24 19:02 simifor

Do we know how this behaves/compares to Windows?

Blisto91 avatar Feb 02 '24 20:02 Blisto91

well, in windows the benchmark reports using 4GB of VRAM when using DX12 natively. The game will not launch for me when adding vkd3d files and dxgi into the executable's folder. gotg

simifor avatar Feb 02 '24 21:02 simifor

The game uses more vram on linux with Nvidia too. Generally i think that’s just how it is. I dont know the technical reason why that is tho’.

shelterx avatar Feb 22 '24 16:02 shelterx

I ran the game with RT on Ultra, all other settings on High, AFx16. The game reports that it used 9,6Gb with Nvidia. So 8,3GB with AMD on low seems too much.

@simifor Can you try a benchmark with high settings, AFx16 settings on AMD and see what VRAM usage you get?

shelterx avatar Feb 23 '24 07:02 shelterx

@shelterx the benchmark repotrs 5.5GB of VRAM usage when the game is run with nodxr, and 8.4GB (which is over the card's budget) with dxr. Both tests were with high settings, AF to 16x and RT disabled

simifor avatar Feb 23 '24 15:02 simifor

@simifor Oh, I see. But you first wrote all tests were done in low settings which the screenshots imply. But yes, I understand what you mean now. dxr increases memory usage even if you don't have RT. Try running the game with the VKD3D_CONFIG option no_upload_hvv

shelterx avatar Feb 23 '24 20:02 shelterx

@simifor Oh, I see. But you first wrote all tests were done in low settings which the screenshots imply. They were, there just isn't a big vram usage difference reported by the benchmark from gong to low to high, for whatever reason.A low preset test used 5.1GB. But yes, I understand what you mean now. dxr increases memory usage even if you don't have RT. Try running the game with the VKD3D_CONFIG option no_upload_hvv vram went down slightly, 8046MB, and even though that's slightly below the reported maximum, the performance still suffers greatly.

simifor avatar Feb 23 '24 21:02 simifor

This is kind of expected though? Raytracing acceleration structures are big, and will obviously not be created when raytracing is disabled.

You could try using VKD3D_CONFIG=no_upload_hvv and see if that does anything (assuming you have ReBAR enabled), but doing so may also reduce performance.

doitsujin avatar Feb 29 '24 19:02 doitsujin

The problem is that raytracing is disabled ingame, the only way to avoid high vram usage is to change the defautl configuration of vkd3d-proton or use an old version of mesa (or an old version of vkd3d-proton before the default got changed)

simifor avatar Feb 29 '24 20:02 simifor

@simifor Can't you just use VKD3D_CONFIG=nodxr ?

shelterx avatar Mar 01 '24 03:03 shelterx

I can, but the problem is that other people are affected too. Most people with an 8GB VRAM card or less (only 25% of steam users have 10GB or more) would have to change an environment variable to avoid the risk of performance degradation, this doesn't seem ideal.

On Thu, Feb 29, 2024, 11:01 PM shelterx @.***> wrote:

@simifor https://github.com/simifor Can't you just use VKD3D_CONFIG=nodxr ?

— Reply to this email directly, view it on GitHub https://github.com/HansKristian-Work/vkd3d-proton/issues/1874#issuecomment-1972382377, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQZQ4EHIQWD3F7M6I5EPB6DYV7VP3AVCNFSM6AAAAABCXGHGM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZSGM4DEMZXG4 . You are receiving this because you were mentioned.Message ID: @.***>

simifor avatar Mar 01 '24 03:03 simifor

@doitsujin @simifor I don't know what VKD3D-proton do internally when dxr is enabled, but to me it seems odd that having dxr enabled increases GPU memory usage by such an amount, even if RT isn't enabled in the game. Windows obviously behaves differently here.

shelterx avatar Mar 01 '24 04:03 shelterx

For reference, I did a test with my RTX 3070 with RT enabled in the game. According to the benchmark results Windows is using ~half of of the VRAM compared to Linux. However according to MSI Afterburner and Mangohud, the VRAM usage is about the same. As a sidenote, there's ~20 FPS loss in Linux.

shelterx avatar Mar 02 '24 07:03 shelterx

We don't allocate more memory if DXR is exposed. Memory management is up to the game.

doitsujin avatar Mar 05 '24 11:03 doitsujin

One "interesting" thing about the game, is that if it detects an AMD card but can't properly detect the driver version, the launcher will complain about outdated drivers, and the option to enable raytracing will be grayed out (both in the launcher and in the game). Proton has a patch for that.

If you are not using this patch, the VRAM usage will be normal, even though DXR is technically exposed. But if you do DXVK_CONFIG="dxgi.hideAmdGpu = True", the game will still complain about outdated drivers, but it will allow enabling raytracing (it functions perfectly fine). In that case, the VRAM usage will be increased for no reason, just like with the patch.

SuperSamus avatar Mar 05 '24 23:03 SuperSamus