doitsujin / dxvk

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

Memory dump issue and slowly CTD upon travelling to a number of cells in game worldspace #2026

Open Juzu1234 opened 3 years ago

Juzu1234 commented 3 years ago

Please describe your issue as accurately as possible. If you run into a problem with a binary release, make sure to test with latest master as well.

Ok running Skyrim SE with vulkan - success. Running skyrim se with enb graphics via proxy - success. Problem is the memory allocator which is meant to dump memory upon travelling to new cells. This allow for freeing up memory and then allowing the freed up momory to be used to load new cell. Upon travelling the memory just keeps more or less climbing and therefore the end result being CTD. Is there any way to fix this via any setting.

Important: When reporting an issue with a specific game or application, such as crashes or rendering issues, please include log files and, if possible, a D3D11/D3D9 Apitrace (see https://github.com/apitrace/apitrace) so that the issue can be reproduced. In order to create a trace for D3D11/D3D10: Run wine apitrace.exe trace -a dxgi YOURGAME.exe. In order to create a trace for D3D9: Follow https://github.com/Joshua-Ashton/d9vk/wiki/Making-a-Trace. Preferably record the trace on Windows, or wined3d if possible.

Reports with no log files will be ignored.

Software information

Name of the game, settings used etc.

System information

Apitrace file(s)

Log files

doitsujin commented 3 years ago

which memory allocator are you talking about?

Juzu1234 commented 3 years ago

I am trying to use the vulkan amd asynchronous wrapper for skyrim se. It seems to work but when playing the game the three allocated heap memory partitions do not seem to dump the loaded memory upon leaving an environment and loading a new cell. Normally without the vulcan wrapper installed this happens but this issue is present when installed. I also went one step further and made the vulcan wrapper successfully work with enb by adding a proxy in the enblocal.ini thus renaming the vulcan d3d11.dll to a different name then placing the enb named d3d11.dll in the root folder. Game only currently fires up with the enb plugin for linux and not windows. Tried the windows endorsed plugin but game crashes and doesnt load. Currently in the process to try and load different windows endorsed versions of enb d3d11.dll plugin. You can see from the log files i added that heap allocated memory from the vulcan app misbehaves by looking at the log. Even when trying the vulcan on its own it still misbehaves. Rig is amd ryzen 9 32gb rtx 2070 super nvidia 8gb ssd hd. All drivers for nvudia are latest and vulcan app is latest runtime. Ran vulcan checker and all seems good in report.

Is there any settings or tweaks which an end user can play around with to try and get the memory allocator to behave when running skyrimse?

Thanks for asking about more info.

doitsujin commented 3 years ago

Ah, I see it now. Please attach your log files as a text file next time, just dumping them into the comment makes the whole thing unreadable.

Anyway, please try without ENB and try to record an apitrace. There's a memory leak somewhere but that's not necessarily our fault.

Bxaa commented 3 years ago

Same issues with dx9 dxvk version

Juzu1234 commented 3 years ago

Do not know if this is a common issue. I did some testing and also got the windows d3d11.dll plugin for windows ENB also to work alongside DXVK for skyrim SE but the memory allocation still reports as failed. This could be because the game papyrus engine manages this. Who knows. Some people have reported in other games even that this reports the same. I have also tried the linux version of enb d3d11.dll plugin and also managed to get that working but still with the same results in the log for the memory allocation.

All I know is that when I use the windows enb d3d11.dll on its own my game does not crash but when using DXVK and also enb as proxy for skyrim se upon playing the game then after travelling to more thana 3different cells then the game crashes due to memory fallout as it gets maxed due to not dumping enough memory from the last loaded cell in order to make room for the new cell to load. Maybe I need more RAM but 32GB shoulod be enough. Or maybe there is a way to increase the memory heap ammounts. Noticed that heap 0 = 8gb and heap 1 = 12gb and heap 2 = 250mb. Wonder if you can tweak this to be increased for the game of skyrim se?? I state skyrim se as the shezons memory patch does not work for SE and it only works for the legacy version of skyrim 32bit and not 64 bit version. As far as I am aware anyway.

Bxaa commented 3 years ago

@Juzu1234 ......DXVK and also enb as proxy for skyrim You mean dxvk as proxy dll for enb?

You don't need any heap patches for skyrim SE. This is not a reason of game crash. Try: 1) Fully disable enb memory manager (enb's ini) 2) Remove all heap patches

UPD: @Juzu1234 In my case: VRAM overflow while changing cells (interior\ exterior cells or fast travel) (Fps down to 1-5 after some time in game)

Do you tried dxvk with Oblivion or Fallout3\NV? (same issues?)

And yes - try this build https://github.com/doitsujin/dxvk/issues/1945#issuecomment-786909779

misyltoad commented 3 years ago

ENBoost has incompatibilities with DXVK that may cause this if you are using that.

Juzu1234 commented 3 years ago

I do not use enboost. I am currently in the process of disabling the enb memory manager within the enblocal.ini. Also I am trying a different build also. These comments are welcomed very much so. Nice one guys.

Bxaa commented 3 years ago

@Juzu1234 Enboost is a part of your used enb version (enboost - just a memory manager) I know one enb's version for gamebryo engines without enboost, and it's for tes-4 only (except generic version) I could be wrong...

UPD: So after test: max available memory - is a reason of issue. (vram overflow in my case) Without it all work fine. Maybe it will be useful to someone. (dx9)

Juzu1234 commented 3 years ago

Still no joy in the fixing of the memory manager being an issue. I tried to disable the memory manager in enb local and game does not even fire up. Get this though. If I remove enb and just use dxvk the same thing happens anyway. Wonder if there is a way to get the game to work like when you just use the vanilla game ans also enb? When I just use ENB the memory is stable as hell but when using dxvk it goes crazy. Wonder if there is a way to stop dxvk from trying to manage the memory. Maybe in the config.conf file but the lines involved in this file I have no idea. I have even read the explanation and the options for the config.conf confuse the hell out of me. I wish there was a guide out there explaining it step by step but more basic as in what you would get or what would happen for each option like a scenario what would happen etc. Oh and the game is also stable without dxvk and also enb. My ram is not the issue it is the way its being managed with ref to dxvk.

Juzu1234 commented 3 years ago

Does anyone know how to fix this and also what the hell it means?

D3D11RasterizerState: Antialiased lines not supported err: DxvkMemoryAllocator: Memory allocation failed err: Size: 89480704 err: Alignment: 1024 err: Mem flags: 0x1 err: Mem types: 0x3 err: Heap 0: 7454 MB allocated, 7368 MB used, 22967 MB allocated (driver), 7243 MB budget (driver), 8011 MB total err: Heap 1: 15306 MB allocated, 14991 MB used, 328 MB allocated (driver), 15581 MB budget (driver), 16349 MB total err: Heap 2: 43 MB allocated, 40 MB used, 44 MB allocated (driver), 169 MB budget (driver), 214 MB total err: DxvkMemoryAllocator: Memory allocation failed err: DxvkMemoryAllocator: Memory allocation failed err: Size: 89480704 err: Alignment: 1024 err: Mem flags: 0x1 err: Mem types: 0x3 err: Heap 0: 7454 MB allocated, 7368 MB used, 22967 MB allocated (driver), 7243 MB budget (driver), 8011 MB total err: Heap 1: 15306 MB allocated, 14991 MB used, 328 MB allocated (driver), 15581 MB budget (driver), 16349 MB total err: Heap 2: 43 MB allocated, 40 MB used, 44 MB allocated (driver), 169 MB budget (driver), 214 MB total err: DxvkMemoryAllocator: Memory allocation failed

This is from the d3d11.dll report which is created when firing up the game.

The first line is the key I believe: - D3D11RasterizerState: Antialiased lines not supported

AA is disabled in my enb ini anyway and only activated in my nvidia control panel and skyrim ini file. I have even disabled them also and the same reports upon loading.

Bxaa commented 3 years ago

@Juzu1234 I have a ready working examples, but it for tes-4 and fallour NV. (dxvk + enb + reshade with custom injecting)_

https://www.nexusmods.com/oblivion/mods/50381 https://www.nexusmods.com/newvegas/mods/69848

Juzu1234 commented 3 years ago

I would love to see someone get ENB and dxvk fully working together for Skyrim SE. ENB for graphics and dxvk for high draw calls. Guess this is something I cannot fix.

Bxaa commented 3 years ago

Maybe i'll try to do it.

Juzu1234 commented 3 years ago

dxgi.dll vulcan-1.dll the necessary d3d11.dll for vulcan but renamed so to add it to the enblocal.ini a proxy and then the newest d3d11.dll for windows enb. Also the config.conf file for setting up dxvk whilst in game. I have managed to get all of these working in skyrim SE but the memory allocation fails. If someone could get a similar setup but allow the enb d3d11.dll to work fully and then allow dxvk to just be utilized for higher draw calls this would be an absolute popper of an application. Patreon would be cooking mate. There has been massive interest in this application. See below.

https://www.nexusmods.com/skyrimspecialedition/mods/48566

https://www.nexusmods.com/fallout4/mods/48053

What I did was download the async amd pipeline version from the fallout4 web page and then once downloading then unpack and rename the d3d11.dll in this folder to another name. Then add this name in the enblocal.ini file for the enb under [PROXY] line. Once this is done then I put the d3d11.dll for windows enb back in the data folder but had initial problems with the newest 452 version as with this setup I could not run enb effect in main menu and also the map and loading screens. I then tried the latest d3d11.dll for linux enb and for some strange reason it work throughout game. This however shows reports in the d3d11.dll.txt log which generates upon firing up the game stating that memory allocation failed. Try and get to maybe this stage and then go deeper. If one was to fix this issue im telling you they would be then releasing a workable version which would be absolutely massively popular and would take the skyrim se massives by absolute storm.

K0bin commented 3 years ago

dxgi.dll vulcan-1.dll the necessary d3d11.dll for vulcan but renamed so to add it to the enblocal.ini a proxy and then the newest d3d11.dll for windows enb.

I don't fully understand what you did there but that sounds very wrong. For example, I have no idea what vulkan-1.dll you're talking about.

Juzu1234 commented 3 years ago

Look at the webpage I added. This .dll plugin is in the contents. I just added it and tried it and it worked. I also tried to remove this .dll plugin as some people have said it is not needed but when I did I had intermittent results on the game firing up.

https://www.nexusmods.com/fallout4/mods/48053

Juzu1234 commented 3 years ago

Seeing this is the same game engine more or less I thought why not and it did work. Problem is upon doing what I said then when playing the game there is a issue with the heap memory allocation as when fast travelling the memory does not drop enough in order to leave room for the next loading cell or worldspace area thus ctd When using just enb it never ctd and i mean never.

Juzu1234 commented 3 years ago

Just wish there was a way to turn memory allocation off for dxvk and so the other allocators I use would take over and then surely zero issues then

K0bin commented 3 years ago

That's not how any of this works.

Juzu1234 commented 3 years ago

Well I got it to work. Honestly now I can get dxvk working and also enb at the same time. My game fires up and runs with enb graphics and then also I can get well over 15000 draw calls so I get zero stutter. I get the best of both worlds and it runs amazing. The issue is when fast travelling or loading a new cell or worldpsace as the memory keeps climbing and then crashes. Just look at the comments on this webpage mate. Loads of people have managed to do the same.

https://www.nexusmods.com/skyrimspecialedition/mods/48566

Blisto91 commented 2 years ago

@Juzu1234 Are you still having issues? Please retest with latest master https://github.com/doitsujin/dxvk/actions/runs/2955815479 Note you need relatively up to date drivers.

Blisto91 commented 2 years ago

I have not been able to reproduce this problem with latest enb and dxvk.

Blisto91 commented 1 week ago

@Juzu1234 Friendly ping