Bumblebee + CUDA7.0 working but problems compiling examples 2 of 2

Trying with the second part see 1 of 2. I had to delete parts otherwise this forum
doesn’t let me post them. I tried from Firefox and Chrome, same. Preview often
doesn’t work, posts are cancelled.

Compilation eventually fails on bindlessTexture, just after deviceQuery
warning: libnvidia-tls.so.346.46, needed by /usr/X11R6/lib64/libGL.so, not found (try using -rpath or -rpath-link)

I found this http://askubuntu.com/questions/600711/cuda-7-0-test-failed-on-ubuntu-14-04

I found libnvidia-tls.so.346.46 in /local/usr/nvidia

I added /usr/local/nvidia to $LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/usr/lib/nvidia/:/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH
source .bashrc
echo $LD_LIBRARY_PATH
/usr/lib/nvidia/:/usr/local/cuda-7.0/lib64:/usr/lib/nvidia/:/usr/local/cuda-7.0/lib64:usr/lib/nvidia/:/usr/local/cuda-7.0/lib64:/usr/local/cuda-7.0/lib64:/usr/local/cuda-7.0/lib64:

Unfortunately the compilation fails in exactly the same way. I was sure it would fix it.

BTW, I also tried to compile under optirun, no difference.

make clean
optirun --no-xorg bash
make
..........failed as before
optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is on.
exit
optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.

This was suggested to me somewhere else.

Some more details on the libnvidia-tls.so.346.46 :

ls /usr/lib/nvidia/
alternate-install-present          libGL.so    libGL.so.346.59  libOpenCL.so.1.0.0  pre-install
alternate-install-present-default  libGL.so.1  libOpenCL.so     post-uninstall
ldd /usr/lib/nvidia/libGL.so
        linux-gate.so.1 (0xf77a0000)
        libnvidia-tls.so.346.59 => /usr/lib/libnvidia-tls.so.346.59 (0xf7656000)
        libnvidia-glcore.so.346.59 => /usr/lib/libnvidia-glcore.so.346.59 (0xf4fc8000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xf4e8d000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xf4e7a000)
        libc.so.6 => /lib/libc.so.6 (0xf4ccd000)
        libdl.so.2 => /lib/libdl.so.2 (0xf4cc8000)
        libm.so.6 => /lib/libm.so.6 (0xf4c82000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0xf4c5f000)
        /lib/ld-linux.so.2 (0xf77a3000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xf4c5b000)

Also, this is the stuff I have installed :

> rpm -qa | grep nvidia
nvidia-glG03-346.46-0.x86_64
nvidia-computeG03-346.46-0.x86_64
nvidia-uvm-gfxG03-kmp-default-346.46_k3.16.6_2-0.x86_64
nvidia-texture-tools-2.0.6-25.1.8.x86_64
nvidia-gfxG03-kmp-default-346.46_k3.16.6_2-0.x86_64
nvidia-bumblebee-346.59-1.1.x86_64
nvidia-bumblebee-32bit-346.59-1.1.x86_64
> rpm -qa | grep cuda
cuda-cusparse-7-0-7.0-28.x86_64
cuda-runtime-7-0-7.0-28.x86_64
cuda-curand-7-0-7.0-28.x86_64
cuda-curand-dev-7-0-7.0-28.x86_64
cuda-driver-dev-7-0-7.0-28.x86_64
cuda-npp-dev-7-0-7.0-28.x86_64
cuda-command-line-tools-7-0-7.0-28.x86_64
cuda-cudart-7-0-7.0-28.x86_64
cuda-cufft-dev-7-0-7.0-28.x86_64
cuda-visual-tools-7-0-7.0-28.x86_64
cuda-npp-7-0-7.0-28.x86_64
cuda-cublas-7-0-7.0-28.x86_64
cuda-cusparse-dev-7-0-7.0-28.x86_64
cuda-7-0-7.0-28.x86_64
cuda-cufft-7-0-7.0-28.x86_64
cuda-core-7-0-7.0-28.x86_64
cuda-cublas-dev-7-0-7.0-28.x86_64
cuda-documentation-7-0-7.0-28.x86_64
cuda-7.0-28.x86_64
cuda-license-7-0-7.0-28.x86_64
cuda-cusolver-7-0-7.0-28.x86_64

For the record, I also installed :
nvidia-uvm-gfxG03-kmp-desktop-346.46_k3.16.6_2-0.x86_64
nvidia-gfxG03-kmp-desktop.346.46_k3.16.6_2-0.x86_64

