Gcenx / macOS_Wine_builds

Official Winehq macOS Packages
461 stars 23 forks source link

building wine, cannot find macdriver #15

Closed nsklaus closed 3 years ago

nsklaus commented 3 years ago

hi all

using a macbook m1 with latest big sur, i tried to compile wine myself, using latest sources: wine6rc2. compile went fine. i used build options listed on this repo's frontpage readme. i installed all the dependencies through homebrew (full rosetta, i checked the option to run the terminal itself with it).

here's what i got:

-> klaus $ wine64 --version
wine-6.0-rc2
-> klaus $ file $(which wine64)
/usr/local/bin/wine64: Mach-O 64-bit executable x86_64
-> klaus $ 

but the problem i'm seeing is that wine runs, but, doesn't seem to find the gpu/macdriver at all. i was wondering if folks around this repo might have an idea about what went wrong, maybe i forgot to add a specific configure option or something ?

here's my configure options:

-> klaus $ ./configure --disable-option-checking \
--disable-tests \
--without-alsa \
--without-capi \
--with-cms \
--with-coreaudio \
--with-cups \
--with-curses \
--without-dbus \
--with-faudio \
--without-fontconfig \
--with-freetype \
--with-gcrypt \
--with-gettext \
--without-gettextpo \
--without-gphoto \
--with-glu \
--with-gnutls \
--without-gsm \
--without-gssapi \
--with-gstreamer \
--without-gtk3 \
--without-hal \
--without-inotify \
--with-jpeg \
--without-krb5 \
--with-ldap \
--with-mingw \
--with-mpg123 \
--without-netapi \
--with-openal \
--with-opencl \
--with-opengl  \
--without-oss \
--with-pcap \
--with-png \
--with-pthread \
--without-pulse \
--without-quicktime \
--without-sane \
--with-sdl \
--with-tiff \
--without-udev \
--with-unwind \
--with-usb \
--without-v4l2 \
--without-vkd3d \
--without-xattr \
--with-xml \
--with-xslt \
--without-va  \
--with-osmesa \
--with-xcomposite \
--with-xcursor \
--with-xfixes \
--with-xinerama \
--with-xinput \
--with-xinput2 \
--with-xrandr \
--with-xrender \
--with-xshape \
--with-xshm \
--with-xxf86vm \
--with-x \
--x-include=/opt/X11/include \
--x-lib=/opt/X11/lib \
--enable-win64

here's the list of the dependencies i had to install through homebrew:

brew install bison mingw-w64 lcms2 FAudio sdl2 gstreamer gst-plugins-base gst-plugins-good vulkan-headers molten-vk

then i did make, and make install. all went fine. i added /usr/local/bin to my path with

-> klaus $ sudo launchctl config user path /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin`

so far so good or so i thought, but, when i run wine some/file.exe or even just winecfg here's what i get:

preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0034:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0064:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
006c:fixme:font:opentype_enum_font_names handle name format 1
006c:err:display:macdrv_init_display_devices No GPUs detected
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
002c:fixme:font:opentype_enum_font_names handle name format 1
00cc:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
00f8:fixme:font:opentype_enum_font_names handle name format 1
0100:fixme:font:opentype_enum_font_names handle name format 1
002c:err:display:macdrv_init_display_devices No GPUs detected
011c:fixme:font:opentype_enum_font_names handle name format 1
011c:err:display:macdrv_init_display_devices No GPUs detected
^C

any ideas ?

Gcenx commented 3 years ago

Try this and let me know if it works WineDevel64Bit6.0-rc2, all needed dylibs were bundled inside, gecko and mono were not included within the package and it uses stock MoltenVK v1.1.1

nsklaus commented 3 years ago

many thanks for the reply and the share, but, i think you might have forgot something to make it bypass quarantine. right now i'm forced to check and click allow for every single exe and library being opened by wine process. this is a bit difficult. also is that normal that there is a "wine" directory inside lib/ and lib64/ ? as in: lib/wine/ and lib64/wine/ maybe it's different on mac and for this specific wine build, but i thought it was a bit uncommon ?

Gcenx commented 3 years ago

You need to remove the quarantine flags on your end as this isn’t code-singed nor notarized. You could do this reclusively on the extracted archives contents.

The layout is normal /lib contains 32Bit /lib64 contains 64Bit, this can be modified to better fit the Host/OS

Gcenx commented 3 years ago

A more extreme option is disabling Quarantine

defaults write com.apple.LaunchServices LSQuarantine -bool NO

After running that command you’d need to reboot your system for it to take effect.

nsklaus commented 3 years ago

ok then (about the layout structure).

from what i can tell, it runs, it even tried to open a window. i tried running what i had at the moment, that is resident evil2. this game doesn't work with crossover too. i'm copying over a copy of witcher3 that worked with crossover. maybe i should try to open something smaller, like a text editor or something for starter, would you have a suggestion for a portable small program to test with ?

here the output i got:

->  share $ wine64 ~/.wine/drive_c/Games/Resident\ Evil\ 2/re2.exe
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0034:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
005c:fixme:font:opentype_enum_font_names handle name format 1
0064:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
006c:fixme:font:opentype_enum_font_names handle name format 1
006c:err:display:macdrv_init_display_devices No GPUs detected
006c:err:ole:start_rpcss Failed to start RpcSs service
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
002c:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0024:fixme:font:opentype_enum_font_names handle name format 1
00d4:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
00dc:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:ntdll:EtwEventRegister ({f404b94e-27e0-4384-bfe8-1d8d390b0aa3}, 000007FF385DCF34, 000007FF38620800, 000007FF38620118) stub.
0024:fixme:ntdll:EtwEventRegister ({bc97b970-d001-482f-8745-b8d7d5759f99}, 000007FF385DCF34, 000007FF386207D0, 000007FF38620110) stub.
0024:fixme:ntdll:EtwEventRegister ({f404b94e-27e0-4384-bfe8-1d8d390b0aa3}, 000007FF33E74B90, 000007FF33EA83D0, 000007FF33EA83C8) stub.
0024:fixme:ntdll:EtwEventRegister ({4b7eac67-fc53-448c-a49d-7cc6db524da7}, 000007FF33E74B90, 000007FF33EA8408, 000007FF33EA8400) stub.
0024:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (000000000051E810 1 C) semi-stub
0024:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (000000000051E990 1 C) semi-stub
0024:fixme:ver:GetCurrentPackageId (000000000051C450 0000000000000000): stub
0024:fixme:seh:get_thread_times not implemented on this platform
wine: Unhandled page fault on execute access to 000000005C93AB5C at address 000000005C93AB5C (thread 0024), starting debugger...
^C^C0120:fixme:console:default_ctrl_handler Terminating process 20 on event 0
0120:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
0120:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
0120:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
0120:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
-> share $ 
-> share $ 
-> share $ 
-> share $ 
-> share $ 
-> share $ winecfg                                               
/usr/local/bin/winecfg: line 46: /usr/local/bin/wine: Bad CPU type in executable
/usr/local/bin/winecfg: line 46: /usr/local/bin/wine: Undefined error: 0
->  share $

so curiously trying run directly wine64 works, but winecfg doesn't.

Gcenx commented 3 years ago

Winecfg is just a script that defaults to launching wine over wine64, you’d be better to use wine64 winecfg

nsklaus commented 3 years ago

and that's from witcher3:

?130 share $ wine64 ~/.wine/drive_c/GOG\ Games/The\ Witcher\ 3\ Wild\ Hunt\ GOTY/bin/x64/witcher3.exe
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0034:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
005c:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0064:fixme:font:opentype_enum_font_names handle name format 1
0064:err:display:macdrv_init_display_devices No GPUs detected
006c:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0064:err:ole:start_rpcss Failed to start RpcSs service
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
002c:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0024:fixme:font:opentype_enum_font_names handle name format 1
00f8:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0100:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0024:err:d3d:wined3d_adapter_init Failed to initialise output, hr 0x80070057.
0024:err:display:macdrv_init_display_devices No GPUs detected
^C^C0114:fixme:console:default_ctrl_handler Terminating process 20 on event 0
0114:fixme:msvcrt:__clean_type_info_names_internal (0000000002D81878) stub
0114:fixme:msvcrt:__clean_type_info_names_internal (00000000029F5768) stub

basicaly both test have the same error output: err:display:macdrv_init_display_devices No GPUs detected as wine6rc2 i tried earlier.

nsklaus commented 3 years ago

same complain about missing gpu it seems:

-> share $  wine64 winecfg
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0034:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
005c:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0064:fixme:font:opentype_enum_font_names handle name format 1
0064:err:display:macdrv_init_display_devices No GPUs detected
006c:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0064:err:ole:start_rpcss Failed to start RpcSs service
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
002c:fixme:font:opentype_enum_font_names handle name format 1
preloader: Warning: failed to reserve range 00007ffef0000000-00007ffef1ff0000
0024:err:module:open_builtin_file failed to load .so lib "/usr/local/lib64/wine/winecfg.exe.so"
0024:err:module:process_init failed to load L"C:\\windows\\system32\\winecfg.exe", error c000007a
?122 share $ 
Gcenx commented 3 years ago

Wipe the wine prefix and ensure your using the package I built not yours as since the error shows the path to your installed copy

Run make uninstall

nsklaus commented 3 years ago

some details:

-> share $ wine64 --version      
wine-6.0-rc2
-> share $ file  $(which wine64) 
/usr/local/bin/wine64: Mach-O 64-bit executable x86_64
-> share $ ll /usr/local/bin/wine64
-rwxr-xr-x@ 1 klaus  admin    13K Dec 16 03:12 /usr/local/bin/wine64
-> share $ 

before copying your files in place, in /usr/local/ right from the start, i did: make uninstall to remove all my files first. i will try with clean prefix.

Gcenx commented 3 years ago

There was no need to copy the files into place it could have been ran from where it was extracted, overwriting your brew installed file could cause issues and if copied incorrectly will break dylibs

nsklaus commented 3 years ago

the dependencies were installed by brew, and i didn't touch any of that. from the wine6 source dir where i compiled it, i just ran: sudo make uninstall. then i went and copied your files into /usr/local/, preserving same structure as what was done in the archive. i will try to run from where i extracted the archive then, that is: /Users/klaus/Downloads/WineDevel64Bit6.0-rc2/bin/wine64 with a clean prefix.

nsklaus commented 3 years ago

with a clean prefix, i ran wine64 winecfg and got two windows appearing asking about installing gecko, and another one, the classic stuff wine always asks on a new prefix. those were microsoft windows UI. so your wine was able to display something.

on the other hand disabling quarantine didn't work.. some i'm still clicking around allow allow allow ... i need to disable that thing ;)

Gcenx commented 3 years ago

You lightly needed to run the command with sudo then reboot for it to take effect.

Alternatively you can use the following command;

sudo xattr -d -rs com.apple.quarantine /Users/klaus/Downloads/WineDevel64Bit6.0-rc2

I’m not entirely sure if sudo is required, but the command will reclusively remove the quarantine flag from all files from that directly and all subsequent directories

nsklaus commented 3 years ago

about that "quarantine" thing, i did that: sudo spctl --master-disable i hope i didn't do anything bad.. i'm used to linux but all these apple thing are new to me.

anyway now i don't have all those pesky messages asking me to allow unverified exe to run. as i was saying, on a clean prefix here's what i get:

Screenshot 2020-12-16 at 04 41 28

that is the only thing it displays. i never get to see the actual winecfg or anything else.

nsklaus commented 3 years ago

some more info, since my dock is in auto-hide, i didn't notice that sooner but, the app (winecfg) actualy runs, but doesn't display well. i see there's an icon in the dock:

Screenshot 2020-12-16 at 05 20 56

and when i click 'show all windows here's what i see: Screenshot 2020-12-16 at 05 21 05

so the app is there, but just not visible?

nsklaus commented 3 years ago

i went ahead and compiled wine5.22. while it still show the same kind of display problem, i was able to show winecfg. so winecfg showed up, but, not notepad. also when trying to run wasteland3 i got this: Screenshot 2020-12-16 at 06 42 04 my configure options are still the same as i listed them in the first post. and configure output says it can find moltenvk libs installed unless i'm mistaken.

checking for -lodbc... not found
checking for -lvulkan... not found
checking for -lMoltenVK... libMoltenVK.dylib
checking whether the compiler supports -Werror=unknown-warning-option... yes

all i know is that i installed it with brew install molten-vk

-> klaus $ find /usr/local -iname "libMoltenVK.dylib"
/usr/local/lib/libMoltenVK.dylib
/usr/local/Cellar/molten-vk/1.0.41_2/lib/libMoltenVK.dylib
-> klaus $

the display problem is still present with the wine5.22 build, although less severe than on wine6rc2 build. i seems to me molten-vk is compiled in but wine cannot find how to use it or something like that. i wonder if it's something that need to be patched in the code or if it's just a configure option i might have missed ?

Gcenx commented 3 years ago

If your unable to get notepad or anything other then winecfg to display then even with a correctly patched and modern version of MoltenVK you won’t be getting any display output.

The copy of MoltenVK installed via brew is ancient v1.0.41, for using CodeWeavers DXVK you’d required V1.1.0 or greater with the needed patches applied to fake some extensions to make DXVK happy.

nsklaus commented 3 years ago

for testing, i tried to replace crossover's libMoltenVK.dylib with the one from your archive since yours is 1.1.1 but, whereas crossover worked previously, with your libmoltenvk, it showed the same symptoms as described here. cannot initialise gpu, dx11 apps won't run anymore, and such. maybe this isn't a such a meaningful test, but i thought i'd mention it in passing while continuing to try and fiddle with wine.. i also tried the opposite: copying crossover's libMoltenVK.dylib into your archive and try to run with that. there again, same results: cannot initialise gpu, dx11 apps won't run.

Gcenx commented 3 years ago

I'd explained the copy of libMoltenVK I provided was stock v1.1.1. The main concern here is macDriver isn't initializing the display correctly for normal usage ignore DXVK for the moment as that requires a specially patched version of MoltenVK

nsklaus commented 3 years ago

understood. i'll try to look for normal macdriver initialization first then.

Gcenx commented 3 years ago

What's strange is Wine-6.0-rc2 does contain the macdriver changes from CrossOver-20.0.1 so technically this should function.

How exactly are you launching wine64?, as the compile does function on my end but I'm using an Intel system as I currently don't have an M1 system

nsklaus commented 3 years ago

i cd myself in front of wine executable itself, and i do: ./wine64 ~/some/path/to/file.exe alternatively i can also cd to ~/some/path/ and run ~/path/to/wine/wine64 ./file.exe

for example if i want to run my build, i do:

cd ~/Sources/wine-master
./wine64 ~/.wine/drive_c/GOG\ Games/The\ Witcher\ 3\ Wild\ Hunt\ GOTY/bin/x64/witcher3.exe

if i want to run your build, i do:

cd ~/Downloads/WineDevel64Bit6.0-rc2/bin
./wine64 ~/.wine/drive_c/GOG\ Games/The\ Witcher\ 3\ Wild\ Hunt\ GOTY/bin/x64/witcher3.exe
Gcenx commented 3 years ago

Not what I meant, your launching terminal with env /usr/bin/arch -x86_64 /bin/zsh --login or similar command I'd assume you wouldn't get any launches if not

nsklaus commented 3 years ago

on macos i select getinfo on terminal icon and i check "open using rosetta". so everything ran inside the terminal and the terminal itself it all goes through rosetta. as such, i installed brew the usual way, nothing apple m1 specific, it's all x86.

nsklaus commented 3 years ago

ok, i think i understand the reason why the macDriver doesn't initialize properly, i've been comparing the sources of winecx-crossover-wine-20.0.2 with the sources of wine6rc2. the thing is winecx-crossover-wine-20.0.2 have a modified dlls/winemac.drv/*

i wanted to try and import it in wine6rc2, but that entails too many changes. doing their modified winemac.drv meant many modifications outside the driver itself into the rest of the sources main tree. this isn't self contained but implying a rather widespread fiddling with the rest of the sources. it's above my skills. codeweavers should first backport their modified winemac.drv to mainline wine sources before i can attempt compiling plain wine myself again. at least for now.

meanwhile i thought i 'd try something else, like building winecx-crossover-wine-20.0.2 with updated moltenvk (1.2.something). moltenvk compiled and installed fine but the same cannot be said for winecx. their source release is a mess it won't compile. there's missing files and all.

so i'm stuck for now. last stuff i can try is to check if i can't make use of my updated moltenvk with the binary release of crossover. maybe adding FAudio too..

codeweavers should really contribute back with mainline wine and upload their work. but doing so would mean anyone could just get wine up and running instead of using their crossover so they will probably want to wait a bit before doing so. and that understandable considering all the work they did, at least they can wait a bit before contributing back.

anyway .. someone with higher c/cpp skills than plain me could probably solve this one up, and manually merge wine and winecx together but for myself i'm affraid it is out of my reach for now.

Gcenx commented 3 years ago

The actual macdriver changes that are required for Apple Silicon were merged into upstream Wine-6.0-rc1 or rc2 I’d checked this already. Most of the changes other items are CrossOver hacks and 32on74 related hacks.

crossover-wine-20.0.2 is wine-5.0 plus 32on64 changes and upstream fixes that we’re back ported.

CodeWeavers employs a large amount of the wine contributors and they do upstream, but the problem currently is wine32on64 requires a custom llvm/clang and a ton of hacks that Juilliard refuses to allow in there current form, this might change after the ELF to PE with Unix split is completed as then the remaining items could be manually trunked avoiding the custom llvm/clang requirement.

WineCX as I’ve been calling there sources are indeed a cluster of hacks and patches, building that isn’t for the faint of hearted but then again I’ve found the current CrossOver very unstable.

You could grab a nightly build of CrossOver then replace the included dylibs as nightly aren’t code-signed.

Gcenx commented 3 years ago

For the moment there’s not much more I can think of, once I have an M1 system in front of me figuring this out will be much simpler.

if any additional patches really are required for upstream wine64 to function on Apple Silicon I’ll extract them and add those to my current set of patches to apply to my macOS wine packages.

nsklaus commented 3 years ago

The actual macdriver changes that are required for Apple Silicon were merged into upstream Wine-6.0-rc1 or rc2 I’d checked this already. Most of the changes other items are CrossOver hacks and 32on74 related hacks. crossover-wine-20.0.2 is wine-5.0 plus 32on64 changes and upstream fixes that we’re back ported.

i'm surprised by what you said. i'm not doubting or anything, but if i compare my wine6 source tree with winecx one, i mean specificaly the winemac.drv directory, i see there are quite some differences. for example wine6 is missing some files that are present in winecx. also in winecx i see comments inside some files that are saying "version 25" while for wine6 it says "version 21" (that was winegl drv or something like that) i see also same files that are much bigger on winecx than on wine6. and many more details like those. making diffs between the two directories showed a few thousands lines of differences. not to mention missing files and so on. but, anyhow, i'm glad to hear you say codeweaver has already backported many of their work into mainline.

CodeWeavers employs a large amount of the wine contributors and they do upstream, but the problem currently is wine32on64 requires a custom llvm/clang and a ton of hacks that Juilliard refuses to allow in there current form, this might change after the ELF to PE with Unix split is completed as then the remaining items could be manually trunked avoiding the custom llvm/clang requirement.

i'm completely unaware about this ELF to PE effort happening in wine. this is interesting detail to hear.

WineCX as I’ve been calling there sources are indeed a cluster of hacks and patches, building that isn’t for the faint of hearted but then again I’ve found the current CrossOver very unstable.

i've certainly met some problem with winecx sources.

You could grab a nightly build of CrossOver then replace the included dylibs as nightly aren’t code-signed.

that's interesting i hadn't thought about the code signing thing. another mac specificity i guess. well good to hear what i planned to try could be done with the nightlies at least.

nsklaus commented 3 years ago

For the moment there’s not much more I can think of, once I have an M1 system in front of me figuring this out will be much simpler.

if any additional patches really are required for upstream wine64 to function on Apple Silicon I’ll extract them and add those to my current set of patches to apply to my macOS wine packages.

i hope you can get your hands on a m1 system soon. it will be good to follow your work. i'll be there, helping if i can, testing and reporting. many thanks anyway for the advices and details given here in this issue.

Gcenx commented 3 years ago

@nsklaus Here give this one a try ;) WineDevel64Bit6.0-rc3

Edit;\ This compile properly won’t work below MacOS High Sierra.

nsklaus commented 3 years ago

i thought you got your m1 system, i was about to say congrats, but judging from the output i'm not so sure you got it yet. anyway, thank you for the build. after a quick try i can say this:

for the good part:

for the parts that didn't work:

i paste the output below. i note that in some cases i see some of your paths seems to be hard coded in the build. i saw things like:

err:ntdll:RtlpWaitForCriticalSection section 000000007BC7B460 "/Users/gcenx/Documents/GitHub/wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0110, blocked by 0024, retrying (60 sec)

and also mention of nvidia hardware which i do not have:

fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "Apple". Returning HW_VENDOR_NVIDIA.

here's the full output of the two attempts. for resident evil2:

-> bin $ ./wine64 ~/.wine/drive_c/Games/Resident\ Evil\ 2/re2.exe
0034:fixme:font:opentype_enum_font_names handle name format 1
0064:fixme:font:opentype_enum_font_names handle name format 1
006c:fixme:font:opentype_enum_font_names handle name format 1
002c:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:font:opentype_enum_font_names handle name format 1
00f4:fixme:font:opentype_enum_font_names handle name format 1
00fc:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:ntdll:EtwEventRegister ({f404b94e-27e0-4384-bfe8-1d8d390b0aa3}, 000007FF385DCF34, 000007FF38620800, 000007FF38620118) stub.
0024:fixme:ntdll:EtwEventRegister ({bc97b970-d001-482f-8745-b8d7d5759f99}, 000007FF385DCF34, 000007FF386207D0, 000007FF38620110) stub.
0024:fixme:ntdll:EtwEventRegister ({f404b94e-27e0-4384-bfe8-1d8d390b0aa3}, 000007FF33E74B90, 000007FF33EA83D0, 000007FF33EA83C8) stub.
0024:fixme:ntdll:EtwEventRegister ({4b7eac67-fc53-448c-a49d-7cc6db524da7}, 000007FF33E74B90, 000007FF33EA8408, 000007FF33EA8400) stub.
0024:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (000000000051E810 1 C) semi-stub
0024:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (000000000051E990 1 C) semi-stub
0024:fixme:ver:GetCurrentPackageId (000000000051C450 0000000000000000): stub
0024:fixme:seh:get_thread_times not implemented on this platform
wine: Unhandled page fault on execute access to 000000005CE5AB5C at address 000000005CE5AB5C (thread 0024), starting debugger...
^C^C0118:fixme:console:default_ctrl_handler Terminating process 20 on event 0
0118:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
0118:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
0118:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
0118:fixme:ntdll:EtwEventUnregister (deadbeef) stub.
-> bin $

for witcher3:

-> bin $ ./wine64 ~/.wine/drive_c/GOG\ Games/The\ Witcher\ 3\ Wild\ Hunt\ GOTY/bin/x64/witcher3.exe
0034:fixme:font:opentype_enum_font_names handle name format 1
0064:fixme:font:opentype_enum_font_names handle name format 1
006c:fixme:font:opentype_enum_font_names handle name format 1
002c:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:font:opentype_enum_font_names handle name format 1
00f4:fixme:font:opentype_enum_font_names handle name format 1
00fc:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0024:fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "Apple". Returning HW_VENDOR_NVIDIA.
-[MTLTextureDescriptorInternal validateWithDevice:]:1248: failed assertion `Texture Descriptor Validation
MTLTextureDescriptor: MTLPixelFormat422 requires MTLTextureType2D.
'
0024:fixme:seh:virtual_unwind calling personality routine in system library not supported yet
wine: Assertion failed at address 00007FFF2044A452 (thread 0024), starting debugger...
0110:fixme:font:opentype_enum_font_names handle name format 1
^CCtrl-C: stopping debuggee
Ctrl-C: stopping debuggee
-> bin $

GOG installers don't work, i verified they are 32bit exe. but it will be more difficult to install things then. luckily, i have a few crossover bottles already installed around. i can test with those. the evil within2 didn't work either (works on crossover).

evil within2:

-> bin $ ./wine64 ~/.wine/drive_c/Games/The\ Evil\ Within\ 2/TEW2.exe
0040:fixme:font:opentype_enum_font_names handle name format 1
002c:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:font:opentype_enum_font_names handle name format 1
0098:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:ntdll:EtwEventRegister ({47a9201e-73b0-42ce-9821-7e134361bc6f}, 0000000000962220, 0000000000A05D40, 0000000000A05D38) stub.
0024:fixme:ntdll:EtwEventRegister ({58a9201e-73b0-42ce-9821-7e134361bc70}, 0000000000962220, 0000000000A05D78, 0000000000A05D70) stub.
0024:fixme:ntdll:EtwEventRegister ({3fa9201e-73b0-43fe-9821-7e145359bc6f}, 0000000000962220, 0000000000A05D08, 0000000000A05D00) stub.
0024:fixme:ntdll:EtwEventRegister ({1432afee-73b0-42ce-9821-7e134361b433}, 0000000000962220, 0000000000A05DB0, 0000000000A05DA8) stub.
0024:fixme:ntdll:EtwEventRegister ({4372afee-73b0-42ce-9821-7e134361b519}, 0000000000962220, 0000000000A05DE8, 0000000000A05DE0) stub.
00a0:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:imm:ImmGetOpenStatus (00000000000BBDE0): semi-stub
0024:fixme:ver:GetCurrentPackageId (000000000021DCB0 0000000000000000): stub
0024:fixme:ver:GetCurrentPackageId (000000000021CBF0 0000000000000000): stub
0024:fixme:seh:get_thread_times not implemented on this platform
0024:err:module:LdrInitializeThunk "steamclient64.dll" failed to initialize, aborting
0024:err:module:LdrInitializeThunk Initializing dlls for L"C:\\Games\\The Evil Within 2\\TEW2.exe" failed, status c0000005
?5 bin $

i will try more, this was just a first quick try with it. there's certainly improvements. i will now try with clean prefix and see if there's any changes from the above. oh and, debugger window never seems to come out. maybe i need to wait more.

Gcenx commented 3 years ago

The provided compile was plain upstream wine-6-rc3 with a patch I’d taken from CrossOver-20.0.2 sources.

I’m not sure exactly what additional patches would be required for Witcher3 to function, but it would also need the custom DXVK to be installed along with the custom MoltenVK (can’t remember if I’d shipped that this time)

Don’t worry about it showing the sources PATH that’s normal and nothing to worry about, I’ve known about wine adding this information for sometime.

The ntdll issue could be avoided with with the Proton timeout patches.

The Nvidia injection is from wine, if it founds a GPU it doesn’t recognize it injects Nvidia, you can see if found “Apple” but it’s unknown so nothing to worry about there.

The older GOG installers are 32Bit but some of the newer ones even for 32Bit games have been transitioned over to 64Bit installers, there’s a command line utility to extract GOG installers from homebrew & Macports (I can’t remember the name off hand)

Lastly Evil within 2 is showing it requires Steam to be running so that’s going to be a no go with this since Steam is 32Bit

nsklaus commented 3 years ago

the same evil within2 i'm testing here works fine with wine on linux, and crossover on mac.

