Check if GPU is accessible in Tensorflow
The following code prints the CUDA and CUDNN versions that the given computer is configured to use.
Library: tensorflow
import tensorflow as tf
tf.config.list_physical_devices('GPU')
sys_details = tf.sysconfig.get_build_info()
cuda = sys_details["cuda_version"]
cudnn = sys_details["cudnn_version"]
print(cuda, cudnn)