Skip to content

Instantly share code, notes, and snippets.

@soran-ghaderi
Created December 25, 2020 02:44
Show Gist options
  • Save soran-ghaderi/edaff73aedbb6aee91c78bb887dd19bc to your computer and use it in GitHub Desktop.
Save soran-ghaderi/edaff73aedbb6aee91c78bb887dd19bc to your computer and use it in GitHub Desktop.
Solved: docs: Could not load dynamic library 'libcublas.so.10'
In case you ran into this error after installing cuda-10.1, here is what you can do:
Since cuda-10.1 installs the libraries in both /usr/local/cuda-10.1 and /usr/local/cuda-10.2 and tensorflow can't find them, you should add both of this paths to the ".bashrc" file as LD_LIBRARY_PATH.
Now:
1. open terminal:
sudo gedit ~/.bashrc or sudo vim ~/.bashrc
2. Add this line to the end of file:
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda-10.1/lib64:/usr/local/cuda-10.2/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
and this 2 steps should solve your issue.
If you are using pycharm you may encounter this issue even after adding its path to the ".bashrc". In order to overcome this weird issue you can go to "edit configuations" under the "run" dropdown.
In the environment section find the environment variable and add a new variable by clicking on the "+" button.
now LD_LIBRARY_PATH variable to your environment variables. Follwing are the steps:
1. Run > Edit Configurations....
2. Click on the list icon for Environment Variables
3. Open the variables and click on "+"
4. Add this varialbe:
NAME: LD_LIBRARY_PATH
VALUE: /usr/local/cuda/lib64:/usr/local/cuda-10.1/lib64:/usr/local/cuda-10.2/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment