-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[d3d11] Jedi Fallen Order: fps has a massive drop after acessing the menu #2552
Comments
You're most likely just running out of VRAM. |
So the game allocates a heavy resource when the menu is accessed and keeps it on VRAM instead of clean it ? Because if you just play without accessing the menu, the issue doesn't happen. |
I can confirm that the same issue happens on AMD, opening the menu leads to a severe performance drop. Not sure if it's a DXVK or a game bug. I found out that changing any of the graphics settings (texture quality, shadows quality or anything else, doesn't matter) restores the performance, temporarily. Opening the menu next time drops the performance again, but changing the graphics settings restores it again. So changing the graphics settings every time is sort of a workaround. |
The trace doesn't work since DXGI wasn't traced. It's more likely that the game probably recreates a bunch of render targets after leaving the menu, and since your VRAM is already full, those will end up in system memory.
Please specify your GPU and how much memory it has. |
AMD RX 560, 4 GB VRAM. To be clear, i played the game a few months ago with Mesa 21.3.0 and DXVK 1.9.2. I don't have it installed right now, so can't test it again with newer Mesa and DXVK versions. |
@doitsujin I've followed the project's wiki to generate the API trace (added |
I've also tried changing the device memory available ( |
Sounds like VRAM being full then. Note that on Nvidia, any background app that consumes VRAM significantly reduces the amount of memory that's available to Vulkan applictions, including DXVK. You should be able to see high PCI-E bandwidth usage in nvidia-settings when this happens. |
nvidia-settings displays only 70% of the dedicated memory used (same as DXVK's hud) |
And what about PCIe bandwidth? |
5% used only |
Could also be related to the 0.5GB of lower bandwidth memory that the GTX 970 has IIRC. |
Some tests from my system. R9 380 4GB, mesa 22.0, proton 7.0-1, medium settings 1080p. In order of appearence: A little quirk is that you can alter the fps slightly each time you go in and out of the menu. Sometimes i drops even more and sometimes it rises a bit again (tho not to original levels). |
Doesn't happen if i launch the game in 1024x768. Note the resolution selection is a bit weird and i had to click the fullscreen button for it take effect. Would be nice to trim origins vram usage a bit tho hehe. |
It's a Chrome-based, GPU accelerated app, as far as I know. It will use VRAM for surface buffers. But maybe wine-proton could be tweaked to pass an option to disable GPU acceleration for Chrome processes, similar to how Proton disables Chrome sandboxing by injecting command line arguments. |
I see. It goes through dxvk if that matters since the hud also shows up in the corner of it's interface when it shortly pops up. |
To me it looks like an unlucky combination of bad vram memory budget management of the game and the chunk allocator. I now tried I have a 6 GB card, accounting for Xorg usage (around 0.8 - 1.5 GB varying) and for chunk allocator slack and some buffer, I subtracted 2 GB from my 6 GB VRAM and are left with 4096 MB. YMMV, depending on your system. Minimizing browsers and other VRAM-hungry programs helps a little to keep usage under control. I think the chunk allocator already received a very good update by de-allocating completely free chunks from the graphics driver. I think this could only further improved by a repacker which is probably very difficult to implement. But OTOH, maybe there are some stats of how much "slack" memory is typically generated by games? This could be subtracted from the max device memory offered to the game automatically. I'm not sure if Xorg memory should also be subtracted or if games actually can handle that: I see that some games are actually aware of applications using VRAM, while others maybe ignore it and rely on DirectX behavior to swap application allocations from fast VRAM to slow sysmem? As a start, the DXVK HUD could offer additional stats about memory chunks: How much slack memory is there (I think this value is almost there already: used vs allocated)? How many chunks have been allocated and freed in total (to see how aggressively a game allocated and freed huge amounts of data)? How many active chunks are there per chunk size (to get an idea what the optimal chunk size for a game would be)? It may give some insight on how to optimize this further and introduce tunables for chunk size or some sort of "slack memory accounting" (to subtract from the actual device memory size). This reminds me a little of btrfs and its allocation chunks, and it keeps a global reserve for times when deleting data would require an additional chunk to be allocated. Just subtracting some amount of device memory could account for a similar purpose (just that dxvk would never make use of that reserve because it could not move allocations away from it later). |
Hi all, |
I can confirm exactly the same issue here on Gentoo Linux / Proton experimental / Geforce GTX1060 + Ryzen 9 5900X. Are there any other known workarounds? I do not find a file named "dxvk.conf" on my system. Is this windows specific? |
Create it yourself then change the game launch parameters to look like this: |
I did exactly that and the result was, that there is still a fps drop but less severe than before. My video card has 6Gb of memory. Might it be possible that I need to use a different value than 6144? |
I have 8GB of VRAM and my file has it set to 4096. Don't remember if it actually fully solved it or not... |
@erdies Yes, try 4096 because your desktop will use around 2 GB - at least with compositing enabled and having a browser running. As a result, the game will probably load higher quality textures slower but it should work much better. Especially in this game, it CAN still result in occasional low fps when accessing the menu. There are a few games (including this) which still go easily past this limit because the DXVK limit only affects the REPORTED memory for the game. DXVK allocates memory in chunks of different types, and only frees memory in size of the same chunks (the game doesn't know about this). If the game has unusual allocation patterns this may lead to a lot of chunks of certain types with only a few MB of render data in a chunk, and lots of MB left unused in the chunk by the game (external fragmentation), which creates the overhead you're seeing. There's nothing DXVK can do about that due to how the translation from DirectX to Vulkan has to work. You may try fine tuning the memory limit per game by reducing the limit by the amount of memory the game overshoots. You'd need to repeat this multiple times until the limit settles at some sweet sopt, and also ensure that your environment is always around the same (read: same amount and types of windows open). If you place such individual dxvk.conf files right in the same directory as the game EXE, it will be automatically picked up by DXVK without pointing it to it with Background: In native Windows DirectX, Windows can kind of "swap out" idle application video memory (but it keeps around 512 MB for desktop compositing) when there is VRAM pressure by the game. This is integrated with the Windows kernel to synchronize memory management and relocation with games and applications. For obvious reasons, DXVK cannot do that. If you're using NVIDIA, you can verify if your game uses memory from the system instead of video memory (after it overshot the budget) by watching the bus bandwidth usage (GPU page, PCIe Bandwidth Utilisation) in nvidia-settings. It should usually hover around 3-5% while playing the game, if it is higher, fps will slow down and that indicates that important render resources are loaded from system memory. If this happens, lower the memory limit by 256-512 MB and try again. Some render resources are always allocated from system memory, so don't panic if DXVK says it's using some amount of system memory for the game. Games can actually ask for that because some resources are mostly used by the CPU and thus are better placed local to the CPU rather than the GPU. The important indicator is the bandwidth usage of the bus. |
TL;DL: use AMDVLK or rebuild mesa with this !6833 (merged) disabled, i've made a quick patch to add an environment variable to toggle that (off by default). So, i wanted to test it today this game again the main reason is these tests I've been doing since i have a 4GB VRAM GPU, so i remembered that this game in particular had similar issues... So i was going to do that, I've locally build mesa and added an environment variable to disable !6833 (merged), but for whatever reason steam decided to use AMDVLK, which i didn't notice at first and when in-game these slowdowns were gone, so i thought that DXVK fixed, but it was just AMDVLK, because it handles low VRAM better than RADV. but disabling !6833 (merged) also fixes this issue, it actually works better than AMDVLK on my tests on a RX 6500 XT (Epic settings- 1080p 60fps vsynced) |
@ranplayer Hi again. Can you give this a try with latest master? Vram usage and management received a bunch of improvements in dxvk |
Hi @Blisto91 , sorry for the late response. I've replaced my GTX 970 (4Gb) by a RX 6700 XT (12Gb), so unfortunately I'm not able to retest with the same hardware. For my RX this game has no such issue due to the large amount of VRAM available. |
No problem. |
I'll close this for now. If someone runs into the same issue, please comment. |
So with 2.5+, we should no longer need to tweak |
Hopefully. But you'll have to try yourself. |
Unfortunately it still seems to be necessary with dxvk 2.5.1, at least on my NVIDIA GPU (1060) I'm not quite sure how to create an apitrace as I'm unable to start the game outside of Steam (getting some error about "uncooked" content when I launch the binary directly). If someone can give me a pointer how to circumvent that I can try again. I've created some log files, in case they are helpful in some way:
The first run using Edit: Oops, forgot Proton log: https://gist.github.com/Staudey/413895e7beb5f32bb890fd1c6925650c |
This is also the problem with Elite Dangerous: I cannot remove the Should we file a new bug report? Or should this one be re-opened? |
If it is a different game then open a new issue yes |
Elite Dangerous is known to oversubscribe memory, not really something that's expected to be performant. |
If you access the menu during gameplay and then return to action, there is a massive fps drop (even if you don't change anything). Everything slows down. I'm on Nvidia, not sure if the issue happens on AMD as well.
This issue also happens if you change any graphics property (before start playing or during gameplay).
Software information
System information
Apitrace file(s)
api trace
Log files
Please, let me know if any more information or testing is required.
The text was updated successfully, but these errors were encountered: