System information
Describe the problem
Installed cuda 11.2 and cudnn 8.1.0.77. Faced the following problem when I run train.py
Could not load dynamic library 'libcupti.so.11.0'; dlerror: libcupti.so.11.0: cannot open shared object file
Solved the problem
List lib files on /usr/local/cuda-11.2/extras/CUPTI/lib64/lib*
$ ls /usr/local/cuda-11.2/extras/CUPTI/lib64/lib*
I could not find libcupti.so.11.0
. Other files should be there such that libcupti.so
, libcupti.so.11.2
, ...
Manage a link between libcupti.so.11.2
and libcupti.so.11.0 using a comand 'sudo ln -s'
$ sudo ln -s /usr/local/cuda-11.2/extras/CUPTI/lib64/libcupti.so.11.2 /usr/local/cuda-11.2/extras/CUPTI/lib64/libcupti.so.11.0
List lib files on /usr/lib/x86_64-linux-gnu/libcup*
ls /usr/lib/x86_64-linux-gnu/libcup*
I could not find libcupti.so.11.0
. Other files should be there such that libcupti.so
, libcupti.so,2
, libcupti.so.10.1
, ...
Manage a link between libcupti.so.11.2
and libcupti.so.11.0
using a comand sudo ln -s
$ sudo ln -s /usr/local/cuda-11.2/extras/CUPTI/lib64/libcupti.so.11.2 /usr/lib/x86_64-linux-gnu/libcupti.so.11.0
This fixed the problem for me
In the case of Cuda-11.3, lib64 folder is removed from /usr/local/cuda-11.2/extras/CUPTI/. All lib files are moved to ls /usr/local/cuda/lib64/ or ls /usr/local/cuda-11.3/lib64/.
List lib files on /usr/local/cuda/lib64/
$ ls /usr/local/cuda/lib64/libcupti*
I could not find libcupti.so.11.0. Other files should be there such that libcupti.so, libcupti.so.11.3, ...
Manage a link between libcupti.so.11.3 and libcupti.so.11.0 using a comand 'sudo ln -s'
$ sudo ln -s /usr/local/cuda-11.3/lib64/libcupti.so.11.3 /usr/local/cuda-11.3/lib64/libcupti.so.11.0
That is it. Enjoy
You need to configure the paths for binaries and libraries. On Ubuntu 20.04 LTS I follow the next steps. First, using find
command, I search for the path of nvcc
and libcublas.so.*
:
sudo find / -name 'nvcc' # Path to binaries
sudo find / -name 'libcublas.so.*' # Path to libraries
Then, add the next lines at the end of file ~/.profile
(or just export the environment variables) according to the paths you found above. In my system, Cuda was installed on /usr/local/cuda-11.4
.
if [ -d "/usr/local/cuda-11.4" ]; then
export PATH=/usr/local/cuda-11.4/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/targets/x86_64-linux/lib/${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
fi
Restart the computer and try it again.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.