doitsujin / dxvk

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

[D3D9 x32] Sonic Adventure 2 crash on level pyramid cave #4160

Open NolanHewitt opened 1 month ago

NolanHewitt commented 1 month ago

Using DXVK 2.4 causes this level to crash consistently on start up. The mod loader for this game, and the render fix mod that is popular for this game both recommend using DXVK for this game.

A crash message occurs on crash as well:

"SA2 has crashed at 757cf5c2 (msvcrt.dll)."

Blisto91 commented 1 month ago

Hi there. Please attach the dxvk log. If you are on Windows then it usually appears next to the exe. If able then also provide a apitrace of the level that causes the crash.

NolanHewitt commented 1 month ago

sonic2app_d3d9.log Here is that log. I don't have the technical knowledge to know what an apitrace is or how to get that, otherwise I gladly would.

Blisto91 commented 1 month ago

The guide here should hopefully be easy enough to follow https://github.com/doitsujin/dxvk/wiki/Using-Apitrace

Edit: I can see from your log that the game seems to be hitting a memory limit

NolanHewitt commented 1 month ago

Hi, so this game is a 32bit game using DX9. Looking at that guide I would want to add dxgitrace.dll, dxgi.dll, ddraw.dll, d3d9.dll, and d2d1trace.dll to the folder holding the game's EXE file? Or do I add all the dll files from the apitrace download? Also, d3d9.dll is the same name as the file from DXVK so what should I do there? Apologies if these are dumb questions.

mbriar commented 1 month ago

Just add the d3d9.dll from apitrace without any dxvk dlls, you want to make the apitrace without dxvk. Also make sure to actually load the level that would crash with dxvk while recording the trace.

Blisto91 commented 1 month ago

You just use the 32bit d3d9 DLL that apitrace provides and put it next to the exe. Using it without dxvk is fine. Just get past where it will usually crash and then we'll replay it with dxvk locally.

NolanHewitt commented 1 month ago

Here is that: https://drive.google.com/file/d/1cBPdOJyVKMt1yYt87i6nBRdb6TYw9wFH/view?usp=sharing

Also, I do use mods with this game, but I nailed it down to one mod which this crash occurs with, an HD texture pack. With only that texture pack enabled it crashes. Using all mods except that one and it runs fine. Since you said its a memory error, perhaps that is related. Specifically I turned off all mods while running the trace, except for that texture pack which only replaces textures. This pack is the one used.

Edit: Seems to occur on a couple levels actually, only with the texture pack though. Also it’ll sometimes just crash in menus with a different error but it isn’t consistent.

K0bin commented 1 month ago

image

I took a look at your apitrace and moved all Rebar allocations to regular system memory. In total there's only ~100MB of address space used for resources and hardly an Vulkan pipelines or shaders. That's pretty much nothing. There's also only 16MB of system memory allocated while the logs you posted earlier had 800MB of system memory allocated.

Did you have the mod installed and running when you made the apitrace? If not, did you do something else differently when you made the log file you posted before? Are there some more steps required to hit the problem?

NolanHewitt commented 1 month ago

I think when I had posted the initial log I had more mods installed as I hadn’t narrowed the issue down to being the texture pack. That’s the only different I can think of. When running the apitrace I only had the texture pack enabled, all other mods were disabled. If you’d like I could try to get another crash log while only using the texture pack.

Edit: Here's a log from after it crashed while using only the texture pack sonic2app_d3d9.log

NolanHewitt commented 1 month ago

Also, I have another system I use, a gaming laptop, and testing it on there running the texture pack and DXVK, and it does not crash on that system. I'm not sure if its because the laptop has an Nvidia GPU, while my PC has an AMD GPU; if its something to do with the display used on my PC which is 4K and running HDR using windows auto-HDR while the laptop is 1440p without HDR, or something else entirely.