(Solved) Trine 2 Linux version & Bumblebee (Optimus)

For discussion about Trine 2, released in December 2011 on Windows, Mac, Xbox, PlayStation Network and later on Linux and Wii U.
Posts: 13
Joined: Fri Sep 30, 2011 11:41 pm

(Solved) Trine 2 Linux version & Bumblebee (Optimus)

Postby Nepenthes » Sat Mar 31, 2012 6:39 am


I have just bought Trine 2 for Linux. The game installs and runs with the default configuration, but on my default graphics card (Intel HD 3000) it is not really smooth.

The good news is that I also have a nvidia 540 M in my laptop, the bad one is that this is an Optimus configuration, so I have to run every big game with Bumblebee ("optirun").
The game seems to crash every time I try to run it with "optirun". At the moment I don't have any useful output except if i launch it in a console, there is no output, just a frozen cursor. No window is showing up.
Just to be sure, many other games work perfectly fine with optirun on my computer (just finished 2 big windows games with optirun wine, no problem).

So, if the game works (poorly, but it definitely works) on my HD 3000, but not on my 540M, I guess it is either : a bug in virtualGL (bumblebee, optirun backend), or a bug in the way Trine 2 manages it libraries. The later is easier to investigate, but I will need some help to sort this one.

So, bumblebee users, Trine packagers ? Any idea ?

Posts: 13
Joined: Fri Sep 30, 2011 11:41 pm

Re: Trine 2 Linux version and Bumblebee (Optimus for Linux)

Postby Nepenthes » Sat Mar 31, 2012 9:03 pm

Now the game works fine.
I'm not exactly sure aboute what I did but :
1) I suspected optirun messed up the way the game handles its libraries (the "export" path, probably overwritten by optirun) so I decided to copy evrything from "/usr/local/games/Trine2/lib/lib32" to "/usr/lib/i386-linux-gnu" so that the launcher script is not necessary anymore and optirun can do its job without oerwriting libraries path.
I don't know if this was really necessary, but I felt that perhaps it could be useful.
Then, do a :

Code: Select all

sudo ldconfig

WARNING : this is the Ubuntu 11.10 and 12.04 way of handling 32 bit libs on a 64 bit distro. Other distributions that may differ.

2) I suspected some other odd bug I have seen with Amnesia : The Dark Descent. For an unknown reason, the launcher does not launch anything if run with "optirun". So I only use the launcher to configure the game, then exit, and launch directly the game binary from command line. On the first run, I experienced some trouble with window management but that was fine on second run.

Code: Select all

cd /usr/local/games/Trine2
optirun bin/trine2_linux_32bit

Please confirm if that works with Bumblebee on your Linux distro.

EDIT : In fact, just do :

Code: Select all

sudo gedit /usr/local/games/Trine2/bin/trine2_bin_starter.sh

and replace the content of this file by :

Code: Select all

cd /usr/local/games/Trine2
optirun bin/trine2_linux_32bit

Now, the launcher launches the game with optimus.

User avatar
Posts: 140
Joined: Thu Jun 16, 2005 8:05 pm

Re: (Solved) Trine 2 Linux version & Bumblebee (Optimus)

Postby fb_jpk » Mon Apr 02, 2012 3:57 pm

Glad to hear you got it working.

And indeed the Trine 2 launcher scripts set the LD_LIBRARY_PATH to the game directory lib/lib32... I know this is a bit of a nasty hacky way of setting the library path - because some other software (such as optirun apparently in this case) can also use that as a hacky way to set the library path :) - and the result is unfortunately non-functional.

In cases where you for some reason do need to make some modifications to the library paths or such, modifying the trine2.sh (which starts the launcher) or the trine2_bin_starter.sh (which starts the game) to suit your needs may be the easiest way to fix the situation. Just remember that any future patches might end up overwriting those files, so it might be best to keep a backup of the modified script file with a different name for an easier re-apply after patching.

Or alternatively you can copy the libraries to your usual library directories so the LD_LIBRARY_PATH is not needed. (or I usually rather prefer symlinking, so its easier to find and clean up my own modifications later on.) ;)

If this turns out to be a common problem, we'll replace the requirement of the LD_LIBRARY_PATH with the an appropriate library path setting for the binary itself for the next patch, so setting the LD_LIBRARY_PATH would no-longer be needed.

Posts: 13
Joined: Fri Sep 30, 2011 11:41 pm

Re: (Solved) Trine 2 Linux version & Bumblebee (Optimus)

Postby Nepenthes » Mon Apr 02, 2012 7:36 pm

That may become a common issue as the game popularity grows among Linux users, given Optimus laptops are now a majority of new laptops.

I'm still getting window management issues (with Unity 5.8 ) and I don't know how to debug that. It may be a Compiz, Unity, or VirtualGL bug rather than a Trine 2 bug, but it seems to be the only game to behave like this. It is completely randon (50% launches - the game goes fullscreen, 50% - it fails to go fullscreen, but the window has no borders, so I still see the Unity panel on the top of the screen and I can switch windows or trigger launcher reveal).

EDIT : what about DEB and RPM packages ?

Posts: 1
Joined: Mon May 28, 2012 2:59 am

Re: (Solved) Trine 2 Linux version & Bumblebee (Optimus)

Postby P.T. » Mon May 28, 2012 3:05 am

I registered myself to thank Nepenthes for his explanation and to confirm it's working. My graphics sucked big time, till I installed bumblebee and followed Nepenthes his solution.

Some system information which might come in handy for users who got trouble:
Processor 4x Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
Memory 6021MB (1281MB used)
Operating System Linux Mint 13 Maya
Resolution 1920x1080 pixels
Kernel Linux 3.2.0-24-generic (x86_64)
OpenGL Renderer Mesa DRI Intel(R) Sandybridge Mobile
VGA compatible controller NVIDIA Corporation GF108 [GeForce GT 540M] (rev ff) (prog-if ff)

Return to “Trine 2”

Who is online

Users browsing this forum: No registered users and 7 guests