How to check CUDA version in TensorFlow

This article explains how to get complete TensorFlow's build environment details, which includes cuda_version, cudnn_version , cuda_compute_capabilities etc.

Check CUDA Version



import tensorflow as tf

sys_details = tf.sysconfig.get_build_info()

cuda_version = sys_details["cuda_version"]

print(cuda_version)



10.1

Check CUDNN Version



cudnn_version = sys_details["cudnn_version"]

print(cudnn_version)



7

Check CPU Compiler



cpu_compiler = sys_details["cpu_compiler"]

print(cpu_compiler)


    
/usr/bin/x86_64-linux-gnu-gcc-7

Check CUDA Compute Capabilities



cuda_compute_capabilities = sys_details["cuda_compute_capabilities"]

print(cuda_compute_capabilities)



['compute_37', 'compute_60', 'compute_61', 'compute_70', 'compute_75']