-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtensorr.py
More file actions
17 lines (14 loc) · 723 Bytes
/
tensorr.py
File metadata and controls
17 lines (14 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import tensorflow as tf
import sys # To check Python version
print("TensorFlow Version:", tf.__version__)
print("Python Version:", sys.version)
gpus = tf.config.list_physical_devices('GPU')
print("Num GPUs Available:", len(gpus))
if gpus:
print("GPU(s) detected by TensorFlow:", gpus)
# Check if TensorFlow was built with CUDA support (redundant if GPU is listed, but informative)
print("Built with CUDA:", tf.test.is_built_with_cuda())
else:
print("TensorFlow did NOT detect any GPU.")
print("Ensure prerequisites are met: NVIDIA driver, CUDA Toolkit, cuDNN installed correctly and versions match TensorFlow requirements.")
print("Check PATH environment variable includes CUDA bin/lib paths.")