Wine Multiarch Hell

Questions about Wine on Linux
Locked
3246251196
Level 2
Level 2
Posts: 25
Joined: Sun Mar 13, 2011 3:21 pm

Wine Multiarch Hell

Post by 3246251196 »

Given this error from Wine when trying to run Anarchy Online:

Code: Select all

fixme:ddraw:DirectDrawEnumerateExA flags 0x00000007 not handled
err:wgl:has_opengl Failed to load libGL: libGL.so.1: wrong ELF class: ELFCLASS64
err:wgl:has_opengl OpenGL support is disabled.
fixme:ddraw:ddraw7_Initialize Ignoring guid {00000000-0000-0000-0000-000000000000}.
fixme:ddraw:ddraw7_Initialize Ignoring guid {aeb2cdd4-6e41-43ea-941c-8361cc760781}.
fixme:ieframe:OleInPlaceObject_InPlaceDeactivate (0x1b4800)
fixme:ieframe:ControlSite_OnFocus (0x1b48b4)->(0)
fixme:ieframe:InPlaceSite_OnInPlaceDeactivateEx fNoRedraw (1) ignored
fixme:mshtml:HlinkTarget_SetBrowseContext (0x1cef48)->((nil))
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
err:wgl:has_opengl Failed to load libGL: libGL.so.1: wrong ELF class: ELFCLASS64
err:wgl:has_opengl OpenGL support is disabled.
fixme:ddraw:DirectDrawEnumerateExA flags 0x00000007 not handled
fixme:ddraw:ddraw7_Initialize Ignoring guid {aeb2cdd4-6e41-43ea-941c-8361cc760781}.
fixme:ddraw:DirectDrawEnumerateExA flags 0x00000007 not handled
fixme:ddraw:ddraw7_Initialize Ignoring guid {aeb2cdd4-6e41-43ea-941c-8361cc760781}.
err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this.
I am going to assume, here, that it is trying to load a 64-bit library when what is actually needed is a 32-bit library as suggested by:

Code: Select all

err:wgl:has_opengl Failed to load libGL: libGL.so.1: wrong ELF class: ELFCLASS64
Is this correct?

So, then I find the links and files in question:

Code: Select all

$ locate libGL.so.1
/usr/lib/libGL.so.1
/usr/lib32/libGL.so.1
And these point to:

Code: Select all

$ ls -l ./usr/lib32/libGL.so.1 ; ls -l ./usr/lib/libGL.so.1
lrwxrwxrwx 1 root root 15 Mar 24 22:10 ./usr/lib32/libGL.so.1 -> libGL.so.310.40
lrwxrwxrwx 1 root root 15 Mar 24 22:10 ./usr/lib/libGL.so.1 -> libGL.so.310.40
Now, I have installed the nVidia driver from their website, and so I ran, as usual, the *.run script and requested that 32-bit libs are also installed, which I guess are the 310.40 libraries (these numbers surely are refering to the version of the driver as they are both the same).

If this is all true, then the solution to this problem is the tell Wine to use the 32-bit Library? And, if this is the solution, how to tell wine to use the 32-bit library?

Thank you.

EDIT: Extra Information: latest 1.5 Wine non-stable. Ubuntu 12.04.2 x86_64. 560Ti Nvidia
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Wine Multiarch Hell

Post by dimesio »

3246251196 wrote: I am going to assume, here, that it is trying to load a 64-bit library when what is actually needed is a 32-bit library as suggested by:

Code: Select all

err:wgl:has_opengl Failed to load libGL: libGL.so.1: wrong ELF class: ELFCLASS64
Is this correct?
Yes.
If this is all true, then the solution to this problem is the tell Wine to use the 32-bit Library? And, if this is the solution, how to tell wine to use the 32-bit library?
Wine should not need to be told anything. You might want to try installing the driver from an Ubuntu package rather than the .run file, as presumably the package would put the needed files in the right places, and create any necessary symlinks. You should also ask this on the Ubuntu forum; packaging conventions vary greatly by distro, and I don't use Ubuntu, so I can't tell you which package(s) to install.
georgiapicton12
Newbie
Newbie
Posts: 2
Joined: Mon Mar 25, 2013 2:09 am

Re: Wine Multiarch Hell

Post by georgiapicton12 »

Thats ture i have 32 bit library and i am getting the same issue in it. But last month I have updated my PC to 64 bit. now the Anarchy is working very well
3246251196
Level 2
Level 2
Posts: 25
Joined: Sun Mar 13, 2011 3:21 pm

Re: Wine Multiarch Hell

Post by 3246251196 »

Installing the nvidia-latest package has corrected this situation. Though, the package in the standard repo was an older version so I added the extra necessary ppa and have the latest release of the driver.

