Sunday, September 5, 2021

Fixing "ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory" in Ubuntu 18.04

 If you're using Nvidia CUDA 10.1.243 in your software development, either directly or indirectly and encountered: "ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory", it's caused by incorrect location of the said library. Nvidia have moved the location of the library form cuda-10.1 direcctory to cuda-10.2 directory. I know, this is rather insane. But it is what it is in Ubuntu 18.04, if you installed Cuda from Nvidia's *.deb package. 

The FIX: 

Add the path to cuda-10.2 library into your LD_LIBRARY_PATH, akin to this explanation in stackoverflow: https://stackoverflow.com/questions/55224016/importerror-libcublas-so-10-0-cannot-open-shared-object-file-no-such-file-or/64472380#64472380, i.e. add this line to your shell init file (*.profile or similar ones):

export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} 
The line above assumes you've installed Cuda in its default installation location, i.e. /usr/local. You need to modify this value if you installed Cuda in non-default location.  

Post a Comment

No comments: