If you run tensorflow in a docker console you can run the following code in your terminal:
docker exec b61a27999cb8 python3 -c "import tensorflow as tf; tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(log_device_placement=True))"
If you run a jupyter notebook you add the following line:
import tensorflow as tf print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))