As many of you know Bumblebee is the current workaround for using Nvidia optimus with linux. At the heart of bumblebee has been VirtualGL which is now being superseded by Primus.
If you have Bumblebee you’ll know that to use your discrete card you need to invoke “optirun <application>” from the command line and then after a short wait your application runs using the VirtualGL backend. Unfortunately the VirtualGL backend does not play nice with some applications, particularly Wine and Crossover. Primus is the replacement of optirun and it all it means to the end user is that instead of using optirun you now invoke an app with “primusrun <application>”.
I highly recommend (as do the developers of Bumbleebee) primus over VirtualGL because there are a host of benefits. My favorite benefit is that it works perfectly with wine and Crossover meaning I can play my Windows games on my discrete card instead of having to use my integrated one and has substantially better performance too. Here is a post by the Bumblebee Project on G+: https://plus.google.com/102207276811032054708/posts/ic3AJRKf2VF
A fine, upstanding member of out community has already made a repo for us with OBS. software.opensuse.org:
*Install the 32bit version if running a 64bit OS along with the 64bit one as you need it for Wine/Crossover as they are 32bit. I recommend a reboot after install Primus but I don’t think it is essential.
Now if you try run something with primusrun you’ll get an error something like primus:
fatal: failed to load any of the libraries: /usr/$LIB/nvidia-bumblebee/libGL.so.1 ...
Don’t worry, the fix is super easy! All you need to do is copy a few folders and you are done.
From a terminal run:
sudo mkdir /usr/lib/nvidia-bumblebee sudo cp /usr/lib/nvidia/* /usr/lib/nvidia-bumblebee sudo mkdir /usr/lib64/nvidia-bumblebee/ sudo cp /usr/lib64/nvidia/* /usr/lib64/nvidia-bumblebee
Again you might need to reboot. You could always do this with dolphin in super-user mode and just copy paste the files in the same folder and just specify “nvidia-bumblebee” as the folder name. I would highly recommend this to most users as its harder to make a mess up.
vblank_mode=0 primusrun glxspheres
It should give something like this:
:~> vblank_mode=0 primusrun glxspheres Polygons in scene: 62464 ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. Visual ID of window: 0x96 ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: option value of option vblank_mode ignored. Context is Direct OpenGL Renderer: GeForce GT 550M/PCIe/SSE2 primus: sorry, not implemented: glXUseXFont 236.366525 frames/sec - 263.785042 Mpixels/sec 241.331845 frames/sec - 269.326339 Mpixels/sec 240.886716 frames/sec - 268.829575 Mpixels/sec 241.437659 frames/sec - 269.444427 Mpixels/sec 239.505292 frames/sec - 267.287906 Mpixels/sec
In comparison, optirun gives:
:~> vblank_mode=0 optirun glxspheres Polygons in scene: 62464 Visual ID of window: 0x21 Context is Direct OpenGL Renderer: GeForce GT 550M/PCIe/SSE2 110.628062 frames/sec - 123.460917 Mpixels/sec 122.449406 frames/sec - 136.653538 Mpixels/sec 133.291433 frames/sec - 148.753240 Mpixels/sec 133.511781 frames/sec - 148.999148 Mpixels/sec 134.822179 frames/sec - 150.461552 Mpixels/sec
This will not bork your system and is really worth your time if you’re a Nvidia Optimus/Bumblebee user. The improvement in performance alone is worth checking out while the greater flexibility with Wine/Crossover is a real bonus for gamers.
Hope this helps!
To launch a crossover app like steam with primusrun try:
primusrun /opt/cxoffice/bin/wine --bottle "<name of bottle>" --cx-app <name of application>
primusrun /opt/cxoffice/bin/wine --bottle "Steam" --cx-app steam.exe
If this breaks your system, deletes data or irrecoverably ruins your digital life then I am not to be held responsible as you took these steps yourself and should always double check everything you do. Try at your own risk!