Amazon EC2 Tensorflow GPU support

I tried looking around a lot and couldn't find a fix yet.

Things I tried included checking all the paths and environment variables.

When I try running Keras with the TensorFlow backend using Python 3.6 on the Deep Learning AMI (m4.xlarge)

As soon as Tensorflow is imported this is the output:

/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/importlib/ RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6 return f(*args, **kwds)


print ("VERSION", tf.Session(config=tf.ConfigProto(log_device_placement=True)))


2017-12-06 01:19:49.592416: I tensorflow/core/platform/] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA 2017-12-06 01:19:49.603333: E tensorflow/stream_executor/cuda/] failed call to cuInit: CUDA_ERROR_UNKNOWN 2017-12-06 01:19:49.603378: I tensorflow/stream_executor/cuda/] kernel driver does not appear to be running on this host (ip-172-31-41-243): /proc/driver/nvidia/version does not exist Device mapping: no known devices. 2017-12-06 01:19:49.604178: I tensorflow/core/common_runtime/] Device mapping:

VERSION <tensorflow.python.client.session.Session object at 0x7f24f3d69c88>

Any clue why I can't get the GPUs to run?

1 answer

  • answered 2017-12-06 23:40 Junpeng Zhang

    I think the problem is well interesting. To enable the GPUs support, please make sure there is any supported GPUs device installed in your instance. As far as I know M4 instances do not provide any GPUs.

    A solution for this problem, you should be start a new instance with GPUs like P3 and P2 instance. (For personal exploration, I suggest you start will spot instance, which will be more cost-effective.) Then run the same code again, I think it will works if there is no bugs in the code itself.