3

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 18.04)
  • Ubuntu 20.04
  • Python version: 3.6
  • Installed using virtualenv
  • CUDA/cuDNN version: 11.5 / 8.1.0.77
  • GPU model and memory: RTX 3090 24GB nvidia driver 460.39
  • TensorFlow version: 2.4.0 pip install tensorflow-gpu==2.4.0

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

talonmies
  • 70,661
  • 34
  • 192
  • 269

4 Answers4

2

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

Rafael Toledo
  • 974
  • 13
  • 19
0

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

0

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.

0

You can run:

pip install transformers[torch]

or downgrade torch to 2.0.0. Thats work for me.

Alpcan
  • 11
  • 5
  • 1
    Answer needs supporting information Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](https://stackoverflow.com/help/how-to-answer). – moken Jul 31 '23 at 04:08