Actions

Tensorflow

From Montana Tech High Performance Computing

TensorFlow is an open source software library for numerical computation using data flow graphs developed by Google. It can be used on both CPU and GPU. On the HPC, the GPU supported version of Tensorflow is installed with Python-3.6.4.

To use it, whether on CPU nodes or GPU nodes, both the Python/3.6.4 and cuda/9.0 modules needs to be loaded:

module load python/3.6.4 cuda/9.0

Since the version is GPU supported, you might see some warnings regarding NVIDIA/cuda when running on CPU-only nodes, as shown below, which should be normal.

[user@n0 ~]$ python3
Python 3.6.4 (default, Jan 19 2018, 16:09:27)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> a=tf.constant(20)
>>> b=tf.constant(30)
>>> sess = tf.Session()
2018-02-14 12:17:58.334750: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX
NVIDIA: no NVIDIA devices found
2018-02-14 12:17:58.354692: E tensorflow/stream_executor/cuda/cuda_driver.cc:406] failed call to cuInit: CUDA_ERROR_UNKNOWN
2018-02-14 12:17:58.354826: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:145] kernel driver does not appear to be running on this host (n1): /proc/driver/nvidia/version does not exist
>>> print(sess.run(a+b))
50