ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory when installing tensor flow on Ubuntu 16.04.03

前端 未结 3 732
难免孤独
难免孤独 2021-01-20 17:04

I am trying to install tensorflow with cuda and gpu support. When I try to import it, I get the following error:

Traceback (most recent call last):
  File \"         


        
相关标签:
3条回答
  • 2021-01-20 17:41

    I had cuda-9.0 installed and the LD_LIBRARY_PATH was pointing to the correct location. Turned out that the permission of the folder /usr/local/cuda-9.0 was wrong. I could not even cd to the folder. I changed the owner of the cuda-9.0 from root to my-user-name and after that python was able to find the missing library.

    0 讨论(0)
  • 2021-01-20 17:56

    This is almost always a missing path in your LD_LIBRARY_PATH. Find libcublas.so.9.0 on your system (start looking under /usr/local).

    If you don't find it, then install the CUDA 9.0 Toolkit (note that with TF 1.5 you want 9.0 and not 9.1, a common gotcha, at least common in-so-far as I made that mistake myself).

    https://developer.nvidia.com/cuda-90-download-archive

    If you have it, then update your LD_LIBRARY_PATH to point to the appropriate lib directory.

    If you've done either of those and are now getting a similar looking error for a cudnn related library, then repeat that process for the CUDNN library.

    https://developer.nvidia.com/cudnn

    I think the latest version works. Tensorflow depends on both CUDA toolkit and the CuDNN library extension.

    Note that you can install all of this in userspace too (sudo is typical, but not required).

    0 讨论(0)
  • 2021-01-20 17:56

    To easily find the libcublas file, run sudo find / -iname 'libcublas*'. Then add the path to the folder containing that file into LD_LIBRARY_PATH.

    0 讨论(0)
提交回复
热议问题