23 May 2013

429. Briefly: Wine, libGL/liubGLU, Blender and nvidia -- 3D acceleration under Wine

The short version:
sudo apt-get install libgl1-nvidia-glx:i386

The longer version:
I looked into the possibility of running Blender for 32 bit windows under wine due to a series of comments to a post: http://verahill.blogspot.com.au/2013/05/416-wine-1530-in-chroot.html?showComment=1369252731918#c3560166574961895965

On this particular system I have a Geforce 430. It's running Debian Wheezy 64 bit, and has 32 bit wine 1.5.30 compiled as shown in this post: http://verahill.blogspot.com.au/2013/05/416-wine-1530-in-chroot.html


False start
First I downloaded and installed Blender. Running it using
wine ~/.wine/drive_c/Program\ Files/Blender\ Foundation/Blender/blender.exe
led to
err:ole:CoGetClassObject class {24e669e1-e90f-4595-a012-b0fd3ccc5c5a} not registered err:ole:CoGetClassObject no class object {24e669e1-e90f-4595-a012-b0fd3ccc5c5a} could be created for context 0x1 err:module:load_builtin_dll failed to load .so lib for builtin L"GLU32.dll": libGL.so.1: cannot open shared object file: No such file or directory err:module:import_dll Loading library GLU32.dll (which is needed by L"C:\\Program Files\\Blender Foundation\\Blender\\blender.exe") failed (error c000007a). err:module:LdrInitializeThunk Main exe initialization for L"C:\\Program Files\\Blender Foundation\\Blender\\blender.exe" failed, status c0000135
Using locate I found something that sounded right-ish
sudo ln -s /usr/lib/i386-linux-gnu/libGLU.so.1 /lib32/libGLU.so.1

Tried again:
wine: Call from 0x7b83c562 to unimplemented function ntoskrnl.exe.IoAssignResources, aborting wine: Unimplemented function ntoskrnl.exe.IoAssignResources called at address 0x7b83c562 (thread 003c), starting debugger... err:module:load_builtin_dll failed to load .so lib for builtin L"GLU32.dll": libGL.so.1: cannot open shared object file: No such file or directory err:module:import_dll Loading library GLU32.dll (which is needed by L"C:\\Program Files\\Blender Foundation\\Blender\\blender.exe") failed (error c000007a). err:module:LdrInitializeThunk Main exe initialization for L"C:\\Program Files\\Blender Foundation\\Blender\\blender.exe" failed, status c0000135
And more
sudo ln -s /usr/lib/mesa-diverted/i386-linux-gnu/libGL.so.1.2 /lib32/libGL.so.1

And tried again
wine: Call from 0x7b83c562 to unimplemented function ntoskrnl.exe.IoAssignResources, aborting wine: Unimplemented function ntoskrnl.exe.IoAssignResources called at address 0x7b83c562 (thread 003c), starting debugger... err:module:load_builtin_dll failed to load .so lib for builtin L"GLU32.dll": libGL.so.1: cannot open shared object file: No such file or directory err:module:import_dll Loading library GLU32.dll (which is needed by L"C:\\Program Files\\Blender Foundation\\Blender\\blender.exe") failed (error c000007a). err:module:LdrInitializeThunk Main exe initialization for L"C:\\Program Files\\Blender Foundation\\Blender\\blender.exe" failed, status c0000135
OK, so /lib32 isn't in the ld path:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib32

And tried again.
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/i386-linux-gnu/alsa-lib/libasound_module_pcm_pulse.so err:winediag:X11DRV_WineGL_InitOpenglInfo Direct rendering is disabled, most likely your OpenGL drivers haven't been installed correctly (using GL renderer "GeForce GT 430/PCIe/SSE2", version "1.4 (2.1.2 NVIDIA 304.88)"). Writing: /tmp/\blender.crash.txt
Fine. Back to the drawing board.

(Btw, libasound2-plugins:i386 would lead to broken packages re the libasound_module_pcm_pulse.so message.)

Solution:
aptitude show libgl1-nvidia-glx-ia32
Package: libgl1-nvidia-glx-ia32 New: yes [..] Replaces: nvidia-glx-ia32 (< 195.36.31), nvidia-glx-ia32 (< 195.36.31) Description: please switch to multiarch libgl1-nvidia-glx:i386

Half the time these things break when installing the i386 packages, but sure, let's try:
sudo apt-get install libgl1-nvidia-glx:i386
Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: libgl1-nvidia-alternatives-ia32 Use 'apt-get autoremove' to remove it. Recommended packages: libxvmcnvidia1:i386 The following packages will be REMOVED: libgl1-nvidia-glx-ia32 The following NEW packages will be installed: libgl1-nvidia-glx:i386

Try again:
wine ~/.wine/drive_c/Program\ Files/Blender\ Foundation/Blender/blender.exe

It works!

Note that this means that you can run Facio 17.1.1 on Wine as well (it's an unofficial GUI for e.g. GAMESS US/WinGAMESS, Firefly, etc.)

4 comments:

  1. Brilliant -

    sudo apt-get install libgl1-nvidia-glx:i386

    Only asked to remove two 32 bit packages so agreed.

    At first got the missing libGLU.so.1 error. Could not simply

    sudo apt-get install libglu1-mesa:i386

    in jessie (would cause broken packages).

    Fortunately the chroot for the wine build has the file that the link libGLU.so.1 points to. (i386 version of libGLU.so.1.3.08005) Copied the file to /usr/lib32 and made a link there - cut it to /usr/lib as libGLU.so.1 (ln would have been quicker).

    Sculptris - http://pixologic.com/sculptris/ works!

    Blender - http://graphicall.org/93 works!

    ReplyDelete
  2. The Linux support by Nvidia has been great for some time now. It has not been broken as the comments suggest. I believe it is only not as obvious for some how to make it work.

    I have been running games on a 64-bit AMD system with 32-bit WINE and 3D acceleration for a while now using Nvidia's original Linux driver. All it requires is to say "Yes" when the Nvidia installer asks if one wants to install its 32-bit compatibility libraries. It then installs these libraries under /usr/lib32 and sets up links to replace the Mesa drivers.

    It does require to have 32-bit Mesa installed in the first place or else it cannot work as a drop-in replacement. I recommend not to use the Debian packages, which try to install the Nvidia drivers for you. These often container older driver versions and only add complexity to the administration while lacking the intelligence of the Nvidia installer. Nvidia's driver package comes with an intelligent installer, which creates backups, adjusts the X11 configuration, works with the latest kernel/X11/Mesa versions, compiles a matching kernel module, detects and disables the "nouveau" driver if one is found, sets up GNOME/KDE/Xfce/... menus for its settings tool, can check for and download newer versions of itself, runs self-tests after installation, creates a log file, and as already mentioned sets up links to integrate it into Debian with both 64- and 32-bit support libraries for Mesa. Nvidia has put a lot of effort into this (it can do more than what I have listed here) and its worth reading its manual.

    ReplyDelete
    Replies
    1. Thanks for you comment.

      I think one potential issue is that there are so many ways of getting the nvidia drivers set up -- I did use the installer from nvidia once and it ended up being a PITA to completely remove it. I've since given up and handed over the responsibility to smxi and it tends to work. I guess it's because of that that I don't remember being asked when to install the 32 bit libraries.

      And if we are to believe Linus I suspect that that first sentence should be rephrased "The Linux support FOR Nvidia..." ;-) Anyway, empirically and from a consumer point of view I've had more luck using nvidia cards than AMD/ATI ones.

      Delete
  3. sudo apt-get dist-upgrade and jessie updates fixed the problem with sudo apt-get install libglu1-mesa:i386 and 3d wine is accelerated.

    A couple of years ago used the installer from nvidia for Slackware but came to use Debian packages because they are easily replaced. Nouveau in Fedora was unable to quell the noisy fan. Have spare .deb files for nvidia experimental and jessie in separate folders in case it is necessary to dpkg *.deb in the terminal in order to banish the blackout of X.

    In a separate posting you gave the sensible advice to stay away from the latest kernel which should have been followed since it is still incompatible with Nvidia at 3.10-rc3 -

    http://verahill.blogspot.com/2013/05/417-briefly-patching-kernel-39-with-ck.html?showComment=1368918727805#c3189505804903586110

    Probably since the source of nvida is the kernel-source for Debian, patching the two files mentioned in the following does not work:

    http://rglinuxtech.com/?p=738
    https://devtalk.nvidia.com/default/topic/543728/linux/building-nvidia-driver-on-kernel-3-9-0/2/

    Have been looking at your posts on smxi which seems to offer a choice of using Debian's packages and the Nvidia installer. Somewhere in the course of using smxi there may be a directory "/NVIDIA-Linux-x86_64-319.17-no-compat32" where the patched files are supposed to reside. This could enable compatibility with the kernel 3.10-rc3. Since the patched kernel -

    http://verahill.blogspot.com.au/2013/05/417-briefly-patching-kernel-39-with-ck.html

    for 3.9.4-ck1 is fast, responsive and stable there is no special reason to try 3.10-rc3 but there may be advantages in allowing smxi to administer nvidia.

    ReplyDelete