-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature request] Reuse common WINE components #1011
Comments
I agree with the premise of the post; for the ~10 or so games that I have installed that use proton, I'd say 8 or 9 are vanilla prefixes and my However I'm not sure about using third-party dependencies for it, unless of course, you want to do so manually without expecting Steam/Proton to use I think I have an idea for this issue and might cook up a POC and make a PR! |
sure I had some ideas for Proton earlier, but this "premature optimization" stops me from sharing ;) Anyway - it's mostly FYI. |
Maybe I should've explained what I meant by "premature optimization": It's not a bad idea and it should totally be implemented at some point, however I don't think the difference between a |
No you shouldn't I believe it's due to my English knowledge. It was too aggressive (many people noticed this)? |
Making hard-links (perhaps with an option in the steam UI to enable it) could also be a solution for this. I'm actually already doing this by using rdfind. (which can also make symlinks if preferred) |
Hardlinks is also an alternative, but overlay is much more simpler solution, IMHO. It's new for me, and I can't say it's safe, but It looks like you can redistribute all parts separately and combine all of them with one command (
Also there is some differences between 32bit and 64bit prefixes to note. Anyway sym/hard-linking is good-enough alternative for early stage. |
Well you can't hard-link an entire directory, so proton would have to recreate the entire directory structure and hard-link each file individually which would be less efficient the first time any game is run (when the hard/soft-link is being created) I will try doing both and maybe benchmark it Edit: Actually, after looking at the code, the function mergedirs can be modified slightly to use hardlinks instead of copying files |
It just sounds like a can of worms for OS compatibility to use something like fuse in the proton project. Haven't people gotten steam-linux to work on BSD? What about macOS compatibility? A more compatible option would be to implement overlays directly into wine, or possibly in a libc wrapper. But that might be as great a scope as supporting overlay filesystems on each OS. Although hard-links might be an issue as well for compatibility. ( I don't know if all POSIX-compliant file systems behave the same when hard links are involved. COW filesystems might also be an issue. ) |
@Elkasitu hard-link clones can be made with 'cp -l' for you to test, but my experience is that they are much faster than actually copying all the files. |
I think #136 is the best implementation choice. Overlayfs with COW would save a LOT of disk space. Using a COW registry patch would also be a good idea to reduce registry size AND allow updating of the base registry. The best way to do this is to just use the standard Windows tree method if Wine supports it of putting system-wide options in [hkey:localmachine] and game specific options in [hkey:localuser] (That Windows 2000 certification study is really coming in handy on this one.) |
Save space by using a generic prefix Issue transferred from #1806. Feature RequestI would like it if proton had a generic proton prefix (something like compatdata/proton/pfx) which it would use as the default prefix for all games that don't need prefix specific workarounds. This way potentially large amounts of disk space could be saved. I confirm:
DescriptionAs things stand, proton doesn't seem to do anything on a per-prefix basis for any game, so the compatdata directory with all the per-game prefixes is mostly just a collection of duplicate prefixes. On average these prefixes seem to add 1GB+ to space needed for installed games. Additionally, sometimes prefixes will be created with unrelated user files (for example save-games for other titles than the one the prefix is used for) further adding to this space use. This should be an option, whether it should be the default can be debated. As things stand it is better to have per-game prefixes because it allows for better testing (if users need to modify their prefix, let's say by installing .NET Framework or some DX redists, they may as a side effect be able to run other games out of the box too.) but when proton is more mature, having one generic prefix that can be used for all games that don't need specific workarounds would be highly preferable. I would suggest looking into how lutris handles prefixes (sometimes referred to by them as runners) for insights into better ways for implementing multiple prefixes while still using one (or few) prefixes for most games. JustificationExcessive use of disk space for no real gain to the end-user. (With just 14 games installed I am using 15gb of disk space for proton prefixes alone) RisksFalse compatibility reports from users who have modified their prefix. (This may be avoidable if steam/proton will install with a configuration utility, something similar to winetricks/protontricks, which would create a separate prefix for a target game when the user wants to make changes, preferably with an option to override the generic/main proton prefix as an option for advanced users/people who don't intend to make compatibility reports) @dlove67 commented on 2018-10-23T12:47:16 Symlinks could be a better option, since you could then keep the prefixes for each AppID, but push changes when needed. @lucifertdark commented on 2018-10-23T13:00:29 Proton already has a default prefix in the main Proton folder, for me it's in "Proton 3.16/dist/share/default_pfx" it's copying the contents of that to the compatdata folder for each game. |
Well I would have suggested that but both wine and steam seem to have issues with symlinks. I recall not being able to use proton if I symlinked my steam library to a different location for example. I believe it's because wine cannot follow symlinks to executables, or something like that. |
A little bit off-topic, but here is the similar thing for modular #!/bin/sh
# [FUSE-3](https://github.com/libfuse/libfuse)
# [fuse-overlayfs](https://github.com/containers/fuse-overlayfs)
if [ -z "$1" ]; then
echo "Usage: $0 <module1> [module2 ...]"
exit
fi
DISTDIR=dist
UPDIR=/tmp/fuse-t/updir
WRKDIR=/tmp/fuse-t/workdir
MODDIR=pmod
# umount if still mounted
fusermount3 -u "${DISTDIR}"
# WINE tree should be readonly
# so safely discard all changes made by user
rm -r "${UPDIR}" "${WRKDIR}"
# Recreate work dirs
mkdir -p "${UPDIR}" "${WRKDIR}"
# Module list
# reverse order, the left one "mounted" on top of the right one
MOD=${DISTDIR}
for m in $@; do
MOD="${MODDIR}/${m}:${MOD}"
done
# Create new "dist" tree
fuse-overlayfs -o lowerdir="${MOD}",upperdir="${UPDIR}",workdir="${WRKDIR}" "${DISTDIR}"
Module tree example:
DXVK winelib module is safe between WINE versions, but e.g. Well, the same thing, but w/o #!/bin/sh
export WINEPREFIX=/tmp/wtst
# safe
DXVK="/usr/lib64/dxvk-9999:/usr/lib/dxvk-9999"
DXUP="/usr/lib64/dxup-9999:/usr/lib/dxup-9999"
# not safe
PBA="$HOME/.local/lib64/pba-3.16-7:$HOME/.local/lib/pba-3.16-7"
STAGING_PARTS="$HOME/.local/lib64/st-3.16-7:$HOME/.local/lib/st-3.16-7"
export WINEMODPATH="$DXVK:$STAGING_PARTS"
export DXVK_HUD=full
wine /usr/bin/d3d11-triangle.exe.so Module tree example:
|
Partially resolved by recent WINE/Proton updates. |
Could you provide some reference or elaborate a bit more on this? I've played a bit around with overlayfs but it's in no way practical. |
https://www.winehq.org/pipermail/wine-devel/2019-April/143379.html AFAIK Hope same will happen to |
Yes, looks like it uses 4.8.2 for proton 4.2-3: update to wine-mono 4.8.2 Thank you for digging that links out. |
ok this is partially, but a function that make in all games, or a easy mode that put a game in a same prefix because latest proton update works for me in various games without make nothing to install depedents, a esay mode or a recommendation without use opfx |
I think some sort of FUSE based COW mount might be most effective for this. However, this does mean insuring that FUSE and Wine will play nice about this. |
Since version 5.0 WINE can use shared wine-gecko (2.47.1) installation for all prefixes. |
This issue is partially feature request and partially answer to #919
What are the use cases for a 32bit prefix?
question.I have a lot of separate prefixes for a long time and number is only growing, and this thoughts with me from the beginning: "how to reuse everything on new prefix creation". And the simplest way I've used is to create symlinks in freshly created prefix for
mono|gecko|Install|...
Imagine you have to install two copies of
Windows 98
... by copying an existing installation for every game you want to launch.$ equery s wine-vanilla
$ equery s wine-mono
$ equery s wine-gecko
All this after extracting into actual WINE prefix:
$ WINEPREFIX=/tmp/pfx wineboot --init
$ du -hs pfx
So the answer to the question "where I can get a few GiB for new game" was always the same: "check your recent prefixes ;)".
Symlinking does the trick, but required manual control. I always wanted an automated script using an overlayed FS, but was too lazy to investigate/implement such ability.
Today I decided to try userspace fuse overlayfs module, and seems it can be used (not completely sure, still playing with this) to create layered WINE prefix with common parts been reused.
$ fuse-overlayfs -o lowerdir=opfx-mono:opfx-base,upperdir=opfx-up,workdir=opfx-workdir opfx
$ WINEPREFIX=/tmp/opfx winecfg
$ fusermount3 -u opfx
All changes was made in
winecfg
are left inopfx-up
directory.opfx-base
- prefix init directoryopfx-mono
- directory where "mono|gecko|Install|..." was moved afteropfx-base
was created.opfx-workdir
AFAIK an technical directory forfuse
itself.$ du -hs opfx*
Any thoughts?
The text was updated successfully, but these errors were encountered: