You are not logged in.

#1 2017-08-18 16:54:39

aleextra
Member
Registered: 2009-12-02
Posts: 28

CUDA fresh installation - missing libraries

Hi!

I installed today the CUDA toolkit (pacman -S cuda). Now, when trying compile something that uses cuda I am getting failure:

$ g++-5 -lpthread -lcuda
/usr/bin/ld: cannot find -lcuda
collect2: error: ld returned 1 exit status

I even try to add symbolic link into /usr/lib, but it doesn't helps. What can I do more?

Offline

#2 2017-08-18 23:21:28

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: CUDA fresh installation - missing libraries

Try using 'ld-config' to refresh the database and see if that helps.

Offline

#3 2017-08-19 00:37:42

Zeox101
Member
Registered: 2017-02-05
Posts: 93

Re: CUDA fresh installation - missing libraries

You can also try passing it --verbose to get some more info.

"ld -lcuda --verbose"


The Hidden Secret of Arch Linux Forums:
No.  No one here really uses archlinux.  Arch Sucks.
We're just a bunch of neckbeards who tinker with arch linux in our mom's basement during our free time ... which we have a lot of because we are unemployed. ~ Trilby

Offline

#4 2017-08-19 12:05:28

Drehstromlampe
Member
From: GER
Registered: 2015-07-18
Posts: 45

Re: CUDA fresh installation - missing libraries

Offline

#5 2017-08-19 14:40:07

aleextra
Member
Registered: 2009-12-02
Posts: 28

Re: CUDA fresh installation - missing libraries

command: ld -lcuda --verbose returned a lot of data, but I think that at last is important.

attempt to open /usr/x86_64-pc-linux-gnu/lib64/libcuda.so failed
attempt to open /usr/x86_64-pc-linux-gnu/lib64/libcuda.a failed
attempt to open /usr/lib/libcuda.so failed
attempt to open /usr/lib/libcuda.a failed
attempt to open /usr/local/lib/libcuda.so failed
attempt to open /usr/local/lib/libcuda.a failed
attempt to open /usr/x86_64-pc-linux-gnu/lib/libcuda.so failed
attempt to open /usr/x86_64-pc-linux-gnu/lib/libcuda.a failed
ld: cannot find -lcuda

paths are wrong, but:

[mik@mik-pc ~]$ cat /etc/ld.so.conf
#
# /etc/ld.so.conf
#

include /etc/ld.so.conf.d/*.conf

# End of file
[mik@mik-pc ~]$ ls /etc/ld.so.conf.d/
00-nvidia.conf  cuda.conf  fakeroot.conf  ffmpeg2.8.conf  lib32-glibc.conf
[mik@mik-pc ~]$ cat /etc/ld.so.conf.d/cuda.conf 
/opt/cuda/lib64
/opt/cuda/lib
/opt/cuda/nvvm/lib64
/opt/cuda/nvvm/lib

ld-config command is known for me and already executed.
Please see - ldconfig can see cuda library:

[mik@mik-pc ~]$ LC_ALL="C" ldconfig -v
ldconfig: Can't stat /opt/cuda/lib: No such file or directory
ldconfig: Can't stat /opt/cuda/nvvm/lib: No such file or directory
ldconfig: Path `/usr/lib' given more than once
ldconfig: Path `/usr/lib64' given more than once
ldconfig: Can't stat /usr/libx32: No such file or directory
/usr/lib/nvidia:
        libGLESv1_CM.so.1 -> libGLESv1_CM.so.340.102
        libnvidia-ml.so.1 -> libnvidia-ml.so.340.102
        libnvidia-fbc.so.1 -> libnvidia-fbc.so.340.102
        libnvidia-glcore.so.340.102 -> libnvidia-glcore.so.340.102
        libEGL.so.1 -> libEGL.so.340.102
        libcuda.so.1 -> libcuda.so.340.102
        libnvidia-glsi.so.340.102 -> libnvidia-glsi.so.340.102
        libGLESv2.so.2 -> libGLESv2.so.340.102
        libnvidia-eglcore.so.340.102 -> libnvidia-eglcore.so.340.102
        libnvidia-ifr.so.1 -> libnvidia-ifr.so.340.102
        libnvidia-encode.so.1 -> libnvidia-encode.so.340.102
        libnvidia-tls.so.340.102 -> libnvidia-tls.so.340.102
        libnvcuvid.so.1 -> libnvcuvid.so.340.102
        libnvidia-cfg.so.1 -> libnvidia-cfg.so.340.102
        libGL.so.1 -> libGL.so.340.102
/opt/cuda/lib64:
        libnppif.so.8.0 -> libnppif.so.8.0.61
        libnppial.so.8.0 -> libnppial.so.8.0.61
        libcublas.so.8.0 -> libcublas.so.8.0.61
        libnppicc.so.8.0 -> libnppicc.so.8.0.61
        libcudart.so.8.0 -> libcudart.so.8.0.61
        libcusparse.so.8.0 -> libcusparse.so.8.0.61
        libnppim.so.8.0 -> libnppim.so.8.0.61
        libnppicom.so.8.0 -> libnppicom.so.8.0.61
        libcusolver.so.8.0 -> libcusolver.so.8.0.61
        libnppig.so.8.0 -> libnppig.so.8.0.61
        libcuinj64.so.8.0 -> libcuinj64.so.8.0.61
        libnvgraph.so.8.0 -> libnvgraph.so.8.0.61
        libnvToolsExt.so.1 -> libnvToolsExt.so.1.0.0
        libnvrtc.so.8.0 -> libnvrtc.so.8.0.61
        libcufft.so.8.0 -> libcufft.so.8.0.61
        libnppidei.so.8.0 -> libnppidei.so.8.0.61
        libcurand.so.8.0 -> libcurand.so.8.0.61
        libnppisu.so.8.0 -> libnppisu.so.8.0.61
        libnvrtc-builtins.so.8.0 -> libnvrtc-builtins.so.8.0.61
        libnppi.so.8.0 -> libnppi.so.8.0.61
        libOpenCL.so.1 -> libOpenCL.so.1.0.0
        libcufftw.so.8.0 -> libcufftw.so.8.0.61
        libnpps.so.8.0 -> libnpps.so.8.0.61
        libnppist.so.8.0 -> libnppist.so.8.0.61
        libnppitc.so.8.0 -> libnppitc.so.8.0.61
        libnvblas.so.8.0 -> libnvblas.so.8.0.61
        libnppc.so.8.0 -> libnppc.so.8.0.61
/opt/cuda/nvvm/lib64:
        libnvvm.so.3 -> libnvvm.so.3.1.0
/usr/lib/libfakeroot:
        libfakeroot-0.so -> libfakeroot.so
/usr/lib:

Last edited by aleextra (2017-08-19 14:43:43)

Offline

#6 2023-02-05 02:33:05

djhunter67
Member
Registered: 2023-02-04
Posts: 3

Re: CUDA fresh installation - missing libraries

cuda install its binary in the /opt directory.

The bin file there in critical and you need to add it to your path.


# Add nvcc from /opt/cuda/bin to PATH
if [ -d "/opt/cuda/bin" ]; then
    export PATH="/opt/cuda/bin:$PATH"
fi

Sorry, don't know how to do code blocks in this forum.

Offline

#7 2023-02-05 03:17:24

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,280

Re: CUDA fresh installation - missing libraries

Welcome to the forums.  Watch the dates -- I hope this is not still an issue some six years later.
Closing.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB