Skip to content
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

Race Driver Grid Random Crashes to Desktop or DxvkMemoryAllocator: Memory allocation failed #3294

Closed
xatornet opened this issue Mar 20, 2023 · 21 comments

Comments

@xatornet
Copy link

Using DXVK, either version 2.1 or 1.10.3-Async, all seem to crash randomly given some minutes. The log shows
err: DxvkMemoryAllocator: Memory allocation failed sometimes, or simply won't give any error on the log, and crash to desktop.

Software information

Name of the Game: Race Driver: Grid
Settings Used: Irrelevant, it happens on any setting
OS System: Windows 11 Pro Build 22621.1413

System information

  • GPU: Nvidia RTX 3090
  • Driver: 531.29
  • Wine version: None (Windows native OS used)
  • DXVK version: v1.10.3-async / 2.1

Log files

DXVK2.1.log
DXVK1.10.3.log

@Blisto91
Copy link
Contributor

Hello.

If possible please try to make a apitrace 🙂

Also quickly test with 2.1 if making a file called dxvk.conf next to where the log appeared and inserting d3d9.allowDirectBufferMapping = false helps.
You can check in the log files afterwards if it was picked up.

@K0bin K0bin added the d3d9 label Mar 20, 2023
@K0bin
Copy link
Collaborator

K0bin commented Mar 20, 2023

#1318 strikes again

@doitsujin
Copy link
Owner

For 32-bit games on Windows you might want to patch the executable to enable the large address aware flag. Running out of address space is extremely common.

@K0bin
Copy link
Collaborator

K0bin commented Mar 20, 2023

The game sat at a comfortable 700MB when I tried it with DXVK. Does it only crash on particular courses?

@xatornet
Copy link
Author

xatornet commented Mar 20, 2023

Hello.

If possible please try to make a apitrace 🙂

Also quickly test with 2.1 if making a file called dxvk.conf next to where the log appeared and inserting d3d9.allowDirectBufferMapping = false helps. You can check in the log files afterwards if it was picked up.

Hi, If I use the d9d3.dll from the apitrace the game wont crash... maybe I'm not doing it right?

I'm going to try the dxvk.conf you suggested. Thanks

Edit, I've tried the conf command, here's the new log file, it shows :

err: Mapping non-persisted file failed: 8, Mapped memory: 90666624, Msg: No hay suficientes recursos de memoria disponibles para procesar este comando.

GRID_d3d9.log

@xatornet
Copy link
Author

The game sat at a comfortable 700MB when I tried it with DXVK. Does it only crash on particular courses?

I'm having a very random behaviour. On my main system crashes mostly on the main menu, but sometimes when getting into a LeMans track/category

@Blisto91
Copy link
Contributor

Blisto91 commented Mar 20, 2023

Hi, If I use the d9d3.dll from the apitrace the game wont crash... maybe I'm not doing it right?

That is fine and expected. apitrace is it's own thing and doesn't go through dxvk by default, it instead "records" all the d3d api calls the game makes and the devs can then look at them afterwards with out without dxvk.
So just upload a file where you've played a bit. If it usually crashes relatively fast then just play till after that if performance isn't too horrible.

Edit: I saw K0bin have the game so maybe this is unnecessary.

@K0bin
Copy link
Collaborator

K0bin commented Mar 20, 2023

Edit: I saw K0bin have the game so maybe this is unnecessary.

But I cant reproduce the problem.

@xatornet
Copy link
Author

@K0bin
Copy link
Collaborator

K0bin commented Mar 20, 2023

There's nothing obviously wrong with the apitrace either. It doesn't use a lot of memory.

@xatornet
Copy link
Author

xatornet commented Mar 20, 2023

It's weird. I've been tinkering in the past with the game, since I made a fix to repair the game's half baked 4+core cpu support, and uploaded it to PCGamingWiki. Back there was working fine, even Proton's implementation on SteamOS was tested and did really fine.

But today, some users got intouch from the PCGW, telling me that Grid was crashing using DXVK. So I tried it with or without cpu fix, to see If this was my doing, but, I've tried GOG stock release, and Steam stock release, and I cannot get into the main main menu with DXVK 2.1, and, If I use the old 1.10.3-Async, I get into the menu and even some races, but It will unavoidably crash to desktop.

I've tried it on my RTX 3090, but the users that were complaining, have a AMD Radeon RX6600...

I have a couple of systems here, with an Intel IGP and another with a 1060 and 1050ti. I'm gonna try there too and post logs if you want.

@Blisto91
Copy link
Contributor

I will try on Windows later when i have time.

@xatornet
Copy link
Author

Ok, I've been tinkering some more. I've narrowed the problem to the way the bloody game detectss the resolution, or should I say, limits the resolution output.

On system/hardware_settings_restrictions.xml, there's this line:

<data> <res mem="270" maxWidth="1280" /> </data>

It tries to limit the memory and maxWidth resolution for the game to detect on first boot. But it's a cluster fuck, as some systems won't detect the resolution properly, others will need maxWidth adjusted to their real max res, other won't need it, and others will refuse to work at all. And If you delete that limitation alltogether, it will randomly work or not. So, to sum up, I think it has nothing to do with DXVK, so I'm gonna close the issue, not without apologizing for wasting your time.

Thank you guys and sorry for the inconvenience

@xatornet
Copy link
Author

My dear friends, I'm back for more :-?

I've revisited everything in this game, and made some other tinkering. Even downloaded other EGO Engine games to tinker some more. I can say that the game works normally on my end, but, as soon as I put DXVK the game crashes to desktop every time a race is loading. And this is the log:

grid_d3d9.log

On some systems it seems to be working fine, but on the one with my RTX 3090 it goes mad.

@xatornet xatornet reopened this Mar 20, 2023
@K0bin
Copy link
Collaborator

K0bin commented Mar 20, 2023

There's probably nothing we can do here. DXVK hasn't even allocated a lot of memory. Just 162 MB of system memory.

Can you make another apitrace?

@xatornet
Copy link
Author

There's probably nothing we can do here. DXVK hasn't even allocated a lot of memory. Just 162 MB of system memory.

Can you make another apitrace?

https://drive.google.com/file/d/1s4oP82qN94yd9mqavH97LgbKKW7-7e3m/view?usp=sharing

Maybe EGO Engine 1.0 is not very friendly of DXVK. Dirt 2, which uses the same engine, does not really like DXVK too, not even the hud works...

@K0bin
Copy link
Collaborator

K0bin commented Mar 20, 2023

Dirt 2 seems to work fine: https://www.protondb.com/app/690790
Same for GRID: https://www.protondb.com/app/255220

@xatornet
Copy link
Author

Dirt 2 seems to work fine: https://www.protondb.com/app/690790 Same for GRID: https://www.protondb.com/app/255220

Those are not the same Games. I'm testing Race Driver GRID (2008) , and talking about Colin McRae Dirt 2 (2009).

The two from the protondb are from 2014(Autosport) and 2019(Dirt Rally 2.0) . Totally different iterations of EGO engine.

@jrugia
Copy link

jrugia commented Mar 20, 2023

From my experience the first GRID and Dirt games easily ran out of virtual memory on Linux, especially with dxvk. I don't know about Windows but maybe the issue is related?

As doitsujin already mentioned, patching the exe with large address aware flag helps. I haven't had a single memory issue in years since doing so.

@xatornet
Copy link
Author

From my experience the first GRID and Dirt games easily ran out of virtual memory on Linux, especially with dxvk. I don't know about Windows but maybe the issue is related?

As doitsujin already mentioned, patching the exe with large address aware flag helps. I haven't had a single memory issue in years since doing so.

Until further testing, seems that patching with 4GB kinda works. It also breaks the shitty drm from the steam release, but it's fixeable. I'll test it in GOG release tomorrow, and if all works, I'll close the issue.

Thanks you guys

@xatornet
Copy link
Author

Alright, After testing it on GOG an Steam this are the results:

DXVK works fine.

On AMD GPUs seems that disabling the mem restriction kinda improves the crashing threshold.

The game needs a hardware_settings_restrictions.xml mod to properly fix the pile of s*** of settings detection that it has. (Doing it now, check PCGW)

And, as you guys suggested, 4GB patch for the exe file is NEEDED in order for it not to crash with DXVK. Warning to users: Steam exe file will crash if 4GB patch is applied without removing DRM first.

Anyway, thanks for everything guys!! You rock :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants