What's happening here is that the game creates several hundred ~4MB textures and immediately destroys them again. This sounds dumb, but it unfortunately somewhat "common" since apparently plain D3D9 has no way to query available VRAM.
What's the GTT size on your APU system (cat /sys/module/amdgpu/parameters/gttsize as root)? If it's anything less than 6144 (i.e. 6GB) you'll probably want to adjust it since other games would run out of memory too, if you have 16GB of RAM available it should probably be even bigger.
As another workaround, DXVK_CONFIG="d3d9.maxAvailableMemory=1024;d3d9.memoryTrackTest=True" may work for this particular game.
The laptop has:
cat /sys/module/amdgpu/parameters/gttsize returns -1 for some reason):
If [the GTT is] anything less than 6144 (i.e. 6GB) you'll probably want to adjust it
How do I do that?
I looked at the BIOS, and there's an option to adjust the amount of VRAM (decreasing both regular RAM and GTT) up to 2 GB. With 2 GB of VRAM the game launches, with 1 GB or 512 MB it doesn't.
Still, this is an old game whose system requirements ask for 1 GB of RAM and 256 MB of VRAM.
As another workaround,
DXVK_CONFIG="d3d9.maxAvailableMemory=1024;d3d9.memoryTrackTest=True"may work for this particular game.
It indeed does work.
Still, this is an old game whose system requirements ask for 1 GB of RAM and 256 MB of VRAM.
Yes, but the game is deliberately trying to fill up all available memory until resource creation fails with an out-of-memory error. DXVK can't really do an awful lot to prevent the crash from happening out of the box, although we might just add an app profile for this particular game.
How do I do that?
May depend on your distro, but the tl;dr is to set amdgpu.gttsize=6144 (or maybe just 5632 to account for the 512MB carveout) at boot time, either using this (which should apply to most common distros), or passing it as a kernel parameter via your boot loader.
I looked at the BIOS, and there's an option to adjust the amount of VRAM (decreasing both regular RAM and GTT) up to 2 GB. With 2 GB of VRAM the game launches, with 1 GB or 512 MB it doesn't.
I wiouldn't fuck around with this option since, as you mentioned, it decreases available system memory.
set
amdgpu.gttsize=6144
By doing so, whether the game launches becomes inconsistent like in DXVK 2.4.1 (though the odds seem worse).
When it does crash (and doesn't bring down the rest of the computer alongside it), the error log is either the same as DXVK 2.4.1, or a new one:
radv/amdgpu: The CS has been cancelled because the context is lost. This context is innocent.
we might just add an app profile for this particular game.
Unfortunately, the developers at Beenox decided to name the executable Game.exe...
If we go by default installation directory, it's Spider-Man Shattered Dimensions on the physical release, or Spider-Man (TM) SD on the (delisted) Steam release.
(Small note, the same developers made with the same engine The Amazing Spider-Man (2012) and The Amazing Spider-Man 2 (2014). I don't have these, I'm writing it just for search purposes if someone has the same issue with them.)
When launching Spider-Man: Shattered Dimensions on a weaker device, the game will crash on startup, likely accompanied by a desktop environment reset.
Looking at the logs, it shows the error message
radv/amdgpu: Not enough memory for command submission.By looking at a trace where it does get ingame (that is, with WineD3D, or on a more powerful computer), it shows that in the third frame, there's an enormous spam of
IDirect3DQuery9::GetData.On a crashing trace, the third frame has an even bigger spam, so big that it even crashes
qapitraceif trying to expand it.Testing various versions of DXVK, I found that the issue got worse since DXVK 2.5: on 2.4.1, the same weaker computer sometimes (it's inconsistent) does get ingame, and when it does not the error logs are different. (I don't know if that's related, but I point it out for exhaustiveness.)
Software information
Spider-Man: Shattered Dimensions, launched on a clean Wine prefix.
System information
Apitrace file(s)
Attaching them here since they are small by virtue of crashing on startup.
For the ones that don't crash, I ALT+F4 as soon as the logo appears.
Log files