Tensorflow does not detect GPU

I have installed Lmabda stack on ubuntu 20.04 and RTX 3090. Tensorflow 2.4.1 does not detect gpu. What I understand is that cudnn8 is not installed. Here is what i got:


I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.11
2021-05-19 09:48:02.489196: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library ‘libcudnn.so.8’; dlerror: libcudnn.so.8: cannot open shared object file: No such file or directory
2021-05-19 09:48:02.489202: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1757] 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 قم بتثبيت TensorFlow مع النقطة for how to download and setup the required libraries for your platform.
Skipping registering GPU devices…

Are you using a Python Virtual environment?

If so, you’ll need to copy over a few files from the Lambda installation to your venv.

More specifically, all the libcudnn packages from /usr/lib/python3/dist-packages/tensorflow.
Just copy them over to venv_path/lib/site-packages/tensorflow