doitsujin / dxvk

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

Bioshock Infinite is crashing on startup with dxvk enabled [GOG] #1085

Closed shmerl closed 5 years ago

shmerl commented 5 years ago

Testing recently released GOG version.

The error doesn't seem to be directly dxvk related though, but with wined3d it's not crashing like that, instead it's causing GPU hang.

With dxvk, the crash is as follows (output from Wine debug, I don't see anything anomalous in dxvk logs themselves):

mmap() failed: Cannot allocate memory
Failed to create permanent mapping for memfd region with ID = 4204222935
Ignoring received block reference with non-registered memfd ID = 4204222935
Assertion 'pa_atomic_load(&(c)->_ref) >= 1' failed at pulse/context.c:1052, function pa_context_disconnect(). Aborting.
00ac:fixme:dbghelp:validate_addr64 Unsupported address fffffffff79c0000
00ac:fixme:dbghelp:validate_addr64 Unsupported address fffffffff7980000
00ac:fixme:dbghelp:validate_addr64 Unsupported address fffffffff7b70000
00ac:fixme:dbghelp:validate_addr64 Unsupported address fffffffff77b0000
00ac:fixme:dbghelp:validate_addr64 Unsupported address fffffffff0f50000
00ac:fixme:dbghelp:validate_addr64 Unsupported address fffffffff0540000
00ac:fixme:dbghelp:validate_addr64 Unsupported address ffffffffef3d0000
00ac:fixme:dbghelp:validate_addr64 Unsupported address ffffffffe43e0000
00ac:fixme:dbghelp:validate_addr64 Unsupported address fffffffff0f10000
00ac:fixme:dbghelp:validate_addr64 Unsupported address fffffffff0510000
00ac:fixme:dbghelp:validate_addr64 Unsupported address ffffffffef340000
00ac:fixme:dbghelp:validate_addr64 Unsupported address ffffffffe4130000
00ac:fixme:dbghelp:validate_addr64 Unsupported address ffffffffac580000
00ac:fixme:faultrep:ReportFault 0x2114ef04 0x0 stub
0009:fixme:msvcrt:MSVCRT__set_abort_behavior _WRITE_CALL_REPORTFAULT unhandled
0009:fixme:msvcrt:__clean_type_info_names_internal (0x26a630) stub
shmerl commented 5 years ago

I tried applying "large address aware" patch to the binary using this tool, but that didn't help.

misyltoad commented 5 years ago

This game works fine for me. I have no idea what your issue is.

fwiw I am using the Steam version.

doitsujin commented 5 years ago

Same here, this game has been working with DXVK for ages and I still test it from time to time.

mmap() failed: Cannot allocate memory

This is a clear indication that you're running out of virtual memory for some reason (too many fonts installed?).

shmerl commented 5 years ago

May be GOG version differs in some way - there is no guarantee they are the same. I tried that 4GB hack above, since I also thought it's about virtual memory limit. No luck. 32-bit games are just messy...

I also affected GOG installer to prevent it from polluting the prefix with all kind of dx junk. I.e. I used this when installing:

WINEDLLOVERRIDES='D3D11Install_2010.exe=d;DXSETUP.exe=d;scriptinterpreter.exe=d;vcredist_x86.exe=d;vcredist_x86_vs2008sp1.exe=d;vcredist_x86_vs2010sp1.exe=d'

I'll try without messing with it as well.

shmerl commented 5 years ago

I'll wait for confirmation from anyone with GOG version if it works for them or not.

doitsujin commented 5 years ago

Well anyway, running out of virtual memory isn't exactly a DXVK bug, and you should really check your setup (wine prefix, fontconfig - some Windows apps load all your system fonts into memory!).

shmerl commented 5 years ago

How can I check fonts memory consumption?

shmerl commented 5 years ago

Monitoring process virtual memory, it clearly hits somewhere 3.7GB and then crashes (I suppose going over 4).

With wined3d it's causing a GPU reset, but doesn't crash, and stops at around 3.6GB virtual memory.

misyltoad commented 5 years ago

You're playing on GOG, right?

Galaxy is known to leak file descriptors and memory because they have no idea what they are doing and should stop shipping that crap with games given they're DRM Free.

shmerl commented 5 years ago

I'm not using Galaxy client itself in any capacity, though the DLL is bundled with the game. I can check if removing it is helping anything.

shmerl commented 5 years ago

Hm. Removing Galaxy.dll produced:

0009:err:module:import_dll Library Galaxy.dll (which is needed by L"C:\\bioshock_infinite\\Binaries\\Win32\\common.dll") not found
0009:err:module:import_dll Library common.dll (which is needed by L"C:\\bioshock_infinite\\Binaries\\Win32\\BioShockInfinite.exe") not found
0009:err:module:LdrInitializeThunk Importing dlls for L"C:\\bioshock_infinite\\Binaries\\Win32\\BioShockInfinite.exe" failed, status c0000135

Looks like it's a hard dependency.

misyltoad commented 5 years ago

Well yeah, it's not the client itself but the Galaxy dll itself that's broken. Have you tried disabling esync? I remember that working for some people.

shmerl commented 5 years ago

I'm actually using stock Wine in this case, so no esync is present. I wonder if there is some stub that replaces Galaxy.dll.

Pangaea666 commented 5 years ago

Isn't GOG supposed to provide installers that aren't infected with Galaxy? Or have they dropped that as well now? Can't trust them at all any more. So damn sad.

Don't have the game so can't try on my end.

shmerl commented 5 years ago

They used to (those were called "classic installers" before), but I noticed that they have stopped doing it. If GOG were more cooperative, we could ask them how to disable Galaxy for it, but lately they barely respond to anything, let alone "unsupported" use cases.

jrugia commented 5 years ago

@shmerl They could provide an additional exe that doesn't have anything to do with Galaxy. They don't need to make any special announcements or parade either, the Linux community knows where to look for solutions and can take care of themselves in such a situation.

shmerl commented 5 years ago

@shmerl They could provide an additional exe that doesn't have anything to do with Galaxy. They don't need to make any special announcements or parade either, the Linux community knows where to look for solutions and can take care of themselves in such a situation.

They could, but they need to be willing to do even such a minimal thing. I'll try contacting some people in GOG about it. But I don't have high expectations for this. Their main Linux support developer who was very responsive in the past has left the company, and no one else is engaged with the community now.

shmerl commented 5 years ago

Just tried with wine-staging, and it's not crashing (though it hangs on some xaudio related error). I suppose staging is doing something to reign in virtual memory overuse.

Installing xact with winetricks works around the xaudio problem and the game starts! I suppose also building staging without fauido reverts can help as well.

Pangaea666 commented 5 years ago

They could, but they need to be willing to do even such a minimal thing. I'll try contacting some people in GOG about it. But I don't have high expectations for this. Their main Linux support developer who was very responsive in the past has left the company, and no one else is engaged with the community now.

He's left the company as well? I hoped all the staff had just been muted for some reason, as a company policy. Noticed some piping up during the current sale, though. Pretty sad that a company whose main selling point (whether they like it themselves currently or not) is DRM Free games. Would be such a perfect match with Linux. Yet they don't care, and would rather chase after the Steam crowd and whatnot, with Galaxy and all that crap.

But suppose it's little wonder they don't much care about Linux when their main Linux guy(s) have left. Maybe that's why he/they left.

hensleym83 commented 2 years ago

I just spent the last two day's figuring this out for myself, I have tried every and what worked for me was under the Advanced option of the System Option, I Disabled "Prefer system libraries" and under the same menu i turned on "Reset Pulse Audio" and now the game goes past the logo crash and plays with no problem, and im using the GOG version of the game in lutris. without turning on the Reset of Pusle Audio the game will still run but with no sound. I really hope this helps anyone else out whose been having this same problem of the game crashing.

Shy-Bell commented 2 years ago

I just spent the last two day's figuring this out for myself, I have tried every and what worked for me was under the Advanced option of the System Option, I Disabled "Prefer system libraries" and under the same menu i turned on "Reset Pulse Audio" and now the game goes past the logo crash and plays with no problem, and im using the GOG version of the game in lutris. without turning on the Reset of Pusle Audio the game will still run but with no sound. I really hope this helps anyone else out whose been having this same problem of the game crashing.

I just registered to say thank you. I qm getting into linux gaming with pop!_os and this is the second game i I tried to install (gog version). I tried to fix it with some tricks I found on the internet but no success. Then I installed it on Windows 10 and it also crqshed on startup (at a different point though). I already planned to refund the game and then I discovered your comment. This saved the day ;)

hensleym83 commented 2 years ago

Nice!!! I'm glad that you didn't give up and return the game, it is a fun playthrough. Game on!

Shy-Bell commented 2 years ago

It looks like its did not solve my problems completely. Although I managed to get into the main menu it crashed on loading. After some further tweaking I managed to load into the game. However the option reset pulse audio removes all my audio devices, the sound worked inside the game but was dead outside the game. I then found a thread proposing to install some stuff for wine audio. After doing that (and an error because of using apt-key or something) the game start without reseting pulse audio, which it did not previously. However now I have no sound. Even when I use reset pulseaudio which still kills my external sound card, I have no sound. So I went from bad to worse. Maybe I look into it further, but I have the feeling the more things I try the more broken my system gets :D

Edit: Okay one last update. I managed to get everything fixed and I do not need to reset pulseaudio and remove my sound devices. The only downside is I have to deactivate freesync in wine for this game. (maybe it still works through config file, I have no idea to be honest) Anyway what do I need to do:

  1. I followed this guide to add the winehq version https://www.gloriouseggroll.tv/how-to-get-out-of-wine-dependency-hell/
  2. Select the winehq staging version as wine version inside lutris
  3. disable "Prefer system libraries" (not sure if that is needed, but I kept it)