[elrepo-devel] nvidia-x11-drv additions

Michael Lampe mlampe0 at googlemail.com
Wed Mar 12 16:00:21 EDT 2014


Phil Perry wrote:

> Originally we had symlinks to libnvidia-tls.so.1.

Originally, the soname _was_ libnvidia-tls.so.1 and the link was 
required. Since quite some time now, the soname ist something like 
libnvidia-tls.so.331.49 with the full version number included an no link 
is required:

$ ldd /usr/lib64/nvidia/libGL.so.1
...
         libnvidia-tls.so.331.49 => 
/usr/lib64/nvidia/tls/libnvidia-tls.so.331.49
         libnvidia-glcore.so.331.49 => 
/usr/lib64/nvidia/libnvidia-glcore.so.331.49
...

> Some further investigation; I'm wondering if when compiling stuff
> against libGL, /usr/lib{64}/nvidia/libGL.so is pulled in, and that lib
> has reference to libnvidia-tls.so (even though it's not an SONAME),
> implying we might need that symlink.

No. Only the libs you link with explicitly are stored as dependencies in 
the binary, inter-library dependencies are not.

You can compile a program on one machine with the nvidia drivers 
installed and then run the binary on another machine with mesa installed.

> Anyway, I don't have an issue with adding symlinks for libnvidia-tls.so
> and libnvidia-tls.so.1 as this certainly won't break anything.

Only my trust in the sanity of this package. :)

> Indeed, but as bug #299 previously showed, some folks are clearly trying
> to build software that is causing issues for them. Where we can
> accommodate them without impacting other users, I'm happy to do so, as
> we did in bug #299 by reinstating the extra libnvidia-tls.so lib.

You need both versions. The compile-time linker will look in 
/usr/lib64/nvidia (if you request so) and then _check_ that all 
inter-library dependencies are fulfilled. E.g.:

 > sudo mv /usr/lib64/nvidia/libnvidia-tls.so.331.49 
/usr/lib64/nvidia/libnvidia-tls.so.331.49-defunct
 > gcc helloWorld.c -L/usr/lib64/nvidia -lglut -lGLU -lGL
/usr/bin/ld: warning: libnvidia-tls.so.331.49, needed by 
/usr/lib64/nvidia/libGL.so, not found (try using -rpath or -rpath-link)
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv010tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv018tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv023tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv012tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv006tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv021tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv008tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv015tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv017tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv019tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv013tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv022tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv020tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv007tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv014tls'
/usr/lib64/nvidia/libGL.so: undefined reference to `_nv016tls'
collect2: ld returned 1 exit status

Just as a proof:

 > gcc helloWorld.c -L/usr/lib64/nvidia 
-Wl,--unresolved-symbols=ignore-all -lglut -lGLU -lGL
/usr/bin/ld: warning: libnvidia-tls.so.331.49, needed by 
/usr/lib64/nvidia/libGL.so, not found (try using -rpath or -rpath-link)

This still gives you a working binary, because the runtime linker will 
pick up the (non defunct) lib in tls/.

-Michael

PS: And normally you would not say '-L/usr/lib64/nvidia' and do the 
compile-time linking with Mesa's libGL which is immune to this Nvidia stuff.



More information about the elrepo-devel mailing list