CUDA install problem on Ubuntu 20.04 LTS + GPU

I am having difficulty getting TensorFlow 2.7.0 to work with GPU on Ubuntu 20.04.

The instructions at GPU support | TensorFlow do not describe the procedure for Ubuntu 20.04. Is that described anywhere?

When I run this test script:

import tensorflow as tf

print('TensorFlow version:',tf.__version__)
physical_devices = tf.config.list_physical_devices()
for dev in physical_devices:

sys_details = tf.sysconfig.get_build_info()
cuda_version = sys_details["cuda_version"]
print("CUDA version:",cuda_version)
cudnn_version = sys_details["cudnn_version"]
print("CUDNN version:",cudnn_version)

I see:

$ python3 TensorFlow/
TensorFlow version: 2.7.0
2021-11-29 17:30:21.825301: W tensorflow/stream_executor/platform/default/] Could not load dynamic library ''; dlerror: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/usr/local/cuda-11.5/lib64:/usr/local/cuda-11.5/lib64
2021-11-29 17:30:21.825324: W tensorflow/core/common_runtime/gpu/] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU')
CUDA version: 11.2
CUDNN version: 8

I have:


How might I fix the errors please?

@David_A, According to Tested build configuration CUDA: 11.2 and cuDNN:8.1 are compatible for TF2.7. Can you let us know the steps that you have followed to install GPU ?