Por que recebo “/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.7 não é um link simbólico”?

6

Depois de instalar CUDA toolkit e cuDNN com êxito sem problemas, sempre que o fizer:

sudo ldconfig 

Eu obtenho o:

/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.7 is not a symbolic link

mensagem de erro.
qual é a razão e como posso resolver isso?

A propósito, eu instalei cuDNN assim:

 # cuDNN, extracts to a folder named cuda
 tar xvf cudnn*.tgz  
 cd cuda  
 sudo cp lib64/* /usr/local/cuda/lib64
 sudo cp include/* /usr/local/cuda/include

A saída de ls -lha libcudnn* em /usr/local/cuda/lib64 é a seguinte:

breeze@breeze:/usr/local/cuda/lib64$ ls -lha libcudnn*
-rwxr-xr-x 1 root root 275M آوریل 15 12:03 libcudnn.so
-rwxr-xr-x 1 root root 275M آوریل 15 12:03 libcudnn.so.7
-rwxr-xr-x 1 root root 275M آوریل 15 12:03 libcudnn.so.7.0.5
-rw-r--r-- 1 root root 268M آوریل 15 12:03 libcudnn_static.a
    
por Breeze 17.04.2018 / 22:29

1 resposta

7

Graças ao querido Deus eu encontrei a solução usando este link .

This may happen when you run sudo ldconfig after copying cuDNN files.

After installing cuDNN, copying the extracted files to /usr/lib/cuda/lib64 and creating the symlinks, things may go wrong with the symlinks.

So go to /usr/local/cuda/lib64/ and run ls -lha libcudnn*.

You should see two symlinks (bold teal) and one single file. Something like this:

/usr/local/cuda/lib64$ ls -lha libcudnn*
lrwxrwxrwx 1 root root  13 Dez 25 23:56 libcudnn.so -> libcudnn.so.5
lrwxrwxrwx 1 root root  17 Dez 25 23:55 libcudnn.so.5 -> libcudnn.so.5.1.5
-rwxr-xr-x 1 root root 76M Dez 25 23:27 libcudnn.so.5.1.5

The exact version of libcudnn.so.5.1.5 maybe be a little different for you (maybe libcudnn.so.5.1.10). In that case, adapt the code accordingly

If libcudnn.so and libcudnn.so.5 are not symlinks then this is the reason why you got this error. If so, this is what you need to do:

/usr/local/cuda/lib64$ sudo rm libcudnn.so
/usr/local/cuda/lib64$ sudo rm libcudnn.so.5
/usr/local/cuda/lib64$ sudo ln libcudnn.so.5.1.5 libcudnn.so.5
/usr/local/cuda/lib64$ sudo ln libcudnn.so.5 libcudnn.so
Run sudo ldconfig again and there should be no errors

Depois de executar o ls -lha libcudnn* em /usr/local/cuda/lib64 e vendo:

breeze@breeze:/usr/local/cuda/lib64$ ls -lha libcudnn*
-rwxr-xr-x 1 root root 275M آوریل 15 12:03 libcudnn.so
-rwxr-xr-x 1 root root 275M آوریل 15 12:03 libcudnn.so.7
-rwxr-xr-x 1 root root 275M آوریل 15 12:03 libcudnn.so.7.0.5
-rw-r--r-- 1 root root 268M آوریل 15 12:03 libcudnn_static.a

Eu tive que fazer:

breeze@breeze:/usr/local/cuda/lib64$ sudo rm libcudnn.so
[sudo] password for breeze: 
breeze@breeze:/usr/local/cuda/lib64$ sudo rm libcudnn.so.7
breeze@breeze:/usr/local/cuda/lib64$ sudo ln libcudnn.so.7.0.5 libcudnn.so.7
breeze@breeze:/usr/local/cuda/lib64$ sudo ln libcudnn.so.7 libcudnn.so
breeze@breeze:/usr/local/cuda/lib64$ sudo ldconfig

E tudo voltou ao normal:)

    
por Breeze 17.04.2018 / 23:00