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/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6 return f(*args, **kwds)

Running:

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

Returns:

2017-12-06 01:19:49.592416: 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 AVX2 FMA 2017-12-06 01:19:49.603333: E tensorflow/stream_executor/cuda/cuda_driver.cc:406] failed call to cuInit: CUDA_ERROR_UNKNOWN 2017-12-06 01:19:49.603378: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:145] 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/direct_session.cc:299] 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.