doitsujin / dxvk

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

Saints Row 2 DXVK Crash RTX 3080 Windows 10 x64 #2417

Closed mrchrismania closed 2 years ago

mrchrismania commented 2 years ago

i added the x32 d3d9.dll and dxgi into the saints row 2 folder. started the game and it crashes on load and sometimes i can get into the main menu but as soon as i start a new game it crashes. heres a log file

SR2_pc_d3d9.log

Windows 10 Version 21H1 OS Build 19043.1415 NVIDIA Driver version 497.09

K0bin commented 2 years ago

Logs indicate this is another case of #1318

mrchrismania commented 2 years ago

Logs indicate this is another case of #1318

is there anything i have to do on my end or is it an issue with the DXVK Wrapper?

K0bin commented 2 years ago

Judging by the driver version from the logs, I think you're using Windows (that would've been useful info to add to the original issue btw...). In that case run the game through one of those 3GB address space patchers and hope for the best.

mrchrismania commented 2 years ago

Judging by the driver version from the logs, I think you're using Windows (that would've been useful info to add to the original issue btw...). In that case run the game through one of those 3GB address space patchers and hope for the best.

how do i run the game through the 3GB Space patcher? i tried an NTCore 4GB Patcher for Saints Row 2 but it came up with an error when i tried to launch it.

lextra2 commented 2 years ago

try this one? https://www.techpowerup.com/forums/threads/large-address-aware.112556/

mrchrismania commented 2 years ago

try this one? https://www.techpowerup.com/forums/threads/large-address-aware.112556/

no luck just comes up with an error when i launch it saying. Application load error 3:0000065432

K0bin commented 2 years ago

Closing this because it's tracked in 1318.

Blisto91 commented 2 years ago

@qinlili23333 Hope it's okay i ping you here as i didn't want to start a talk in the PR. Do you always crash when starting a saints row 2 game?

When i was testing https://github.com/doitsujin/dxvk/issues/1814 on linux i didn't notice any issues and i loaded into the game a lot of times. Tho i did not actually play too much around.

Edit: I guess proton enables Large address aware by default now that i think about it so maybe that's why i didn't experience a crash. Haven't looked at the actual memory consumption.

qinlili23333 commented 2 years ago

@qinlili23333 Hope it's okay i ping you here as i didn't want to start a talk in the PR. Do you always crash when starting a saints row 2 game?

When i was testing #1814 on linux i didn't notice any issues and i loaded into the game a lot of times. Tho i did not actually play too much around.

Edit: I guess proton enables Large address aware by default now that i think about it so maybe that's why i experience a crash. Haven't looked at the actual memory consumption.

The crash rate is related to the resolution used in game. When resolution is above 3200x1440, 100% crash when staring game. 2560x1440 can run game with heavily stutter and about 70% crash in 5 minutes. Resolutions lower than 1920x1080 work well with no crash. All crash logs contain err: DxvkMemoryAllocator: Memory allocation failed. Game can run without DXVK in 3840x2160 resolution and only cost 902MB memory and 571MB VRAM, but without DXVK the game can only get very low FPS, while my GPU usage is nearly idle. Saints Row 2 is a 32bit game with no Large Adress Aware, I tried any tools that can modify exe to Large Adress Aware but all lead to Steam Launch Error 51. (Maybe GOG version can be used since it's DRM free, but I only have a Steam version copy.)

Edit: Saints Row 2's resource packs have some differences that Windows version only got low quality audio and music while Linux/MacOS got high quality. Replace Windows ver with Linux ver's music packs (music*.vpp_pc) can get high quality radio music on Windows, but if replace audio.vpp_pc it will stuck at 5% in menu loading screen. Different versions can be downloaded by download_depot command in Steam console, depots number can get from SteamDB.

Blisto91 commented 2 years ago

Interesting. I will do some testing with the game without large address aware and also try on windows. My own AMD setup only have a 1080p monitor but i have access to a Nvidia setup with 1440p monitors.

Blisto91 commented 2 years ago

Okay yes i see what you mean. When i tell proton to stop forcing large address aware i also crash when loading in on linux.

qinlili23333 commented 2 years ago

update: I finally made a large address aware patched executable. Now this patched version can run well under both Windows ans Linux Proton without any configuration. SR2_QINLILI_PATCH.zip I tried to do some further analysis on game's memory management, and now I think it's the game's memory allocation that really have problems. The game will try to allocate about 2X memory when loading new game or saves, and release these extra memory until loading finished. So once game loaded, the real commit size under 2160P is only about 1.3G while it will reach the 2G address limit in loading. Since under native DX9 it only use about 900M after loading, the loading scene will not reach 2G limit. DXVK will use extra memory so game reach 2G limit and crash under high resolution without large address aware.

PS: The game's steam version seems have a protection shell that any modification will make it unable to run, while gog version with no protect. So my modification is based on gog version.

Blisto91 commented 2 years ago

Yes i did some testing on my amd setup with the new PR (before the latest commits) and it indeed doesn't help with Saints Row 2 loading crash without LAA. As you said since this is while the game is loading it is probably not something that is easily freeable and this PR's main help is probably in games where they will crash during gameplay.

So for this to work without LAA dxvk would need to allocate less memory in general. But i don't think that is much of a priority (or how feasible it is) since on linux alot of tools like steams proton and lutris enable LAA in the games through wine by default and when they don't it's relatively easy to so afaik by setting WINE_LARGE_ADDRESS_AWARE=1

Edit: Slight correction to the last part, the LAA variable doesn't do anything on regular wine as far as i know, you need a custom version with a LAA patch. So there is ofc value in decreasing memory usage. If it is possible that is.

K0bin commented 2 years ago

Proton will enable LAA by default, so patching the executable shouldn't make any difference.