0

I am running tensorflow 1.8.0 installed by 'pip -install tensorflow-gpu' with CUDA 9.0 and with cuDNN 7.1.4 on Windows 10 and I have been trying to get tensorflow to work with my NVIDIA GeForce GTX 860M graphics card. I am using IDLE to run and write my code in.

When I run any code it only performs on my CPU. Some sample code im running until I can get it to run on my gpu to do the MNIST tensorflow tutorials is:

    import tensorflow as tf


    # Initialize two constants
    x1 = tf.constant([1,2,3,4])
    x2 = tf.constant([5,6,7,8])

    # Multiply
    result = tf.multiply(x1, x2) 

    # Intialize the Session
    sess = tf.Session()

    # Print the result
    print(sess.run(result))

    # Close the session
    sess.close()

When i run this I get this failed to create session error:

    tensorflow.python.framework.errors_impl.InternalError: Failed to create session. 

So I added the following lines to the beginning of the code

     import os
     os.environ["CUDA_VISIBLE_DEVICES"] = '1'

and now the code runs succesfully with the correct output

   [ 5 12 21 32]

but it only runs on my CPU, and when I try the following commands in the IDLE command line,

    from tensorflow.python.client import device_lib
    device_lib.list_local_devices() 

the output is

    [name: "/device:CPU:0"
    device_type: "CPU"
    memory_limit: 268435456
    locality {
    }
    incarnation: 1631189080169918107
    ]

I have tried restarting my computer, unistalling and reinstalling tensorflow-gpu and deleted other versions of CUDA I previously had installed, but I can not get my program to recognize my NVIDIA graphics card, and I looked it up and it is a supported card.

What else can I do to get my code to recognize and run on my graphics card?

3
  • Your GPU came in two revisions, one has a CUDA capability level of 3.0, the other 5.0. AFAIR tensorflow-gpu as Windows binary requires 3.5. Commented Jun 3, 2018 at 23:07
  • I tried running deviceQuery to check which one mine was but it said: CUDA driver version is insufficient for CUDA runtime version. Does this mean that mine is the 3.0 version? Commented Jun 4, 2018 at 0:00
  • After some digging in my PC i found out I have the 3.0 older kepler version of the 860M, Im going to delete everything and build from source with instructions from github.com/tensorflow/tensorflow/issues/6001 Commented Jun 4, 2018 at 0:29

1 Answer 1

1

Installing CUDA is not enough, you also need to install cuDNN 7.0.5 and some other dependencies too. Refer http://www.python36.com/install-tensorflow-gpu-windows/ for complete detail.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.