LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Primusrun (bumblebee) not working (Slackware64 14.0) (http://www.linuxquestions.org/questions/slackware-14/primusrun-bumblebee-not-working-slackware64-14-0-a-4175452431/)

natharran 03-02-2013 04:34 PM

Primusrun (bumblebee) not working (Slackware64 14.0)
 
Hi guys,

I need help with making primus work, it isn't willing to cooperate.

I downloaded the bumblebee SlackBuid as instructed at docs.slackware.com and made it all work according to the guide. It ran without problems. The guide, however, doesn't mention the primus package, so I read a bit about it and decided to try it. VirtualGL, libjpeg-turbo and primus are compiled as 32-compat and I use nvidia proprietary driver. I had several issues with undetectable libraries but solved it by editing the /usr/bin/primusrun script (uncommenting specific lines and correcting some paths). So it now looks like this:
Code:

#!/bin/bash

# Readback-display synchronization method
# 0: no sync, 1: D lags behind one frame, 2: fully synced
# export PRIMUS_SYNC=${PRIMUS_SYNC:-2}

# Verbosity level
# 0: only errors, 1: warnings (default), 2: profiling
# export PRIMUS_VERBOSE=${PRIMUS_VERBOSE:-1}

# Secondary display
# export PRIMUS_DISPLAY=${PRIMUS_DISPLAY:-:8}

# "Accelerating" libGL
# $LIB will be interpreted by the dynamic linker
export PRIMUS_libGLa=${PRIMUS_libGLa:-'/usr/$LIB/libGL.so.1'}

# "Displaying" libGL
export PRIMUS_libGLd=${PRIMUS_libGLd:-'/usr/$LIB/libGL.so.1'}

# Directory containing primus libGL
PRIMUS_libGL=${PRIMUS_libGL:-/usr/lib64/primus:/usr/lib/primus}

# On some distributions, e.g. on Gentoo, libnvidia-tls.so is not available
# in default search paths.  Add its path manually after the primus library
PRIMUS_libGL=${PRIMUS_libGL}:/usr/lib64:/usr/lib

# Mesa drivers need a few symbols to be visible
export PRIMUS_LOAD_GLOBAL=${PRIMUS_LOAD_GLOBAL:-'libglapi.so.0'}

# Need functions from primus libGL to take precedence
export LD_LIBRARY_PATH=${PRIMUS_libGL}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

# And go!
exec "$@"

But one error doesn't go away. When I run
Code:

primusrun <anything>
I just get this:
Code:

primus: fatal: failed to load PRIMUS_LOAD_GLOBAL
Even after uncommenting the PRIMUS_LOAD_GLOBAL line in the script. I tried to modify it in several ways:
Code:

export PRIMUS_LOAD_GLOBAL=${PRIMUS_LOAD_GLOBAL:-'/usr/lib/libglapi.so.0'}
export PRIMUS_LOAD_GLOBAL=${PRIMUS_LOAD_GLOBAL:-/usr/lib/libglapi.so.0}
export PRIMUS_LOAD_GLOBAL=${PRIMUS_LOAD_GLOBAL}:/usr/lib/libglapi.so.0
export PRIMUS_LOAD_GLOBAL=${PRIMUS_LOAD_GLOBAL:-'/usr/$LIB/libglapi.so.0'}

I even tried to appoint the libglapi manually before running the script
Code:

export PRIMUS_LOAD_GLOBAL=/usr/lib/libglapi.so.0
and
Code:

export PRIMUS_LOAD_GLOBAL=/usr/lib
leaving the original PRIMUS_LOAD_GLOBAL in the script unchanged. Nothing I write there works (and before you ask, yes, the libglapi.so.0 IS there ;) ).

Most of the problems with primusrun I was able to google were just dealing with undetectable libraries by manually setting variables in bash (which is odd, one would say that doing this by uncommenting lines in the script is better solution than export 6 variables every time you want to run it), but I wasn't able to find any solution to this particular error (a few threads at various forums mention it, but don't provide useful advices).

Any help will be much appreciated.

natharran 03-04-2013 06:07 PM

Well I finally found the cause.

The problem really was in libglapi library. I installed a rebuilt mesa-compat32 package with libglapi enabled from Alien Bob but it didn't occur to me that this only adds 32bit library to my system. I tried to run several 32bit apps with primusrun and the error didn't occur (there was another one, though, see below). Just then I noticed that there's no such library in /usr/lib64 so I rebuild mesa 64bit with
Code:

--enable-shared-glapi
passed to configure script as Alien Bob instructed at his blog and "hurray", it dies at a different point.

Code:

primusrun glxspheres

Polygons in scene: 62464
Xlib:  extension "GLX" missing on display ":0".
ERROR (593): Could not obtain RGB visual with requested properties

The web is full of reports of this issue with some adapters but so far I wasn't able to find a solution. Will post it here if I actually make it work some day.

-natharran


All times are GMT -5. The time now is 09:35 AM.