Could not load dynamic library ‘’; dlerror: cannot open shared object file: No such file or directory;

On Ubuntu 20.04, you can simply install NVIDIAs cuda toolkit cuda:

sudo apt-get update
sudo apt install nvidia-cuda-toolkit

There are also install advices for Windows.

The packge is around 1GB and it took a while to install… Some minutes later you need to export PATH variables so that it can be found:

  1. Find Shared Object
sudo find / -name '*'

  1. Add the folder to path, so that python finds it
export PATH=/usr/lib/x86_64-linux-gnu${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  1. Permissions
sudo chmod a+r /usr/lib/x86_64-linux-gnu/libcuda*