protontricks
protontricks copied to clipboard
Protontricks is extremely slow
Describe the bug
When running protontricks, it's expected to work pretty much exactly how winetricks would (in terms of performance), even under bwrap it shouldn't produce too bad results. But in reality everything that i do with protontricks runs like 5 times slower. Even if i do --no-bwrap
- it's still extremely slow.
To Reproduce Steps to reproduce the behavior:
- Try installing anything on any game using protontricks (in my case it's dotnet 4.8, or faudio, doesnt matter much)
- Protontricks installs at least 5 times slower than it should
Expected behavior Protontricks shouldn't run that slow
System:
- Distro: Void Linux
- Protontricks version: protontricks (1.6.0)
- Steam version: Both beta and stable are affected, checked this case on laptop too
Additional context
I use fish under bash, and thought it might be related, but - winetricks anyway runs under sh and winetricks works fine
In logs i noticed that wine-gecko couldn't be found, but i do have it installed system-wide (though it's only 1 file (/usr/share/wine/gecko/wine-gecko-2.47.2-x86.msi
) and i probably need to install it manually?
At the same time this wine-gecko line appears every time it stops or hangs which introduces a lot of delays
Protontricks is also slow even on another pc with the same distro (Void)
If the error happens when trying to run a Protontricks command, run the command again using the -v
flag and copy the output!
It's not a full log because it takes at least 20 mins to go only halfway through and painfully slow
protontricks_log
It sounds weird that Protontricks is running slow even with --no-bwrap
. In that scenario, Protontricks adds the following "proxy script" for every Proton executable such as wine
, wineserver
and such:
#!/bin/bash
# Helper script created by Protontricks to run Wine binaries using Steam Runtime\n"
export LD_LIBRARY_PATH="$PROTON_LD_LIBRARY_PATH"
exec "$PROTON_DIST_PATH"/bin/{name} "$@"
This obviously shouldn't increase runtime much at all, so I suspect something related to your distro or Wine/Proton itself might be at play.
Having bwrap enabled uses Steam Runtime's run
script makes the startup time a lot longer due to bwrap setting up the environment, as well as any Steam Runtime specific features (eg. exposing graphics drivers from the host system). This makes it similar to how Steam itself runs Proton and thus improves compatibility, especially with older distros.
You could try opening a shell within Protontricks and checking individual commands using time
or some other tool. For the record, these are the results I get with bwrap on and off:
# Bwrap on, just print the version
$ protontricks -c bash 753640
$ time wine --version
wine-6.3
real 0m0,966s
user 0m0,609s
sys 0m0,599s
# Bwrap on, run an EXE command
$ time wine cmd.exe /c echo '%AppData%'
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
C:\users\steamuser\AppData\Roaming
real 0m5,336s
user 0m2,502s
sys 0m1,494s
# Bwrap off, just print the version. Basically instantaneous.
$ protontricks --no-bwrap -c bash 753640
$ time wine --version
wine-6.16 (Staging)
real 0m0,004s
user 0m0,004s
sys 0m0,000s
# Bwrap off, run an EXE command
$ time wine cmd.exe /c echo '%AppData%'
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
C:\users\steamuser\AppData\Roaming
real 0m0,867s
user 0m0,084s
sys 0m0,052s
How do your numbers compare to these?
Running cmd with echo results in quite high delay
plyshka@plyshkapc ~ [255]> protontricks -c bash 244850
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
plyshka@plyshkapc ~/.l/s/S/s/c/SpaceEngineers> time wine --version
wine-5.0-655-g2409bd1
________________________________________________________
Executed in 15.05 millis fish external
usr time 2.16 millis 432.00 micros 1.73 millis
sys time 3.58 millis 94.00 micros 3.49 millis
plyshka@plyshkapc ~/.l/s/S/s/c/SpaceEngineers> time wine cmd.exe /c echo '%AppData%'
wineserver: using server-side synchronization.
C:\users\steamuser\Application Data
________________________________________________________
Executed in 8.17 secs fish external
usr time 156.49 millis 0.00 micros 156.49 millis
sys time 735.72 millis 800.00 micros 734.92 millis
plyshka@plyshkapc ~/.l/s/S/s/c/SpaceEngineers> 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
plyshka@plyshkapc ~/.l/s/S/s/c/SpaceEngineers> exit
plyshka@plyshkapc ~> protontricks --no-bwrap -c bash 244850
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
plyshka@plyshkapc ~/.l/s/S/s/c/SpaceEngineers> time wine --version
wine-5.0-655-g2409bd1
________________________________________________________
Executed in 6.83 millis fish external
usr time 3.98 millis 271.00 micros 3.70 millis
sys time 2.84 millis 69.00 micros 2.77 millis
plyshka@plyshkapc ~/.l/s/S/s/c/SpaceEngineers> time wine cmd.exe /c echo '%AppData%'
wineserver: using server-side synchronization.
C:\users\steamuser\Application Data
________________________________________________________
Executed in 6.71 secs fish external
usr time 122.56 millis 0.00 micros 122.56 millis
sys time 609.85 millis 700.00 micros 609.15 millis
plyshka@plyshkapc ~/.l/s/S/s/c/SpaceEngineers> 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
If i open bash instead in this shell, it's still very slow
With latest proton (6.3) and clean prefix, the results differ in no-bwrap but it's not instant
plyshka@plyshkapc ~> protontricks -c bash 945360
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> time wine --version
wine-6.3
________________________________________________________
Executed in 1.29 secs fish external
usr time 1.02 secs 0.00 micros 1.02 secs
sys time 0.99 secs 726.00 micros 0.99 secs
plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> time wine cmd.exe /c echo '%AppData%'
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
C:\users\steamuser\AppData\Roaming
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
________________________________________________________
Executed in 5.52 secs fish external
usr time 1.80 secs 511.00 micros 1.80 secs
sys time 2.02 secs 130.00 micros 2.02 secs
plyshka@plyshkapc ~> protontricks --no-bwrap -c bash 945360
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> time wine --version
wine-6.3
________________________________________________________
Executed in 8.18 millis fish external
usr time 4.29 millis 0.00 micros 4.29 millis
sys time 3.90 millis 669.00 micros 3.23 millis
plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> time wine cmd.exe /c echo '%AppData%'
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
002c:err:winediag:WS_getaddrinfo Failed to resolve your host name IP
C:\users\steamuser\AppData\Roaming
________________________________________________________
Executed in 1.89 secs fish external
usr time 88.05 millis 0.00 micros 88.05 millis
sys time 153.80 millis 585.00 micros 153.22 millis
plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
With latest proton (6.3) and clean prefix, the results differ in no-bwrap but it's not instant
plyshka@plyshkapc ~> protontricks -c bash 945360 Welcome to fish, the friendly interactive shell Type help for instructions on how to use fish plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> time wine --version wine-6.3 ________________________________________________________ Executed in 1.29 secs fish external usr time 1.02 secs 0.00 micros 1.02 secs sys time 0.99 secs 726.00 micros 0.99 secs plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> time wine cmd.exe /c echo '%AppData%' wineserver: using server-side synchronization. wine: RLIMIT_NICE is <= 20, unable to use setpriority safely C:\users\steamuser\AppData\Roaming 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002 ________________________________________________________ Executed in 5.52 secs fish external usr time 1.80 secs 511.00 micros 1.80 secs sys time 2.02 secs 130.00 micros 2.02 secs
plyshka@plyshkapc ~> protontricks --no-bwrap -c bash 945360 Welcome to fish, the friendly interactive shell Type help for instructions on how to use fish plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> time wine --version wine-6.3 ________________________________________________________ Executed in 8.18 millis fish external usr time 4.29 millis 0.00 micros 4.29 millis sys time 3.90 millis 669.00 micros 3.23 millis plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> time wine cmd.exe /c echo '%AppData%' wineserver: using server-side synchronization. wine: RLIMIT_NICE is <= 20, unable to use setpriority safely 002c:err:winediag:WS_getaddrinfo Failed to resolve your host name IP C:\users\steamuser\AppData\Roaming ________________________________________________________ Executed in 1.89 secs fish external usr time 88.05 millis 0.00 micros 88.05 millis sys time 153.80 millis 585.00 micros 153.22 millis plyshka@plyshkapc ~/.l/s/S/s/c/Among Us> 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017 0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
Though looking at the results, they are quite similar to yours... Maybe there some compatibility issues with older proton? Older proton is still widely used because you can't install properly latest .net framework on latest wine versions
I can reproduce that Proton 5.0 has a lot longer startup delay than the newer versions which is unrelated to bwrap. Running strace
on the parent wine
process hangs on for a while on a single read
syscall, while enabling WINEDEBUG
(which causes all Wine-related processes to start logging) causes a steady stream of logs. I'm guessing Wine takes longer to finish booting its background processes for some reason?
The issue doesn't appear to be unique to Protontricks, though it is far less noticeable when starting a game on Steam as that long startup occurs only once per launch. Winetricks on the other hand can run dozens of Wine commands during the course of a single Protontricks/Winetricks command, where this delay starts to add up. This is not something that can be fixed on the Protontricks side of things, unfortunately.
Yeah it has run slower for me also with all proton versions inc GE. Still eventually gets the job done...
I've looked into this issue again and have been working on a feature to improve startup time. The WIP version of the fix can be found in keep_wineserver_alive branch.
The short version is that the change decreases startup time for a single Wine command from ~6 seconds to around 1.7 seconds:
# Before
$ protontricks -c "perf stat -r 5 wine cmd.exe /c echo %AppData%" 740130
5,9531 +- 0,0205 seconds time elapsed ( +- 0,34% )
# After
$ protontricks -c "perf stat -r 5 wine cmd.exe /c echo %AppData%" 740130
1,725 +- 0,317 seconds time elapsed ( +- 18,40% )
If you're using pipx, you can install the WIP fix like so:
$ pipx install --force git+https://github.com/Matoking/protontricks.git@keep_wineserver_alive
I'll look into pushing a new version with the improvement after some more work, since slow performance with Winetricks has been a sticking point for a long time.
The longer version is that a large part of why bwrap has been so slow is that every individual Wine command also causes a wineserver (roughly analogous to Linux's init process) to be started up and shut down during each command. This isn't a problem when bwrap is not used, since the wineserver is not bound to a single Wine process and can continue execution in the background. With bwrap, however, each container is cleaned up after running the command, taking the Wine process and the wineserver inside it with it as well.
The solution is to instead launch the wineserver in a separate container and keep it alive for the entire duration of the Protontricks command, after which it is terminated. Since each container shares the same process namespace, other Wine processes are able to use the wineserver even if it's launched inside a different container, greatly decreasing startup time.
I've pushed the aforementioned change and another performance fix into the development branch. The second fix reuses an existing container instead of launching one for each Wine command (which feels somewhat obvious in hindsight). With both of these changes in place, the startup time has been reduced drastically for the default configuration with bwrap enabled:
# Before (consistently ~6 seconds)
$ protontricks -c "perf stat -r 5 wine cmd.exe /c echo %AppData%" 740130
5,9531 +- 0,0205 seconds time elapsed ( +- 0,34% )
# After (settles at around 0.3-0.4 seconds after a short warmup)
$ protontricks -c "perf stat -r 5 wine cmd.exe /c echo %AppData%" 740130
0.929 +- 0.671 seconds time elapsed ( +- 72.19% )
The "background wineserver" is only enabled for bwrap by default, but you can force it manually using the --background-wineserver
command-line flag (eg. protontricks --background-wineserver <appid> <command>
). I didn't notice a great difference in startup time without bwrap, but your mileage may vary.
I'll look into releasing a new version shortly with the performance improvements, but you can install the development version using the instructions in the README to use them immediately.