Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 571526 - [bumblebee overlay] x11-misc/primusrun with x11-drivers/nvidia-drivers-361.18 - primus: fatal: failed to load any of the libraries: [...] libGL.so.1
Summary: [bumblebee overlay] x11-misc/primusrun with x11-drivers/nvidia-drivers-361.18...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Vadim A. Misbakh-Soloviov (mva)
URL: https://github.com/NVIDIA/libglvnd
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-11 01:27 UTC by Sven
Modified: 2016-10-15 07:15 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 2016-01-11 01:27:23 UTC
After upgrading to 361.16 from 358-16, primusrun stopped working.


Reproducible: Always

Steps to Reproduce:
1. Install primus from bumblebee overlay (layman)
2. primusrun bash
3. glxgears
Actual Results:  
$ glxgears 
primus: fatal: failed to load any of the libraries: /usr/lib64/opengl/nvidia/lib/libGL.so.1:/usr/lib32/opengl/nvidia/lib/libGL.so.1:/usr/lib/opengl/nvidia/lib/libGL.so.1
libGLX.so.0: cannot open shared object file: No such file or directory
/usr/lib32/opengl/nvidia/lib/libGL.so.1: wrong ELF class: ELFCLASS32
libGLX.so.0: cannot open shared object file: No such file or directory