And then removed them with Yast. I am confused because I saw someone else’s
with only the .default. versions.

However, the Nvidia Guide http://developer.download.nvidia.com…rted_Linux.pdf
says :

When installing cuda, the correct driver packages should also be specified. Without
doing this, zypper will select packages that may not work on the system. Run the
following to detect the flavor of kernel and install cuda with the appropriate driver
packages:
$
uname -r
3.4.6-2.10-<flavor>
$
sudo zypper install cuda nvidia-gfxG03-kmp-<flavor> \
nvidia-uvm-gfxG03-kmp-<flavor>

On my system, uname -r returns 3.16.7-21-desktop
So maybe I should re-install the .desktop. version as well.

Almost the full error, I still can’t post all of it One line had to be deleted, otherwise
it doesn’t show in Preview and gives a “security error” if posted

/usr/local/cuda-7.0/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35
,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,
code=compute_52 -o bindlessTexture bindlessTexture.o bindlessTexture_kernel.o -L…/…/common/lib/linux/x86_64
-L/usr/X11R6/lib64 -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW
– Misisng line here–
warning: libnvidia-tls.so.346.46, needed by /usr/X11R6/lib64/libGL.so, not found (try using
-rpath or -rpath-link)
/usr/X11R6/lib64/libGL.so: undefined reference to _nv018tls' /usr/X11R6/lib64/libGL.so: undefined reference to _nv023tls’
/usr/X11R6/lib64/libGL.so: undefined reference to _nv015tls' /usr/X11R6/lib64/libGL.so: undefined reference to _nv019tls’
/usr/X11R6/lib64/libGL.so: undefined reference to _nv017tls' /usr/X11R6/lib64/libGL.so: undefined reference to _nv013tls’
/usr/X11R6/lib64/libGL.so: undefined reference to _nv024tls' /usr/X11R6/lib64/libGL.so: undefined reference to _nv022tls’
/usr/X11R6/lib64/libGL.so: undefined reference to _nv007tls' /usr/X11R6/lib64/libGL.so: undefined reference to _nv009tls’
/usr/X11R6/lib64/libGL.so: undefined reference to _nv020tls' /usr/X11R6/lib64/libGL.so: undefined reference to _nv016tls’
/usr/X11R6/lib64/libGL.so: undefined reference to _nv008tls' /usr/X11R6/lib64/libGL.so: undefined reference to _nv006tls’
/usr/X11R6/lib64/libGL.so: undefined reference to _nv021tls' /usr/X11R6/lib64/libGL.so: undefined reference to _nv011tls’
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv014tls’
collect2: error: ld returned 1 exit status
Makefile:253: recipe for target ‘bindlessTexture’ failed
make[1]: *** [bindlessTexture] Error 1
make[1]: Leaving directory ‘/home/enzo/NVIDIA_CUDA-7.0_Samples/NVIDIA_CUDA-7.0_Samples/2_Graphics/bindlessTexture’
Makefile:52: recipe for target ‘2_Graphics/bindlessTexture/Makefile.ph_build’ failed
make: *** [2_Graphics/bindlessTexture/Makefile.ph_build] Error 2

I see, on this forum the string “g c c” with no space is forbidden.
And so other things I am re-writing the misisng line with extra spaces and other work-arounds.
The missing line is :
/usr/lib64/ “g c c” /x86_64-suse-linux /4.8/ …/…/ …/…/ x86_64-suse-linux/bin/ld: warning: libnvidia-tls.so.346.46, needed by /usr/X11R6/lib64/libGL.so, not found (try using -rpath or -rpath-link)

I took me ages to discover why what I typed cause security errors and no Preview.
Security that is user-antagonistic!

I found something similar here but I’'m not sure what to do :
https://github.com/aaronp24/arch-nvidia-utils/issues/2

Can anyone help with this ?

I made a search on my whole hard drive for ibnvidia-tls.so.346.46 and failed to locate it.
I found instead /usr/lib/libnvidia-tls.so.346.59 which is the same version of Bumblebee.
So, ibnvidia-tls.so.346.46 does not exist on my system.Where do I find it ?

You shouldn’t need both 346.46 and 346.59.

These are all tied to the GPU driver version installed, they should all match the GPU driver version installed. If you have mostly 346.59 installed, and you have some component somewhere that thinks it needs 346.46, then you have a corrupted install of some sort.

Thanks for replying.

