I was a bit confused while trying to find the location of the libcudart.so
file on my linux machine.
The path for libcuda.so
(CUDA driver API library) is fixed and it occurs at only one place (if I am not mistaken):
/usr/lib/x86_64-linux-gnu$ ls -lh libcu*
lrwxrwxrwx 1 root root 17 Sep 7 22:55 libcublasLt.so -> libcublasLt.so.10
lrwxrwxrwx 1 root root 25 Sep 7 22:55 libcublasLt.so.10 -> libcublasLt.so.10.2.0.168
-rwxr-xr-x 1 root root 32M Sep 7 22:55 libcublasLt.so.10.2.0.168
-rw-r--r-- 1 root root 35M Sep 7 22:55 libcublasLt_static.a
lrwxrwxrwx 1 root root 15 Sep 7 22:55 libcublas.so -> libcublas.so.10
lrwxrwxrwx 1 root root 23 Sep 7 22:55 libcublas.so.10 -> libcublas.so.10.2.0.168
-rwxr-xr-x 1 root root 60M Sep 7 22:55 libcublas.so.10.2.0.168
-rw-r--r-- 1 root root 72M Sep 7 22:55 libcublas_static.a
lrwxrwxrwx 1 root root 29 Sep 9 21:13 libcudadebugger.so.1 -> libcudadebugger.so.535.104.05
-rwxr-xr-x 1 root root 9.8M Sep 9 21:13 libcudadebugger.so.535.104.05
lrwxrwxrwx 1 root root 12 Sep 9 21:13 libcuda.so -> libcuda.so.1
lrwxrwxrwx 1 root root 21 Sep 9 21:13 libcuda.so.1 -> libcuda.so.535.104.05
-rwxr-xr-x 1 root root 28M Sep 9 21:13 libcuda.so.535.104.05
lrwxrwxrwx 1 root root 29 Sep 1 01:38 libcudnn.so -> /etc/alternatives/libcudnn_so
lrwxrwxrwx 1 root root 17 Sep 3 21:31 libcudnn.so.7 -> libcudnn.so.7.6.3
-rw-r--r-- 1 root root 410M Aug 15 2019 libcudnn.so.7.6.3
lrwxrwxrwx 1 root root 32 Sep 1 01:38 libcudnn_static.a -> /etc/alternatives/libcudnn_stlib
-rw-r--r-- 1 root root 387M Aug 15 2019 libcudnn_static_v7.a
-rw-r--r-- 1 root root 55K May 25 18:14 libcupscgi.so.1
lrwxrwxrwx 1 root root 23 May 15 20:05 libcupsfilters.so.1 -> libcupsfilters.so.1.0.0
-rw-r--r-- 1 root root 211K May 15 20:05 libcupsfilters.so.1.0.0
-rw-r--r-- 1 root root 34K May 25 18:14 libcupsimage.so.2
-rw-r--r-- 1 root root 26K May 25 18:14 libcupsmime.so.1
-rw-r--r-- 1 root root 115K May 25 18:14 libcupsppdc.so.1
-rw-r--r-- 1 root root 558K May 25 18:14 libcups.so.2
lrwxrwxrwx 1 root root 19 Mar 15 2023 libcurl-gnutls.so.3 -> libcurl-gnutls.so.4
lrwxrwxrwx 1 root root 23 Mar 15 2023 libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.5.0
-rw-r--r-- 1 root root 515K Mar 15 2023 libcurl-gnutls.so.4.5.0
lrwxrwxrwx 1 root root 16 Mar 15 2023 libcurl.so.4 -> libcurl.so.4.5.0
-rw-r--r-- 1 root root 523K Mar 15 2023 libcurl.so.4.5.0
But when I tried to find the location of libcudart.so
(CUDA Runtime API library), I found it at at least two places:
/usr/local/cuda/lib64$ ls -lh libcu*
-rw-r--r-- 1 root root 703K Sep 7 22:55 libcudadevrt.a
lrwxrwxrwx 1 root root 17 Sep 7 22:55 libcudart.so -> libcudart.so.10.1
lrwxrwxrwx 1 root root 21 Sep 7 22:55 libcudart.so.10.1 -> libcudart.so.10.1.168
-rwxr-xr-x 1 root root 493K Sep 7 22:55 libcudart.so.10.1.168
-rw-r--r-- 1 root root 868K Sep 7 22:55 libcudart_static.a
lrwxrwxrwx 1 root root 14 Sep 7 22:55 libcufft.so -> libcufft.so.10
lrwxrwxrwx 1 root root 20 Sep 7 22:55 libcufft.so.10 -> libcufft.so.10.1.168
-rwxr-xr-x 1 root root 132M Sep 7 22:55 libcufft.so.10.1.168
-rw-r--r-- 1 root root 137M Sep 7 22:55 libcufft_static.a
-rw-r--r-- 1 root root 143M Sep 7 22:55 libcufft_static_nocallback.a
lrwxrwxrwx 1 root root 15 Sep 7 22:55 libcufftw.so -> libcufftw.so.10
lrwxrwxrwx 1 root root 21 Sep 7 22:55 libcufftw.so.10 -> libcufftw.so.10.1.168
-rwxr-xr-x 1 root root 489K Sep 7 22:55 libcufftw.so.10.1.168
-rw-r--r-- 1 root root 33K Sep 7 22:55 libcufftw_static.a
lrwxrwxrwx 1 root root 18 Sep 7 22:55 libcuinj64.so -> libcuinj64.so.10.1
lrwxrwxrwx 1 root root 22 Sep 7 22:55 libcuinj64.so.10.1 -> libcuinj64.so.10.1.168
-rwxr-xr-x 1 root root 7.5M Sep 7 22:55 libcuinj64.so.10.1.168
-rw-r--r-- 1 root root 32K Sep 7 22:55 libculibos.a
lrwxrwxrwx 1 root root 15 Sep 7 22:55 libcurand.so -> libcurand.so.10
lrwxrwxrwx 1 root root 21 Sep 7 22:55 libcurand.so.10 -> libcurand.so.10.1.168
-rwxr-xr-x 1 root root 58M Sep 7 22:55 libcurand.so.10.1.168
-rw-r--r-- 1 root root 58M Sep 7 22:55 libcurand_static.a
lrwxrwxrwx 1 root root 17 Sep 7 22:55 libcusolver.so -> libcusolver.so.10
lrwxrwxrwx 1 root root 23 Sep 7 22:55 libcusolver.so.10 -> libcusolver.so.10.1.168
-rwxr-xr-x 1 root root 175M Sep 7 22:55 libcusolver.so.10.1.168
-rw-r--r-- 1 root root 91M Sep 7 22:55 libcusolver_static.a
lrwxrwxrwx 1 root root 17 Sep 7 22:55 libcusparse.so -> libcusparse.so.10
lrwxrwxrwx 1 root root 23 Sep 7 22:55 libcusparse.so.10 -> libcusparse.so.10.1.168
-rwxr-xr-x 1 root root 117M Sep 7 22:55 libcusparse.so.10.1.168
-rw-r--r-- 1 root root 127M Sep 7 22:55 libcusparse_static.a
Again at :
/usr/local/cuda/targets/x86_64-linux/lib$ ls -lh libcu*
-rw-r--r-- 1 root root 703K Sep 7 22:55 libcudadevrt.a
lrwxrwxrwx 1 root root 17 Sep 7 22:55 libcudart.so -> libcudart.so.10.1
lrwxrwxrwx 1 root root 21 Sep 7 22:55 libcudart.so.10.1 -> libcudart.so.10.1.168
-rwxr-xr-x 1 root root 493K Sep 7 22:55 libcudart.so.10.1.168
-rw-r--r-- 1 root root 868K Sep 7 22:55 libcudart_static.a
lrwxrwxrwx 1 root root 14 Sep 7 22:55 libcufft.so -> libcufft.so.10
lrwxrwxrwx 1 root root 20 Sep 7 22:55 libcufft.so.10 -> libcufft.so.10.1.168
-rwxr-xr-x 1 root root 132M Sep 7 22:55 libcufft.so.10.1.168
-rw-r--r-- 1 root root 137M Sep 7 22:55 libcufft_static.a
-rw-r--r-- 1 root root 143M Sep 7 22:55 libcufft_static_nocallback.a
lrwxrwxrwx 1 root root 15 Sep 7 22:55 libcufftw.so -> libcufftw.so.10
lrwxrwxrwx 1 root root 21 Sep 7 22:55 libcufftw.so.10 -> libcufftw.so.10.1.168
-rwxr-xr-x 1 root root 489K Sep 7 22:55 libcufftw.so.10.1.168
-rw-r--r-- 1 root root 33K Sep 7 22:55 libcufftw_static.a
lrwxrwxrwx 1 root root 18 Sep 7 22:55 libcuinj64.so -> libcuinj64.so.10.1
lrwxrwxrwx 1 root root 22 Sep 7 22:55 libcuinj64.so.10.1 -> libcuinj64.so.10.1.168
-rwxr-xr-x 1 root root 7.5M Sep 7 22:55 libcuinj64.so.10.1.168
-rw-r--r-- 1 root root 32K Sep 7 22:55 libculibos.a
lrwxrwxrwx 1 root root 15 Sep 7 22:55 libcurand.so -> libcurand.so.10
lrwxrwxrwx 1 root root 21 Sep 7 22:55 libcurand.so.10 -> libcurand.so.10.1.168
-rwxr-xr-x 1 root root 58M Sep 7 22:55 libcurand.so.10.1.168
-rw-r--r-- 1 root root 58M Sep 7 22:55 libcurand_static.a
lrwxrwxrwx 1 root root 17 Sep 7 22:55 libcusolver.so -> libcusolver.so.10
lrwxrwxrwx 1 root root 23 Sep 7 22:55 libcusolver.so.10 -> libcusolver.so.10.1.168
-rwxr-xr-x 1 root root 175M Sep 7 22:55 libcusolver.so.10.1.168
-rw-r--r-- 1 root root 91M Sep 7 22:55 libcusolver_static.a
lrwxrwxrwx 1 root root 17 Sep 7 22:55 libcusparse.so -> libcusparse.so.10
lrwxrwxrwx 1 root root 23 Sep 7 22:55 libcusparse.so.10 -> libcusparse.so.10.1.168
-rwxr-xr-x 1 root root 117M Sep 7 22:55 libcusparse.so.10.1.168
-rw-r--r-- 1 root root 127M Sep 7 22:55 libcusparse_static.a
I find the ld
links the cuda programs against the libcudart.so
present in /usr/local/cuda/targets/x86_64-linux/lib
on my system. But I have seen few posts, where libcudart.so
is also available at /usr/lib/x86_64-linux-gnu