Expected Results:  
spinning gears
Comment 1 Richard Otis 2016-01-13 00:42:29 UTC
(In reply to Sven from comment #0)
> After upgrading to 361.16 from 358-16, primusrun stopped working.
> 
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Install primus from bumblebee overlay (layman)
> 2. primusrun bash
> 3. glxgears
> Actual Results:  
> $ glxgears 
> primus: fatal: failed to load any of the libraries:
> /usr/lib64/opengl/nvidia/lib/libGL.so.1:/usr/lib32/opengl/nvidia/lib/libGL.
> so.1:/usr/lib/opengl/nvidia/lib/libGL.so.1
> libGLX.so.0: cannot open shared object file: No such file or directory
> /usr/lib32/opengl/nvidia/lib/libGL.so.1: wrong ELF class: ELFCLASS32
> libGLX.so.0: cannot open shared object file: No such file or directory
> 
> 
> Expected Results:  
> spinning gears

What is the output of "eselect opengl list" ? Do you get the same error after running "sudo eselect opengl set nvidia" ?
Comment 2 Richard Otis 2016-01-13 03:30:48 UTC
(In reply to Richard Otis from comment #1)
> (In reply to Sven from comment #0)
> > After upgrading to 361.16 from 358-16, primusrun stopped working.
> > 
> > 
> > Reproducible: Always
> > 
> > Steps to Reproduce:
> > 1. Install primus from bumblebee overlay (layman)
> > 2. primusrun bash
> > 3. glxgears
> > Actual Results:  
> > $ glxgears 
> > primus: fatal: failed to load any of the libraries:
> > /usr/lib64/opengl/nvidia/lib/libGL.so.1:/usr/lib32/opengl/nvidia/lib/libGL.
> > so.1:/usr/lib/opengl/nvidia/lib/libGL.so.1
> > libGLX.so.0: cannot open shared object file: No such file or directory
> > /usr/lib32/opengl/nvidia/lib/libGL.so.1: wrong ELF class: ELFCLASS32
> > libGLX.so.0: cannot open shared object file: No such file or directory
> > 
> > 
> > Expected Results:  
> > spinning gears
> 
> What is the output of "eselect opengl list" ? Do you get the same error
> after running "sudo eselect opengl set nvidia" ?

Sorry, running that command will actually break things on reboot. For bumblebee you should keep opengl set on xorg-x11.

I am not sure if this is an nvidia-drivers issue, though I am still on 358.16. When I was getting "wrong ELF class" errors with primus earlier this week I reinstalled mesa, ran "revdep-rebuild" to make sure I didn't miss any dependencies and verified my LD_LIBRARY_PATH looked reasonable. In your case it looks like /usr/lib32 might be earlier in your path than /usr/lib64? Following those steps seemed to fix it.

You can also check your /var/log/Xorg.0.log to make sure your primary graphics drivers are correctly installed. That can also be checked by making sure glxgears runs without primus.
Comment 3 Sven 2016-01-13 10:57:38 UTC
Things work again, after downgrading nvidia-drivers to the version prior to 361.16. So I believe it must be an nvidia-drivers issue (or at least some incompatibility between nvidia-drivers and primusrun). Also, great portions of the ebuild for 361.16 have been rewritten. Especially the parts that install the libraries, manage symlinks, etc. - it's not unlikely that something broke in the process.
Comment 4 Sven 2016-01-16 01:23:44 UTC
primusrun is still broken with 361.18
Comment 5 Konstantin Likhomanov 2016-01-16 23:25:38 UTC
Interestingly, ldd fails on nvidia's libGL.so.1 with the same error and i haven't found an LD-LIBRARY-PATH setting which makes it find the library which sits in the same directory
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2016-01-22 05:02:17 UTC
You probably want to read this:

"

The OpenGL Vendor-Neutral Driver (GLVND) infrastructure is now included and supported by the NVIDIA GLX and OpenGL drivers.  This should not cause any visible changes in behavior for end users, but some internal driver component libraries have been renamed and/or moved as a result. These changes may affect scripts that rely on the presence of NVIDIA OpenGL driver components other than those specified in the Linux OpenGL ABI version 1.0, maintainers of alternative NVIDIA driver installation packages, and applications which rely on the presence of any non- OpenGL/GLX symbols in the libGL.so.1 library and its dependencies in any way.

"   http://www.geforce.com/drivers/results/97473
Comment 7 Sven 2016-01-24 12:11:09 UTC
(In reply to Jeroen Roovers from comment #6)
> You probably want to read this:
> 
> "
> 
> The OpenGL Vendor-Neutral Driver (GLVND) infrastructure is now included and
> supported by the NVIDIA GLX and OpenGL drivers.  This should not cause any
> visible changes in behavior for end users, but some internal driver
> component libraries have been renamed and/or moved as a result. These
> changes may affect scripts that rely on the presence of NVIDIA OpenGL driver
> components other than those specified in the Linux OpenGL ABI version 1.0,
> maintainers of alternative NVIDIA driver installation packages, and
> applications which rely on the presence of any non- OpenGL/GLX symbols in
> the libGL.so.1 library and its dependencies in any way.
> 
> "   http://www.geforce.com/drivers/results/97473

Does this make primusrun and friends obsolete? Or is still, at this point, prohibit primusrun from working?

I really need primusrun. It's recommended by Valve (for Steam and Dota) and optirun (while working with glxgears) won't work with Dota.
Comment 8 Sven 2016-02-11 01:38:46 UTC
"LD_LIBRARY_PATH=/usr/lib64/opengl/nvidia/lib/ primusrun glxgears" works here with nvidia-drivers-361.28
Comment 9 Sven 2016-02-11 01:42:14 UTC
In /usr/bin/primusrun, there's the following:

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

Maybe Gentoo should install primusrun with a line like 
PRIMUS_libGL=${PRIMUS_libGL}:/usr/lib64/opengl/nvidia/lib:/usr/lib32/opengl/nvidia/lib
Comment 10 Sven 2016-02-11 01:47:25 UTC
The solution suggested in my last comment works with glxgears, but not with Dota.
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2016-02-12 06:34:32 UTC
(In reply to Jeroen Roovers from comment #6)

361.28 is out now and Nvidia calls it stable.

http://www.nvidia.com/download/driverResults.aspx/98373/en-us says:

"

Added a legacy, non-GLVND libGL.so GLX client library to the NVIDIA Linux driver installer package, and the ability to select between a GLVND or non-GLVND GLX client library at installation time. This allows users to install the legacy non-GLVND GLX client library in order to work around compatibility issues which may arise due to GLX applications which depend upon behaviors of the NVIDIA GLX client driver which are not defined by the Linux OpenGL ABI version 1.0.

"

In =x11-drivers/nvidia-drivers-361.28-r1 I added USE=compat which installs libGL.so.361.28 (which I think is the "non-GLVND") instead of libGL.so.1.0.0.
Comment 12 Sven 2016-02-12 22:48:27 UTC
with USE=compat, everything is working just fine.
Comment 13 jorgicio 2016-03-26 23:48:01 UTC
The same happens with version 361.28:

jorgicio@hackenherr:~$ primusrun glxgears                                                                                                                                             [20:29:48]
primus: fatal: failed to load any of the libraries: /usr/lib64/opengl/nvidia/lib/libGL.so.1:/usr/lib32/opengl/nvidia/lib/libGL.so.1:/usr/lib/opengl/nvidia/lib/libGL.so.1
libGLX.so.0: cannot open shared object file: No such file or directory
/usr/lib32/opengl/nvidia/lib/libGL.so.1: wrong ELF class: ELFCLASS32
libGLX.so.0: cannot open shared object file: No such file or directory


Which is the stable one. So I had to add the ~arch to the package and it's now working.
Comment 14 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2016-07-21 18:05:01 UTC
I reassigning bug to primus author, so he'll maintain bug report and will close it when fix issue in upstream
Comment 15 Alexander Monakov 2016-07-21 20:53:17 UTC
Although I'm not a Gentoo developer, in the past I've made several attempts to provide constructive feedback on nvidia-related issues (bug 491450, bug 506696, bug 507098, bug 508196), and each time it went nowhere. Sorry, not eager to repeat that mistake again — please don't assign your bugs to me.
Comment 16 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2016-07-21 21:10:49 UTC
Erm... Okay, I'll keep bug assigned to me, But anyway, from my point of view, it is not ebuild-related thing, but related primus itself (to detect which libGL nvidia gives and how to work with it). And I think it is a bad idea to force demetd on nvidia-drivers[compat], because it is big chances some modern software will require the opposite.

And what's your thoughts about that?

P.S. I'm not a gentoo developer either. Bug is assigned on be because I listed as main contact for bumblebee overlay

// P.P.S. to all: by the way, my current laptop is not optimus powered (it using scheme, that requires reboot to switch between cards). So it is pretty hard for me to maintain bumblebee now, so I also call for "new blood" (people who want to proxy-maint bumblebee instead of me and who will take care on bumblebee overlay).
Comment 17 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2016-07-21 21:14:55 UTC
Eerm.. It seems, Alexander isn't added himself to CC when returned bug on me, so I guess, he doesn't get the answer.

So, Sven (bug reporter), can you try to report issue upstream? https://github.com/amonakov/primus
Comment 18 Sven 2016-07-22 08:10:25 UTC
(In reply to Vadim A. Misbakh-Soloviov (mva) from comment #17)
> So, Sven (bug reporter), can you try to report issue upstream?
> https://github.com/amonakov/primus

The issue has already been reported upstream, I believe:
https://github.com/amonakov/primus/issues/178

Problem is, that now that it's "fixed" with the compat useflag, nobody seems to care anymore.
Comment 19 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2016-07-22 08:30:12 UTC
Yup. And all I can do is to add nvidia-drivers[compat] in deps. But I dislike that solution too.

In my opinion there should be some kind of detection (for what version of nvidia's libGL is present) in primus code and do apropriate things depends on that.

// Or, at least, tell users in understandable language that they need non-GLVND libGL for primus to work.

IMHO.
Comment 20 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2016-10-15 07:15:40 UTC
fixed in c68f213