GPU not working with tensor flow

I have installed tf version == 2.12.0
Ubuntu == 22.04
but still the GPU not working for my Python code.

After executing the following code.
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices(‘GPU’)))

Num GPUs Available: 0

Hello @22064306 and welcome to the NVIDIA developer forums.

Please check the Tensorflow installation pages and make sure you have the right requirements fulfilled.

As far as I know TF might only support CUDA 11.8 right now. You will also need to make sure to install the CUDA toolkit.

I hope that helps!