diff --git a/gputest.py b/gputest.py new file mode 100644 index 0000000..3d80681 --- /dev/null +++ b/gputest.py @@ -0,0 +1,12 @@ +from distutils.version import LooseVersion +import warnings +import tensorflow as tf + +# Check tensorflow version +print(f'Tensorflow version: {tf.__version__}') + +# Check for GPU +if not tf.test.gpu_device_name(): + warnings.warn('No GPU found') +else: + print(f'Default GPU device: {tf.test.gpu_device_name()}')