iXit / wine-nine-standalone

Build Gallium Nine support on top of an existing WINE installation
GNU Lesser General Public License v2.1
272 stars 23 forks source link

Wine 7.12 problem: err:d3d9nine:nine_set Couldn't load d3d9-nine.dll: L"Fehlerhaftes EXE-Format f\00fcr %1.\r\n" #138

Closed lorn10 closed 1 year ago

lorn10 commented 1 year ago

Hi all!

Here follows a new issue, it looks that there exist a problem with Gallium Nine on Wine 7.12 devel in conjunction with Kubuntu 22.04 LTS. The used drivers are the most current one from the oibaf PPA, Mesa 22.2.0-devel (git-3a8ad28 2022-07-13 jammy-oibaf-ppa)

When I try to install Gallium Nine via winetricks 20220411-next into a fresh prefix then I get: err:d3d9nine:nine_set Couldn't load d3d9-nine.dll: L"Fehlerhaftes EXE-Format f\00fcr %1.\r\n"

All other stuff seems to be installed correctly, it just fails at the end:

tmp@iMac-tmp:~/Downloads$ ./winetricks -q galliumnine
Executing mkdir -p /home/tmp
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20220411-next - sha256sum: 9013b68a97e1f6e7c660b605af27a196509ba2f00cd72bf614cbf79651dad222 with wine-7.12 and WINEARCH=win64
Executing w_do_call galliumnine
Executing mkdir -p /home/tmp
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_galliumnine 
Executing rm -rf /home/tmp/.wine/dosdevices/c:/windows/temp/galliumnine
Executing mkdir -p /home/tmp/.wine/dosdevices/c:/windows/temp/galliumnine
Executing tar -C /home/tmp/.wine/dosdevices/c:/windows/temp/galliumnine --strip-components=1 -zxf /home/tmp/.cache/winetricks/galliumnine/gallium-nine-standalone-v0.8.tar.gz
Executing mv /home/tmp/.wine/dosdevices/c:/windows/temp/galliumnine/lib32/d3d9-nine.dll.so /home/tmp/.wine/dosdevices/c:/windows/syswow64/d3d9-nine.dll
Executing mv /home/tmp/.wine/dosdevices/c:/windows/temp/galliumnine/bin32/ninewinecfg.exe.so /home/tmp/.wine/dosdevices/c:/windows/syswow64/ninewinecfg.exe
Executing mv /home/tmp/.wine/dosdevices/c:/windows/temp/galliumnine/lib64/d3d9-nine.dll.so /home/tmp/.wine/dosdevices/c:/windows/system32/d3d9-nine.dll
Executing mv /home/tmp/.wine/dosdevices/c:/windows/temp/galliumnine/bin64/ninewinecfg.exe.so /home/tmp/.wine/dosdevices/c:/windows/system32/ninewinecfg.exe
Executing rm -rf /home/tmp/.wine/dosdevices/c:/windows/temp/galliumnine
Executing wine ninewinecfg -e
err:d3d9nine:nine_set Couldn't load d3d9-nine.dll: L"Fehlerhaftes EXE-Format f\00fcr %1.\r\n"
------------------------------------------------------
warning: Note: command wine ninewinecfg -e returned status 1. Aborting.
------------------------------------------------------
tmp@iMac-tmp:~/Downloads$ 

I have no clue why some stuff of the error message is written in German while most other is in English. The word "Fehlerhaftes EXE-Format" means something like "defective EXE format". Maybe this has to do with the PE format migration in Wine? If that's the case then Gallium Nine should be also converted in the near future. :wink:

lorn10 commented 1 year ago

For the record, - this issue also occurs with an updated stable prefix from Wine 7.0 that already included Gallium Nine. So it looks that even working Wine + Nine prefixes get somehow corrupted when they are updated to Wine 7.12.

tmp@iMac-tmp:~$ WINEPREFIX=~/.wine wine $HOME'/Downloads/Cxbx/2022/cxbx.exe'
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
device-select: cannot correctly use DRI_PRIME tag
0024:err:module:import_dll Library d3d9.dll (which is needed by L"Z:\\home\\tmp\\Downloads\\Cxbx\\2022\\cxbx.exe") not found
0024:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\tmp\\Downloads\\Cxbx\\2022\\cxbx.exe" failed, status c0000135

I think there exist a high chance that this issue here will also affect other users. Note, it should be added that I am at an Multi-GPU system.

lorn10 commented 1 year ago

A further addition, interestingly this problem doesn't occurs on Kubuntu 20.04 LTS with older Mesa 22.2.0-devel (git-e8fc5cc 2022-06-22 focal-oibaf-ppa). So I can launch there the cxbx-r emulator normally on Wine 7.12.

So it could be also the case that a change in Mesa caused the above mentioned d3d9.dll problem.

dhewg commented 1 year ago

7.13 is out, is that also affected? Since you mentioned mesa, does it work again with that mesa version but wine <7.12?

dhewg commented 1 year ago

