libcudnn.so.7 is not a symbolic link


libnccl 2をインストールする場合:
apt-get install libnccl2=2.2.13-1+cuda9.0 libnccl-dev=2.2.13-1+cuda9.0

途中でエラーが表示されました.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be DOWNGRADED:
  libnccl-dev libnccl2
0 upgraded, 0 newly installed, 2 downgraded, 0 to remove and 16 not upgraded.
Need to get 0 B/48.9 MB of archives.
After this operation, 1005 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 file:/var/nccl-repo-2.2.13-ga-cuda9.0  libnccl-dev 2.2.13-1+cuda9.0 [21.5 MB]
Get:2 file:/var/nccl-repo-2.2.13-ga-cuda9.0  libnccl2 2.2.13-1+cuda9.0 [27.4 MB]
debconf: delaying package configuration, since apt-utils is not installed
dpkg: warning: downgrading libnccl-dev from 2.2.13-1+cuda9.2 to 2.2.13-1+cuda9.0
(Reading database ... 17603 files and directories currently installed.)
Preparing to unpack .../libnccl-dev_2.2.13-1+cuda9.0_amd64.deb ...
Unpacking libnccl-dev (2.2.13-1+cuda9.0) over (2.2.13-1+cuda9.2) ...
dpkg: warning: downgrading libnccl2 from 2.2.13-1+cuda9.2 to 2.2.13-1+cuda9.0
Preparing to unpack .../libnccl2_2.2.13-1+cuda9.0_amd64.deb ...
Unpacking libnccl2 (2.2.13-1+cuda9.0) over (2.2.13-1+cuda9.2) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
/sbin/ldconfig.real: /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link

Setting up libnccl2 (2.2.13-1+cuda9.0) ...
Setting up libnccl-dev (2.2.13-1+cuda9.0) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
/sbin/ldconfig.real: /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link

この問題の解決方法を調べた:1.check the link:
sudo ldconfig -v

やはりシンボルリンクエラーが検出されました:
ldconfig -v
/sbin/ldconfig.real: Can't stat /usr/local/nvidia/lib: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/local/nvidia/lib64: No such file or directory
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/usr/local/cuda-9.0/targets/x86_64-linux/lib:
    libnvrtc-builtins.so.9.0 -> libnvrtc-builtins.so.9.0.176
    libnppicom.so.9.0 -> libnppicom.so.9.0.176
    libnppidei.so.9.0 -> libnppidei.so.9.0.176
    libnvrtc.so.9.0 -> libnvrtc.so.9.0.176
    libnppig.so.9.0 -> libnppig.so.9.0.176
    libnvgraph.so.9.0 -> libnvgraph.so.9.0.176
    libnppim.so.9.0 -> libnppim.so.9.0.176
    libnppc.so.9.0 -> libnppc.so.9.0.176
    libnpps.so.9.0 -> libnpps.so.9.0.176
    libcusolver.so.9.0 -> libcusolver.so.9.0.176
    libcufft.so.9.0 -> libcufft.so.9.0.176
    libcufftw.so.9.0 -> libcufftw.so.9.0.176
    libnppicc.so.9.0 -> libnppicc.so.9.0.176
    libnppist.so.9.0 -> libnppist.so.9.0.176
    libnppisu.so.9.0 -> libnppisu.so.9.0.176
    libnppif.so.9.0 -> libnppif.so.9.0.176
    libnvblas.so.9.0 -> libnvblas.so.9.0.425
    libcusparse.so.9.0 -> libcusparse.so.9.0.176
    libnppitc.so.9.0 -> libnppitc.so.9.0.176
    libcublas.so.9.0 -> libcublas.so.9.0.425
    libnppial.so.9.0 -> libnppial.so.9.0.176
    libcurand.so.9.0 -> libcurand.so.9.0.176
/sbin/ldconfig.real: /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link
...
  • Find the error:
  • /sbin/ldconfig.real: 

    次のように誤報されます.
    # /sbin/ldconfig.real
    /sbin/ldconfig.real: /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7 is not a symbolic link

    これが何なのかもう一度調べてみましょう.
    ls -lh /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7
    -rwxr-xr-x 1 root root 318M Aug  1 09:26 /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7

    ソフト接続のはずのファイルです.ソフト・コネクションの作成:
    sudo ln -sf /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7.1.4 /usr/local/cuda-9.0/targets/x86_64-linux/lib/libcudnn.so.7

    done. 参考:libcudnn.so.7 is not a symbolic link