# Using TensorFlow with Intel GPU

Is there any way now to use TensorFlow with Intel GPUs? If yes, please point me in the right direction.

If not, please let me know which framework, if any, (Keras, Theano, etc) can I use for my Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller.

At this moment, the answer is no. Tensorflow uses CUDA which means only NVIDIA GPUs are supported.

For OpenCL support, you can track the progress here.

BTW, Intel/AMD CPUs are supported.

• ...and adding to that ( " Intel/AMD CPUs are supported" ) note that when ones tensorflow, it prints out some messages to the console saying that the build may not have been compiled with support for additional optimizations provided by your CPU, and if you build it on your host, you will likely see performance improvements, even on CPU. Jan 3 '18 at 4:43

You might want to check out https://github.com/benoitsteiner/tensorflow-opencl/ which is a fork of Tensorflow with OpenCL support. If your OS is supported by the fork and you are able to properly install it in your system then you can run Keras on top of it.

Note however that integrated GPUs in general do not offer a lot of calculating power, roughly your GPU will be around 125 GFLOPS (https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units#Notes), that is your CPU is most likely more powerful. For example, comparing your GPU with a Radeon RX 480 or a GeForce GTX 1080 Ti, they are respectively almost 50 and 100 times more powerful.

• Welcome to data science SE! Thanks for helping a user. Could you expand your answer how it answers the OP's question? Just posting a link is not very useful. Mar 20 '17 at 11:05

Keras is an abstraction layer for tensorflow/ theano. You need a nvidia card but tensorflow as well as theano can be used with CPU support only. Instructions can be found on their websites.

There is a document about Intel Optimization for TensorFlow. You can find it here.

There is a tensorflow-directml that currently work with Python 3.5-3.7.

The github page and the roadmap wiki seem to indicate it is under active development.

Adding this bit of info for people around..

Tensorflow can be now activated on Intel-gpus as well..

For this, just create a new environment on anaconda , and do pip install intel-tensorflow

Now, when the needed libararies are installed, we can do sanity test by a sample program.

import tensorflow as tf
import os

def get_mkl_enabled_flag():

mkl_enabled = False
major_version = int(tf.__version__.split(".")[0])
minor_version = int(tf.__version__.split(".")[1])
if major_version >= 2:
if minor_version < 5:
from tensorflow.python import _pywrap_util_port
else:
from tensorflow.python.util import _pywrap_util_port
onednn_enabled = int(os.environ.get('TF_ENABLE_ONEDNN_OPTS', '0'))
mkl_enabled = _pywrap_util_port.IsMklEnabled() or (onednn_enabled == 1)
else:
mkl_enabled = tf.pywrap_tensorflow.IsMklEnabled()
return mkl_enabled

print ("We are using Tensorflow version", tf.__version__)
print("MKL enabled :", get_mkl_enabled_flag())


It should return MKL enabled : True

Note - These optimisations are brought through (Intel MKL)Intel oneAPI Math Kernel Library