the ntdll issue, i have no idea where to find the Proton timeout patches you're talking about, but as i was saying all those works on plain wine linux.

about witcher3, i have built moltenvk here, i have the libMoltenVK.dylib in /usr/local/lib64/. straight from their git repo. i have no idea about special patched version of moltenvk and dxvk though. you think i might find that in your previous build ? if you could tell me which files ? a quick search didn't reveal much:

-> klaus $ cd Downloads/WineDevel64Bit6.0-rc2
-> WineDevel64Bit6.0-rc2 $ find ./ -iname "*dxvk*"  
-> WineDevel64Bit6.0-rc2 $ 
-> WineDevel64Bit6.0-rc2 $ find ./ -iname "*molten*"
.//lib64/libMoltenVK.dylib
.//lib/libMoltenVK.dylib
-> WineDevel64Bit6.0-rc2 $ 
Gcenx commented 3 years ago

You can find a prebuilt copy of the latest version of MoltenVK and the DXVK patched version on my own MoltenVK mirror https://github.com/Gcenx/MoltenVK/releases

Not near my system so I can’t just drop the patches here but I have disabled all of my patches for the moment.

I’ll need to download the GOG installer of Witcher3 once I’m home to test this directly but I’d assume unless Upstream wine broken something it “should” run with the custom MoltenVK and DXVK dlls

Gcenx commented 3 years ago

The modified version of MoltenVK needs to be placed into /lib64/ within the compile for it to be find easily

nsklaus commented 3 years ago

i got your archive here: https://github.com/Gcenx/MoltenVK/releases/download/v1.1.1/macos_dxvk_patched.zip i copied to /usr/local/lib64:

-> Downloads $ sudo cp Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib /usr/local/lib64 
-> Downloads $ ll /usr/local/lib64 
total 50944
drwxr-xr-x   4 root  wheel   128B Dec 21 21:49 .
drwxr-xr-x  16 root  wheel   512B Dec 18 23:32 ..
-rwxr-xr-x@  1 root  wheel    12M Dec 21 21:49 libMoltenVK.dylib
-rwxr-xr-x   1 root  wheel    12M Dec 16 21:33 libMoltenVK.dylib--
-> Downloads $

(the one renamed-- is mine, the normal one is yours)

then i tried to run witcher3:

./wine64 ~/.wine/drive_c/GOG\ Games/The\ Witcher\ 3\ Wild\ Hunt\ GOTY/bin/x64/witcher3.exe
0034:fixme:font:opentype_enum_font_names handle name format 1
0064:fixme:font:opentype_enum_font_names handle name format 1
006c:fixme:font:opentype_enum_font_names handle name format 1
002c:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:font:opentype_enum_font_names handle name format 1
00f4:fixme:font:opentype_enum_font_names handle name format 1
00fc:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0024:fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "Apple". Returning HW_VENDOR_NVIDIA.
-[MTLTextureDescriptorInternal validateWithDevice:]:1248: failed assertion `Texture Descriptor Validation
MTLTextureDescriptor: MTLPixelFormat422 requires MTLTextureType2D.
'
0024:fixme:seh:virtual_unwind calling personality routine in system library not supported yet
wine: Assertion failed at address 00007FFF20442452 (thread 0024), starting debugger...
0110:fixme:font:opentype_enum_font_names handle name format 1

zsh: killed     ./wine64 
?137 bin $ 

so, i also tried to delete /usr/local/lib64/libMol* and run only from your archive:

-> bin $ pwd
/Users/klaus/Downloads/WineDevel64Bit6.0-rc3/bin
-> bin $ 
-> bin $ rm ../lib64/libMoltenVK.dylib 
-> bin $ rm /usr/local/lib64/libMoltenVK.dylib*

(no more libMolten* nowhere)

copy your patched molten release to your wine6rc3 lib64/

-> bin $ pwd
/Users/klaus/Downloads/WineDevel64Bit6.0-rc3/bin
-> bin $  ll ..
total 24
drwxr-xr-x@   7 klaus  staff   224B Dec 21 21:57 .
drwx------@  47 klaus  staff   1.5K Dec 21 21:52 ..
drwxr-xr-x@  21 klaus  staff   672B Dec 21 10:41 bin
drwxr-xr-x@ 302 klaus  staff   9.4K Dec 21 03:04 lib
drwxr-xr-x@ 302 klaus  staff   9.4K Dec 21 21:59 lib64
drwxr-xr-x@   3 klaus  staff    96B Dec 21 03:00 share
-> bin $ 
-> bin $ cp ~/Downloads/Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib ../lib64 
-> bin $
-> bin $ ./wine64 ~/.wine/drive_c/GOG\ Games/The\ Witcher\ 3\ Wild\ Hunt\ GOTY/bin/x64/witcher3.exe
0034:fixme:font:opentype_enum_font_names handle name format 1
0064:fixme:font:opentype_enum_font_names handle name format 1
006c:fixme:font:opentype_enum_font_names handle name format 1
002c:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:font:opentype_enum_font_names handle name format 1
00f4:fixme:font:opentype_enum_font_names handle name format 1
00fc:fixme:font:opentype_enum_font_names handle name format 1
0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0024:fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "Apple". Returning HW_VENDOR_NVIDIA.
-[MTLTextureDescriptorInternal validateWithDevice:]:1248: failed assertion `Texture Descriptor Validation
MTLTextureDescriptor: MTLPixelFormat422 requires MTLTextureType2D.
'
0024:fixme:seh:virtual_unwind calling personality routine in system library not supported yet
wine: Assertion failed at address 00007FFF20442452 (thread 0024), starting debugger...
0110:fixme:font:opentype_enum_font_names handle name format 1
zsh: killed     ./wine64 
?137 bin $

have i missed something ?

Gcenx commented 3 years ago

If your attempting to have system wide install of the custom libMoltenVK you need to place it into /usr/local/lib.

You’ll only be placing into /lib64 within my wine package, your build won’t be able to load dylibs from within its self.

Onxe I’m home I’ll check if I have the Witcher 3 installer files downloaded already on my main system then transfer them to an external or re-download them directly on the M1 Mac mini (I wasn’t going to say I have one just yet)

nsklaus commented 3 years ago

hey heheh congrats! take a break and have fun with it :)

Gcenx commented 3 years ago

That’s how I managed to figure of the exact patch needed to get macDriver working on Apple Silicon.

I’ve already done a preliminary investigation into getting my own project running (Wineskin) since community members did fund this purchase to further it’s development and to support Apple Silicon systems.

nsklaus commented 3 years ago

yep, and it's all good. many including myself are happy to see you doing these projects. by the way, would you be reachable on discord or irc somewhere ?

Gcenx commented 3 years ago

Closing as Wine-6.1 includes the needed patches.