The difference this has made:

Code: Select all

$ locate libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/nvidia-current/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib32/nvidia-current/libGL.so.1

Code: Select all

$ sudo ls -l `locate libGL.so.1`
lrwxrwxrwx 1 root root     15 Mar 13 01:01 /usr/lib32/nvidia-current/libGL.so.1 -> libGL.so.304.84
lrwxrwxrwx 1 root root     14 Oct 12 11:02 /usr/lib/i386-linux-gnu/mesa/libGL.so.1 -> libGL.so.1.2.0
-rw-r--r-- 1 root root 383000 Oct 12 11:02 /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
lrwxrwxrwx 1 root root     15 Mar 13 01:01 /usr/lib/nvidia-current/libGL.so.1 -> libGL.so.304.84
lrwxrwxrwx 1 root root     14 Oct 12 13:06 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 -> libGL.so.1.2.0
-rw-r--r-- 1 root root 414896 Oct 12 13:06 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
Even with a more powerful card, crowded areas cause "stickyness", but I am not complaining. I will change a few settings around and consider whether it is possible to load the AO directory into a memfs and then wine on it.

The driver I installed through the nVidia website was actually an incorrect one anyway. This is why I was curious as to why it was not working on this system as, on another similar but less powerful machine, AO worked with Wine using this "download from website" method.

Thank you.
szupek
Level 1
Level 1
Posts: 7
Joined: Sun Apr 14, 2013 12:50 pm

Re: Wine Multiarch Hell

Post by szupek »

maybe someone can explain why the actual distributions stop putting these NEEDED files in random places. Instead why doesn't Ubuntu, Debian, etc create a symlink looking for where the STOCK DRIVER installs it. Why leave it up to the computer user to figure out where everything is supposed to go? make it easy on the user and make a symlink on the OS side.
3246251196
Level 2
Level 2
Posts: 25
Joined: Sun Mar 13, 2011 3:21 pm

Re: Wine Multiarch Hell

Post by 3246251196 »

Yes, this would be nice.

It would be nice if you could provide the references/paths for libraries for Wine, but it seems that this is not possible:
Wine should not need to be told anything.
Unless we look through the source.

Still, I appreciate that WINE exists at all. Anarchy Online does play better in windowed mode and Borealis has always been a bit of an issue with FPS. Also, it is nice to see that I am able to play AO with enhanced settings just like I did on Windows. Though, using backbuffer in the regedit caused inverted screen so xrandr had to be used.
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Wine Multiarch Hell

Post by dimesio »

szupek wrote:maybe someone can explain why the actual distributions stop putting these NEEDED files in random places. Instead why doesn't Ubuntu, Debian, etc create a symlink looking for where the STOCK DRIVER installs it.
Distro packages do create those symlinks; the OP reported that the Ubuntu nvidia-latest package worked fine. If the Debian package didn't, you need to report the problem to the package maintainer.
georgiapicton12
Newbie
Newbie
Posts: 2
Joined: Mon Mar 25, 2013 2:09 am

Re: Wine Multiarch Hell

Post by georgiapicton12 »

do you any body has any graphics card inserted in their PC. one of my friend updates the AMD derivers and no he is playing Anarchy without any error.
3246251196
Level 2
Level 2
Posts: 25
Joined: Sun Mar 13, 2011 3:21 pm

Re: Wine Multiarch Hell

Post by 3246251196 »

I just wanted to update this thread for anyone who wants to have the nVidia downloadable proprietary drivers (the newest available) without needing the Ubuntu package - or whatever dristro you are using.

The simple solution is to tell Wine to look into the 32 lib directory first so that it find, for instance, the shared object libGL in there first before going off to find the wrong ELF type lib. This is done by setting the LD_LIBRARY_PATH env var to, for instance, /usr/lib32

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib32
I always create a script for games for wine, so I just set it in the script. I do not wish for this var to be set other than these instances.

Cheers.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Wine Multiarch Hell

Post by oiaohm »

3246251196 something is really wrong on your system. /usr/lib32 and other elf32 bit paths should be searched by default when a elf32 binary is loaded. LD_LIBRARY_PATH override should not be required.

cd /etc/ld.so.conf.d
cat *|grep /usr/lib32

There should be something in there. Being a debian relation a file containing /usr/lib32 I would guess would be /etc/ld.so.conf.d/zz_i386-biarch-compat.conf from package libc6-i386 on a 64 bit system. So I if I am correct on package name and its missing reinstall package.

Now if that is installed do run a ldconfig to regenate library lookup database.

The following is search the cache to see what ld.so will attempt to load for elf32 libGL.so before failing to 64 bit.
ldconfig -p |grep "libGL.so (libc6)" This should exist if the elf32 library is detected by ld.so on Linux.

