23

After installing TensorFlow and its dependencies on a g2.2xlarge EC2 instance I tried to run an MNIST example from the getting started page:

python tensorflow/models/image/mnist/convolutional.py

But I get the following warning:

I tensorflow/core/common_runtime/gpu/gpu_device.cc:611] Ignoring gpu device 
(device: 0, name: GRID K520, pci bus id: 0000:00:03.0) with Cuda compute 
capability 3.0. The minimum required Cuda capability is 3.5.

Is this a hard requirement? Any chance I could comment that check out in a fork of TensorFlow? It would be super nice to be able to train models in AWS.

jmattheis
  • 10,494
  • 11
  • 46
  • 58
jbencook
  • 516
  • 1
  • 5
  • 11
  • We've only tested TensorFlow with compute capability >= 3.5. Several people have requested support for 3.0, and it's on our radar: see the discussion on the GitHub issue here https://github.com/tensorflow/tensorflow/issues/25 – mrry Nov 11 '15 at 16:28

3 Answers3

11

There is a section in the official installation page that guides you to enable Cuda 3, but you need to build Tensorflow from source.

$ TF_UNOFFICIAL_SETTING=1 ./configure

# Same as the official settings above

WARNING: You are configuring unofficial settings in TensorFlow. Because some
external libraries are not backward compatible, these settings are largely
untested and unsupported.

Please specify a list of comma-separated Cuda compute capabilities you want to
build with. You can find the compute capability of your device at:
https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases
your build time and binary size. [Default is: "3.5,5.2"]: 3.0

Setting up Cuda include
Setting up Cuda lib64
Setting up Cuda bin
Setting up Cuda nvvm
Configuration finished
Andyccs
  • 520
  • 3
  • 9
9

Currently only GPUs with compute capability >= 3.5 are officially supported. However, GitHub user @infojunkie has offered a patch that makes it possible to use TensorFlow with a GPU with compute capability 3.0.

The official fix is in development. Meanwhile, check out the discussion on the GitHub issue for adding this support.

mrry
  • 125,488
  • 26
  • 399
  • 400
5

There is a simple trick. You don't even have to build TF from sources.

In the file tensorflow\python\_pywrap_tensorflow.pyd there are two occurences of regex 3\.5.*5\.2. Just replace both 3.5 with 3.0.

Tested on Windows 10, Anaconda 4.2.13, Python 3.5.2, TensorFlow 0.12, CUDA 8, NVidia GTX 660m (CUDA cap. 3.0).

Kamil Nowak
  • 113
  • 2
  • 6
  • where is that file located? I only see a _pywrap_tensorflow_internal file – theninjagreg Dec 26 '19 at 23:23
  • @theninjagreg According to https://stackoverflow.com/a/44520245/4501221 you can follow the procedure for the _pywrap_tensorflow_internal.pyd file. My solution was for TF 0.12 (really ancient now) and the file was probably renamed in next releases, however the trick should still work. – Kamil Nowak Dec 28 '19 at 00:34