Proton: DXVK DLLs are compiled in debug mode

Created on 23 Aug 2018  路  8Comments  路  Source: ValveSoftware/Proton

Browsing through the Proton install directory, it appears that the DXVK binaries are

  • Not stripped (the two 64-bit DLLs are over 120MB in size, compared to 3.6 MB of the release DLLs)
  • Possibly compiled in debug mode rather than release mode, which can reduce performance by as much as 50%. This might be causing the performance regressions compared to Lutris builds reported in #186 .

Most helpful comment

Looking at the script, it might be hitting some weird edge case in Meson where it doesn't pick up changes made to certain variables when running inside a script (as opposed to an interactive shell). This has been causing problems before, particularly with -Dprefix and -Dbuildtype.

Just for the record, this is not a Meson bug. This is a Ninja bug, which was fixed in October 2017 but a new release with the fix has not been made yet.

The basic issue is that if you make changes to the files generated by Meson too quickly (<1-2 seconds after they are generated), Ninja won't know because it only stores timestamps with resolution in seconds, so it doesn't trigger a meson reconfigure with the new buildtype. Now Ninja has nanosecond resolution, so this should be fixed as soon as Ninja makes a new release.

If you run into other CI issues related to this, I would recommend building your own executable from Ninja master or using the binaries that we at Meson use for our CI.

All 8 comments

I have about a 10-20% performance loss in The Forest, I'd send screenshots but recently I can't get the game past the intro screen on Steam Play, it works fine on Lutris.

I remember accidentally testing debug DXVK for way longer than I should have, so I can certainly believe we would have accidentally done that in the build system too. Will have to check, thanks for the report!

Not stripping might be desirable if we move both flavours to winegcc, so people can profile and get symbols; right? I would hope it doesn't make a perf difference, even in terms of I/O during loading, since only the code segments get mapped.

Actually I'm rather convinced now that these are unoptimized debug builds because even my unstripped release builds are only around 14MB per DLL.

Not stripping might be desirable if we move both flavours to winegcc, so people can profile and get symbols; right?

Fair enough, but about that, there have been reports that the 32-bit winelib builds are unstable in games that work fine with the mingw builds for some reason. I'll have to take a closer look at that next week.

Hrm, seems like the build system is trying to do the right thing:

https://github.com/ValveSoftware/Proton/blob/proton_3.7/build_proton.sh#L457

Not sure what might be happening offhand, then; I'll leave it in Andrew's capable hands to check that everything is doing what it should during the build.

Looking at the script, it might be hitting some weird edge case in Meson where it doesn't pick up changes made to certain variables when running inside a script (as opposed to an interactive shell). This has been causing problems before, particularly with -Dprefix and -Dbuildtype.

So instead of doing this:

meson --prefix="$TOP"/build/dxvk.win32 --cross-file build-win32.txt "$TOP"/build/dxvk.win32
meson configure -Dbuildtype=release

It actually should be doing the following:

meson --buildtype "release" --prefix="$TOP"/build/dxvk.win32 --cross-file build-win32.txt "$TOP"/build/dxvk.win32

Maybe throw in --strip as well as long as we're using mingw builds, since the debug info doesn't currently add much value.

This is fixed, and pushed to the live branch of Proton 3.7, hopefully.

Looking at the script, it might be hitting some weird edge case in Meson where it doesn't pick up changes made to certain variables when running inside a script (as opposed to an interactive shell). This has been causing problems before, particularly with -Dprefix and -Dbuildtype.

Just for the record, this is not a Meson bug. This is a Ninja bug, which was fixed in October 2017 but a new release with the fix has not been made yet.

The basic issue is that if you make changes to the files generated by Meson too quickly (<1-2 seconds after they are generated), Ninja won't know because it only stores timestamps with resolution in seconds, so it doesn't trigger a meson reconfigure with the new buildtype. Now Ninja has nanosecond resolution, so this should be fixed as soon as Ninja makes a new release.

If you run into other CI issues related to this, I would recommend building your own executable from Ninja master or using the binaries that we at Meson use for our CI.

Whoops, sorry for misattributing the problem on Twitter then! Thanks for the explanation, that makes more sense now; pretty serious bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AwesamLinux picture AwesamLinux  路  3Comments

lucifertdark picture lucifertdark  路  3Comments

shanefagan picture shanefagan  路  3Comments

Elkasitu picture Elkasitu  路  3Comments

leifmetcalf picture leifmetcalf  路  3Comments