Frogging-Family / dxvk-tools

dxvk and vkd3d-proton scripts to build/patch/install/update, Lutris and Proton-tkg compatible
60 stars 13 forks source link

feature request: experimental wow64 prefix support #24

Open gel-crabs opened 1 year ago

gel-crabs commented 1 year ago

Okay, so I was having troubles with the new wow64-only mode in Wine, and I eventually found out that the problem was not with Wine, but with DXVK, as it installs both the 64-bit and 32-bit libraries into the wineprefix.

I found a quick solution, which is copying the DXVK dlls from the syswow64 directory to the system32 directory in the wineprefix.

Could there be a wow64 option in updxvk.cfg to install the 64-bit libraries into both folders? Thank you

TheComputerGuy96 commented 1 year ago

@gel-crabs What troubles were you having exactly?

gel-crabs commented 1 year ago

It would crash immediately after starting any application, I'll reproduce it now

gel-crabs commented 1 year ago

image

Crashes like this

IroAlexis commented 1 year ago

With wow64 experimental mode, the Windows folder for storing 32-bit dlls still exists. So if you build dxvk only in 64bits, you can't launch 32bits game... Normally, dxvk 32-bit dlls are to be copied into the C:\windows\syswow64 folder and 64-bit dlls are to be copied into the C:\windows\system32 folder.

Perhaps you've stumbled across a regression of this new mode. What game are you trying to launch?

TheComputerGuy96 commented 1 year ago

@IroAlexis I installed DXVK the normal way (64-bit DLLs in System32 and 32-bit DLLs in SysWOW64) and the Direct3D games I tried so far don't have crashing issues in WoW64 mode

gel-crabs commented 1 year ago

I tried that way with 64-bit DLLs in System32 and 32-bit DLLs in SysWOW64 and it worked! The game I am running is 64-bit and in the Unity engine.

I reran the updxvk script with "wine=wine updxvk (prefix)" as updxvk tries to use wine64, and I found that updxvk creates links in the system32 directory to the x32 DLLs, and does not create DLLs in the syswow64 directory at all.

IroAlexis commented 1 year ago

Indeed, there isn't wine64 when we compile wine for use new wow64 mode.

I think you can close the issue. But, the script would have to be modified to support this new mode.

TheComputerGuy96 commented 1 year ago

@IroAlexis Symlinking the wine binary to wine64 for WoW64 builds would be nice (but I discovered you don't even need to recompile Wine for WoW64 support)

gel-crabs commented 1 year ago

@IroAlexis Symlinking the wine binary to wine64 for WoW64 builds would be nice (but I discovered you don't even need to recompile Wine for WoW64 support)

FYI I tried that as well, however it has the same results as running the script with wine=wine.

gel-crabs commented 1 year ago

A quick and dirty fix: go to DXVKBUILD and edit setup_dxvk32.sh. Find the line that says:

unix_sys_path="$($wine winepath -u 'C:\windows\system32')"

Change it to:

unix_sys_path="$($wine winepath -u 'C:\windows\syswow64')"

Note that you will have to rebuild DXVK, and either export wine=wine or symlink wine to wine64.

IroAlexis commented 1 year ago

@IroAlexis Symlinking the wine binary to wine64 for WoW64 builds would be nice (but I discovered you don't even need to recompile Wine for WoW64 support)

As far as I understand, we don't need wine64 because the wine binary is already 64bits.

New wow64 mode

$ file /opt/wine-tkg-clean-mainline-git/bin/wine
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0e9684a898600bfbd53520b2b3e895a9c086c1e2, for GNU/Linux 4.4.0, not stripped

"Old" wow64 mode

$ file /usr/bin/wine
ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=4533cb08e860624ab1c81c51ee4b4943250002c0, for GNU/Linux 4.4.0, stripped
$ file /usr/bin/wine64
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=2e9c2f55ac3747ffbb8a864aa5ce9609f4497a55, for GNU/Linux 4.4.0, stripped
gel-crabs commented 1 year ago

@IroAlexis Symlinking the wine binary to wine64 for WoW64 builds would be nice (but I discovered you don't even need to recompile Wine for WoW64 support)

As far as I understand, we don't need wine64 because the wine binary is already 64bits.

New wow64 mode

$ file /opt/wine-tkg-clean-mainline-git/bin/wine
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0e9684a898600bfbd53520b2b3e895a9c086c1e2, for GNU/Linux 4.4.0, not stripped

"Old" wow64 mode

$ file /usr/bin/wine
ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=4533cb08e860624ab1c81c51ee4b4943250002c0, for GNU/Linux 4.4.0, stripped
$ file /usr/bin/wine64
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=2e9c2f55ac3747ffbb8a864aa5ce9609f4497a55, for GNU/Linux 4.4.0, stripped

Yes, however the script uses wine64 for 64-bit prefixes by default; without it, it will not update the 64-bit dlls.

IroAlexis commented 1 year ago

A quick and dirty fix: go to DXVKBUILD and edit setup_dxvk32.sh. Find the line that says:

unix_sys_path="$($wine winepath -u 'C:\windows\system32')"

Change it to:

unix_sys_path="$($wine winepath -u 'C:\windows\syswow64')"

Note that you will have to rebuild DXVK, and either export wine=wine or symlink wine to wine64.

Indeed, it is a potential fix but even syswow64 directory don't exist, winepath return the path... (I'll check again later as my tests are a bit dated Confirmed)

gel-crabs commented 1 year ago

A quick and dirty fix: go to DXVKBUILD and edit setup_dxvk32.sh. Find the line that says:

unix_sys_path="$($wine winepath -u 'C:\windows\system32')"

Change it to:

unix_sys_path="$($wine winepath -u 'C:\windows\syswow64')"

Note that you will have to rebuild DXVK, and either export wine=wine or symlink wine to wine64.

Indeed, it is a potential fix but even syswow64 directory don't exist, winepath return the path... (I'll check again later as my tests are a bit dated)

Yes, editing it in this way will make it only work for wow64 prefixes, it isn't a permanent fix by any means

IroAlexis commented 1 year ago

@IroAlexis Symlinking the wine binary to wine64 for WoW64 builds would be nice (but I discovered you don't even need to recompile Wine for WoW64 support)

As far as I understand, we don't need wine64 because the wine binary is already 64bits. New wow64 mode

$ file /opt/wine-tkg-clean-mainline-git/bin/wine
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0e9684a898600bfbd53520b2b3e895a9c086c1e2, for GNU/Linux 4.4.0, not stripped

"Old" wow64 mode

$ file /usr/bin/wine
ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=4533cb08e860624ab1c81c51ee4b4943250002c0, for GNU/Linux 4.4.0, stripped
$ file /usr/bin/wine64
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=2e9c2f55ac3747ffbb8a864aa5ce9609f4497a55, for GNU/Linux 4.4.0, stripped

Yes, however the script uses wine64 for 64-bit prefixes by default; without it, it will not update the 64-bit dlls.

Yes script use wine64 but in new wow64 mode, there is only wine and and therefore the command $($wine winepath -u 'C:\windows\system32') return /home/user/myprefix/dosdevices/c:/windows/system32. It's more the 32-bit dlls that aren't updated?