Just tried: 7.13 works just fine here with mesa 22.1.3 from debian

lorn10 commented 1 year ago

I can confirm this issue also for Wine 7.13 and Mesa 22.2.0-devel (git-c002bbe 2022-07-16 jammy-oibaf-ppa). But I will test this also at my older Kubuntu 20.04 LTS system.

According to the current information this now really looks like a regression at the Mesa side. So there must be a change after Mesa 22.2.0-devel (git-e8fc5cc 2022-06-22 focal-oibaf-ppa) which caused this. The only Nine change was !17471 but this could be also related to an other commit.

dhewg commented 1 year ago

It may be related indirectly, like a missing libd3dadapter9-mesa or llvm for i386 for that new mesa version? Does wine64 ninewinecfg work?

lorn10 commented 1 year ago

Yes, indeed, wine64 ninewinecfg works: wine64_ninewinecfg

So it must be something i386 32bit related.... Addition, the 32bit libd3dadapter9-mesa library is already installed:

test@iMac-tmp:~$ sudo apt install libd3dadapter9-mesa:i386
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
libd3dadapter9-mesa:i386 ist schon die neueste Version (22.2~git2207160600.c002bb~oibaf~j).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
dhewg commented 1 year ago

So what does wine ninewinecfg say? It should at least open and pass the first state check? Do you have libegl1:i386 and libxcb-dri3-0:i386 installed? Maybe you have a mix of debian and oibaf packages, that prolly won't work. Why do you use that ppa anyway, it's not 2010 anymore :P

lorn10 commented 1 year ago

Okay, wine ninewinecfg is just empty. It gives me no error: wine_ninewinecfg

And because it is not active I get still:

tmp@iMac-test:~$ WINEPREFIX=~/.wine wine $HOME'/Downloads/Cxbx/2022/cxbx.exe'
0024:err:module:import_dll Library d3d9.dll (which is needed by L"Z:\\home\\tmp\\Downloads\\Cxbx\\2022\\cxbx.exe") not found
0024:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\tmp\\Downloads\\Cxbx\\2022\\cxbx.exe" failed, status c0000135

I am now on Mesa 22.2.0-devel (git-81d85be 2022-07-17 jammy-oibaf-ppa). Yes, it's no longer 2010 but the oibaf PPA offers still a super easy way to get the newest Mesa builds. :+1: So this is effectively still a very convenient option also for "normal" end users.

And furthermore the oibaf PPA gives me also the chance to test newest changes even on old and very old drivers like r600 and r300. Especially for the later one there were during the recent months essential improvements. Without the oibaf PPA I had to wait many many months longer to be at the corresponding build level.

lorn10 commented 1 year ago

Lol, indeed libegl1:i386 was missing on Kubuntu 22.04 LTS. :confused:

So I did: sudo apt-get install libegl1:i386

And then: winetricks -f galliumnine

And now it's working! :tada: It should be noted that this was NOT necessary on Kubuntu 20.04 LTS. :wink:

Thanks for your help @dhewg!

axeldavy commented 1 year ago

That is weird, this shouldn't have been needed since everything ships dri3 now (egl was used as fallback for when only dri2 was available on some systems). But maybe the galliumnine dll installed by winetricks has dri2 activated and requires the library.

In that case, compiling yourself would have fixed the issue as well.

dhewg commented 1 year ago

The winetricks release has dri2 enabled. But the dri2 code loads libEGL.so.1 dynamically, so it's not a hard requirement. I assume @lorn10 uses dri3 and that installing that package dragged in another requirement that wasn't installed before, like maybe xcb-xfixes.

lorn10 commented 1 year ago

Whatever the problem here is, this could be in the end not only Gallium Nine (or Mesa) but also Wine related. The latest status is that it worked until Wine 7.11 also on Kubuntu 22.04 LTS, this is confirmed here.

As said, after 7.12 it was broken on 22.04 LTS with the above mentioned error message. But it still worked for me at an iMac5,1 with 20.04 LTS and Wine 7.12 but older Mesa 22.2.0-devel (git-e8fc5cc 2022-06-22 focal-oibaf-ppa). Note, that system is because of the r300 driver DRI2 based while the iMac 12,2 computer is fully DRI3 compliant and uses the r600 and crocus driver.

Or alternatively, maybe this is in the end a building related thing in the oibaf PPA. :wink:

lorn10 commented 1 year ago

A little addition. It looks that since Wine 7.12 it is definitely mandatory to install the libegl1 library. I can confirm this for a brand new AMD Ryzen 7 5700U based ASUS Vivo AiO M3700 computer in conjunction with Kubuntu 22.04 LTS (fresh install).

After installing Wine devel I had to do:

sudo apt install libd3dadapter9-mesa sudo apt install libd3dadapter9-mesa:i386

And then also: sudo apt-get install libegl1:i386

So it really looks that Wine has since version 7.12 (and upwards) a new dependency (when Gallium Nine is used). :+1: