8
3

More than 5 years have passed since last update.

"libcublas.so.9.0: cannot open shared object file: No such file or directory" となった時の対処方法

Posted at

libcublas.so.9.0 がない

TensorFlow (GPU) のバージョンを 1.9.0 に上げたところ、コード実行時に以下のようなエラーが出ました。

ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

私の使用環境は以下のようになります(詳細は こちら を参照)。

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

$ pip list | grep tensorflow-gpu
tensorflow-gpu         1.9.0  

$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

対処方法

調べると、CUDAを9.0 にアップデートすれば良いとわかりました。NVIDIA Developerの CUDA Toolkit Archive から、9.0を選択しダウンロードします(今回は deb(network) を選択しました)。

$ sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
$ sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
$ sudo apt-get update
$ sudo apt-get install cuda-9-0

同様にインストールしたCUDAに適したcuDNNを cuDNN Download からダウンロードして、インストールします。以上から、エラーは起こらなくなり、コードは実行することができました。

8
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
3