ldconfig -p it self lists every library and what ld.so will attempt to load. Very useful for working out what library applications are truly loading.
3246251196
Level 2
Level 2
Posts: 25
Joined: Sun Mar 13, 2011 3:21 pm

Re: Wine Multiarch Hell

Post by 3246251196 »

oiaohm wrote:3246251196 something is really wrong on your system. /usr/lib32 and other elf32 bit paths should be searched by default when a elf32 binary is loaded. LD_LIBRARY_PATH override should not be required.

cd /etc/ld.so.conf.d
cat *|grep /usr/lib32

There should be something in there. Being a debian relation a file containing /usr/lib32 I would guess would be /etc/ld.so.conf.d/zz_i386-biarch-compat.conf from package libc6-i386 on a 64 bit system. So I if I am correct on package name and its missing reinstall package.

Now if that is installed do run a ldconfig to regenate library lookup database.

The following is search the cache to see what ld.so will attempt to load for elf32 libGL.so before failing to 64 bit.
ldconfig -p |grep "libGL.so (libc6)" This should exist if the elf32 library is detected by ld.so on Linux.

ldconfig -p it self lists every library and what ld.so will attempt to load. Very useful for working out what library applications are truly loading.
oiaohm, you are completely correct. There was actually nothing wrong with my system, I just never installed the 32bit verison of libc6. Having done that, it installs 32 bit libs in /lib32 and /usr/lib32/* but more importantly it also updates ld to look in the correct directory which includes /usr/lib32/ - which is where the proprietary nvidia install script installs its libGL.so.

I didn't have to install 32 libc6, I could have just modified the configuration file so ld looked in /usr/lib32 which before it was not. But, maybe I will need these 32 bit libs for some other reason in the future.

In summary,

add to the config directory a file containing /usr/lib32 or just install libc6 or some package that will update ld itself. The zz* file was indeed the file that contained the /usr/lib32 directory.

The alternative is to run the export LD_LIBRARY_PATH but this is not the better solution.

Hopefully this helps anyone in the future.

Cheers.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Wine Multiarch Hell

Post by oiaohm »

3246251196 ok your systems is slightly confusing. One of wine dependencies to run is 32 bit libc.

It would be very interesting to perform ldd on your 32 bit wine executable.

Basically not having the libc6-i386 installed on a 64 bit system is missing a dependency to wine. So its very interesting that wine even runs far enough to have nvidia issues.
3246251196
Level 2
Level 2
Posts: 25
Joined: Sun Mar 13, 2011 3:21 pm

Re: Wine Multiarch Hell

Post by 3246251196 »

oiaohm wrote:3246251196 ok your systems is slightly confusing. One of wine dependencies to run is 32 bit libc.

It would be very interesting to perform ldd on your 32 bit wine executable.

Basically not having the libc6-i386 installed on a 64 bit system is missing a dependency to wine. So its very interesting that wine even runs far enough to have nvidia issues.
Again, there is nothing confusing or wrong about the system; this is actually a separate debian-branched Ubuntu distro to the original post. In both instances this has happened.

I have compiled wine1.5.31 in a chroot environment as there was a necessary patch or two to be applied. I also have wine-depends installed on the normal system as instructed by the WineOn64 guide.

Upon */loader/wine:

Code: Select all

ldd wine
	linux-gate.so.1 =>  (0xf7747000)
	libwine.so.1 => /home/rjd/Downloads/wine-1.5.31/loader/./../libs/wine/libwine.so.1 (0xf7603000)
	libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf75cd000)
	libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7422000)
	libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf741d000)
	/lib/ld-linux.so.2 (0xf7748000)
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Wine Multiarch Hell

Post by oiaohm »

dpkg -S /lib/i386-linux-gnu/libc.so.6
Is libc6:i386: /lib/i386-linux-gnu/libc.so.6 or in other words 386 optimized.
Mine is dpkg -S /lib/i386-linux-gnu/i686/cmov/libc.so.6
libc6-i686:i386: /lib/i386-linux-gnu/i686/cmov/libc.so.6
In other-words 686 or latter optimized.
3246251196 you system you wine is using failsafe so will be under performing. Debian/Ubuntu systems have a few too many libc files.

I guess you nvidia package is not installed by deb because it if was libc6-i386 would be installed.

3246251196 basically I was right to say it was not adding up. Normally when package pattern is odd you can fairly much bet something that should be installed is missing. Like the i686 version of libc for 386 systems.

Yes libc hell system appears to work but under-performs.
3246251196
Level 2
Level 2
Posts: 25
Joined: Sun Mar 13, 2011 3:21 pm

Re: Wine Multiarch Hell

Post by 3246251196 »

Okay,

cheers.
Locked