Sounds like a compiler bug? That being said, why not simply add -march=native in dxvk's Meson script instead of -msse3 and friends? You'd still want the sse math among other things that are already in there.
Also note -march=native can be rather problematic in this day and age when (as an example) disabling your E cores may expose instructions specific to your P cores. And indeed, I have tested this myself a while back (worked for me at least), but it brings little if any benefit.
What error does the games crash with in log?
Edit: Just attach a full Proton log
Indeed, has to be a compiler bug. I reviewed this document. I went through and added every instruction -m flag that is listed under znver2 to the Meson.build file. Arma 3 works again. Thank you Winter for the suggestion.
Can repro, got a crash with 0x006ffffd515001 d3d11+0xc5001: vmovdqa %ymm0, 0x40(%rsp)
This pretty much proves that there has to be some sort of stack alignment issue somewhere. I'm not entirely sure what's going on here, stack alignment is 16 and not 32 so this kind of code should never be emitted, and we don't really use alignas(≥32) on anything that's stack-allocated either...
Still looks like a compiler issue though and it doesn't look like it's possible to work around that, short of not allowing the use of ymm registers (i.e. no avx, not sure if there's a way to only allow 128-bit AVX).
If you want DXVK with AVX, you'll need to build with MSVC or Clang+Mingw, GCC+Mingw needs a special patch, and the compiler aligning to 32 may be due to AVX 256 znver2
After taking a second look at the GCC doc, there is this flag -mprefer-avx128. Used openSUSE's Build Service to produce a patched Mingw here. Added these flags to the Meson.build file:
'-march=native',
'-mtune=native',
'-mprefer-avx128',
'-mno-align-vector-insn',
Success!
Using the one game I own that has a benchmark which pumps out frames and is consistent between runs: Company of Heroes 1 on lowest settings. Here are the results:
GCC No custom flags
Avg 425.5 Max 611.0 Min 175.8
GCC Natived
Avg 431.7 Max 620.0 Min 176.8
Proton Experimental Bleeding Edge
Avg 456.6 Max 627.0 Min 186.0
Used openSUSE's Build Service to produce a patched Mingw
Very good 😊, I see you've used the patch and are using the new flag, if you're going to try Graphite optimizations I recommend building against isl 0.25, in my tests it's more consistent than 0.26
Edit: Looking at the spec of your Mingw you can improve this result, the performance difference for the DXVK built by Valve is the dwarf exception, your GCC+Mingw is sjlj exception, you can add in the .spec and build again that should decrease this difference:
mingw32-gcc with:
--disable-sjlj-exceptions
--with-dwarf2 \
mingw64-gcc with:
--disable-sjlj-exceptions \
Edit: Looking at the spec of your Mingw you can improve this result, the performance difference for the DXVK built by Valve is the dwarf exception, your GCC+Mingw is sjlj exception, you can add in the .spec and build again that should decrease this difference:
mingw32-gcc with: --disable-sjlj-exceptions --with-dwarf2 \
mingw64-gcc with: --disable-sjlj-exceptions \
Done. Thank you kindly
Edit: New result:
Avg 464.3 Max 638.0 Min 191.4
Excellent. Thank you @ViNi-Arco !
I don't know if this is proper etiquette for this type of thing. but I'd like to thank everyone that participated. I would have been lamenting in my ignorance if not for you. @doitsujin for the technical explanation that led me to look for the 128 flag. @WinterSnowfall for the proper way to pass the flags. @ViNi-Arco for the patch and optimization tips. And @Blisto91 for being super. Greatly Appreciated.
A small note for those who face the same issue: rebuild mingw with -mno-align-vector-insn patch is not necessary, this issue is fixed by adding flag -mpreferred-stack-boundary=2 for 32-bit DXVK DLLs, at least tested in CoH, without it the game indeed crashes with -march=native. By adding this flag in Wine's upstream, many similar game crashing issues when using AVX have been also fixed:
https://gitlab.winehq.org/wine/wine/-/commit/4b458775bb8c9492ac859cfd167c5f54f245dec1
proton experimentalx2 2024-11
compile commands:
test environment:
I recreated Proton Experimental bleeding edge's folder structure in /Steam/compatibilitytools.d/ and symlinked all files sans dxvk dlls.
Games tested: Arma 3 for 64bit and Company of Heroes 1 for 32bit. Arma 3 makes it to the splash screen then crashes. CoH pops up it's crash report mailer.
-march=x86-64-v3 also fails. -march=x86-64-v2 works with reduced performance. compiling without custom flags works fine. My cpu is AMD zen2 3500x
I skimmed the discussion about how adding newer instruction sets does nothing basicly. So no biggie I suppose.
Hopefully I'm not being an idiot again.