I realize that something is wrong.
However, my system did not initially work until I installed Bumblebee which is 346.59 1.1 .
It is a laptop with Optimus technology.
I could update Bumblebee but it looks like 361.28-1.1.
That would still create a conflict as CUDA7.0 comes with 346.46.
I have heard of people that had Bumblebee and CUDA working with different versions.

Anyway, I found libnvidia-tls.so.346.46 in x11-video-nvidiaG03-346.46-0.x86_64.rpm
(which is part of CUDA7.0 rpm).
which the CUDA installed avoid installing, probably because the version was smaller than
Bumblebee’s.

> rpm -qlp x11-video-nvidiaG03-346.46-0.x86_64.rpm | egrep -e libnvidia
/usr/lib/libnvidia-compiler.so.346.46
/usr/lib/libnvidia-encode.so.1
/usr/lib/libnvidia-encode.so.346.46
/usr/lib/libnvidia-fbc.so.1
/usr/lib/libnvidia-fbc.so.346.46
/usr/lib/libnvidia-ml.so.1
/usr/lib/libnvidia-ml.so.346.46
/usr/lib/libnvidia-opencl.so.1
/usr/lib/libnvidia-opencl.so.346.46
/usr/lib/libnvidia-tls.so.346.46
/usr/lib/tls/libnvidia-tls.so.346.46
/usr/lib64/libnvidia-cfg.so.1
/usr/lib64/libnvidia-cfg.so.346.46
/usr/lib64/libnvidia-compiler.so.346.46
/usr/lib64/libnvidia-eglcore.so.346.46
/usr/lib64/libnvidia-encode.so.1
/usr/lib64/libnvidia-encode.so.346.46
/usr/lib64/libnvidia-glsi.so.346.46
/usr/lib64/libnvidia-tls.so.346.46
/usr/lib64/libnvidia-wfb.so.1
/usr/lib64/libnvidia-wfb.so.346.46
/usr/lib64/tls/libnvidia-tls.so.346.46

I’m wary of installing it all as it might stuff up Bumblebee.
However, I should be able to extract and copy only the libnvidia-tls.so.346.46 files.

Start over, get your system working the way you want it with bumblebee (and, let’s say 346.59). There shouldn’t be any other versions of anything like 346.46. Once you’re happy that everything is working as desired, install CUDA 7.0 using the runfile installer method rather than the package manager method. During runfile installation, select no when prompted to install the driver.

I think I know what happened and that’s how I fixed it.
One year ago, I got a laptop with Optimus technology and tried to install Opensuse13.2 .
The display was highly unstable and I had to install Bumblebee 346.59-1.1. I had
some problems installing it, and I am reluctant to change it.
A few days ago , I stopped procrastinating and installed CUDA7.0 .
Choosing CUDA7.0 (vs 7.5) was intentional as it is 346.46, lower than Bumblebee and
hopefully less conflicting.

I used the rpm method and I am now pretty sure that the CUDA7.0 installer did not
install x11-video-nvidiaG03-346.46-0.x86_64.rpm on purpose because its version number
was lower than Bumblebee. Or some other reason, but anyway, it didn’t.

x11-video-nvidiaG03-346.46-0.x86_64.rpm contains the missing libnvidia-tls.so.346.46

So, I could install x11-video-nvidiaG03-346.46-0.x86_64 myself, right ? Except that
I was worried that it would interfere with Bumblebee and leave me with a bigger problem.

So, I did the following :

  • Found x11-video-nvidiaG03-346.46-0.x86_64.rpm in /var/cuda-repo-7-0-local/
  • Copied it in a /tmp/test directory to work on it without screwing it up
  • Extracted a local copy with rpm2cpio x11-video-nvidiaG03-346.46-0.x86_64.rpm | cpio -idmv
  • I copied the local usr/lib/libnvidia-tls.so.346.46 to usr/lib/libnvidia-tls.so.346.46
  • I copied the local usr/lib64/libnvidia-tls.so.346.46 to usr/lib64/libnvidia-tls.so.346.46

That worked for bindlessTexture and all the 2_Graphics.

However it failed because ld: cannot find -lnvcuvid (missing libnvcuvid.so.346.46)
Again, I copied from the extracted libnvcuvid.so.346.46 for /usr/lib and /usr/lib64
This time i had to also create a symbolic link for each of them so the linker could find them:
libnvcuvid.so -> libnvcuvid.so.346.46

I still have some other warnings but the examples now compile.