Tensorflow doesn't seem to see my gpu

I tried shadoworflow on both cuda 7.5 and 8.0, without cudnn (my GPU is old, cudnn does not support it).

When I execute device_lib.list_local_devices() , there is no gpu in the output. Theano sees my gpu and works fine with it, and the examples in / usr / share / cuda / samples also work fine.

I installed tenorflow through pip install. Is my gpu too old to support tf? gtx 460

+17
source share
5 answers

When I look at your GPU, I see that it only supports CUDA Compute Capability 2.1. (You can check through https://developer.nvidia.com/cuda-gpus ) Unfortunately, TensorFlow requires a graphics processor with minimal CUDA Compute Capability 3.0. https://www.tensorflow.org/get_started/os_setup#optional_install_cuda_gpus_on_linux

You can see some TensorFlow logs checking your GPU, but ultimately the library will avoid using an unsupported GPU.

+5
source

I ran into this problem on jupyter laptops. This can be easily fixed.

 $ pip uninstall tensorflow $ pip install tensorflow-gpu 

You can check if it worked:

 tf.test.gpu_device_name() 
+10
source

If you are using conda, you may have installed tenorflow for the processor. Check the conda list environment to see if it is. If so, uninstall the package using conda remove tensorflow and install keras-gpu instead ( conda install -c anaconda keras-gpu . This will install everything you need to run the machine learning codes in the GPU.

PS First you need to check if you installed the drivers correctly using nvidia-smi . By default, it is not in your PATH variable, so you might also need to add a folder to your path. The .exe file can be found at C:\Program Files\NVIDIA Corporation\NVSMI

+4
source

The following worked for me, an hp laptop. I have the option of Cuda Compute (version) 3.0 compatible Nvidia card. Windows 7

 pip3.6.exe uninstall tensorflow-gpu pip3.6.exe uninstall tensorflow-gpu pip3.6.exe install tensorflow-gpu 
+3
source

Summary:

  1. check if your GPU sees the tensor stream (optional)
  2. check if your video card can work with tenorflow (optional)
  3. Find the CUDA Toolkit and cuDNN SDK versions compatible with your tf version
  4. install the CUDA Toolkit
  5. install cuDNN SDK
  6. removal of pips flow tensor; pip install tenorflow-gpu
  7. check if your GPU sees tensor flow

* source - https://www.tensorflow.org/install/gpu

Detailed instructions:

  1. check if your GPU sees the tensor stream (optional)

     from tensorflow.python.client import device_lib def get_available_devices(): local_device_protos = device_lib.list_local_devices() return [x.name for x in local_device_protos] print(get_available_devices()) # my output was => ['/device:CPU:0'] # good output must be => ['/device:CPU:0', '/device:GPU:0'] 
  2. check if your card can work with tenorflow (optional)

  3. find the versions of the CUDA Toolkit and cuDNN SDK you need

    a) find your version

     import sys print (sys.version) # 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] import tensorflow as tf print(tf.__version__) # my output was => 1.13.1 

    b) find the correct versions of the CUDA Toolkit and cuDNN SDK for your tf version

     https://www.tensorflow.org/install/source#linux * it is written for linux, but worked in my case see, that tensorflow_gpu-1.13.1 needs: CUDA Toolkit v10.0, cuDNN SDK v7.4 
  4. install the CUDA Toolkit

    a) install the CUDA Toolkit 10.0

     https://developer.nvidia.com/cuda-toolkit-archive select: CUDA Toolkit 10.0 and download base installer (2 GB) installation settings: select only CUDA (my installation path was: D:\Programs\x64\Nvidia\Cuda_v_10_0\Development) 

    b) add environment variables:

     system variables / path must have: D:\Programs\x64\Nvidia\Cuda_v_10_0\Development\bin D:\Programs\x64\Nvidia\Cuda_v_10_0\Development\libnvvp D:\Programs\x64\Nvidia\Cuda_v_10_0\Development\extras\CUPTI\libx64 D:\Programs\x64\Nvidia\Cuda_v_10_0\Development\include 
  5. install cuDNN SDK

    a) download cuDNN SDK v7.4

     https://developer.nvidia.com/rdp/cudnn-archive (needs registration, but it is simple) select "Download cuDNN v7.4.2 (Dec 14, 2018), for CUDA 10.0" 

    b) add the path to the bin folder to "environment variables / system variables / path":

     D:\Programs\x64\Nvidia\cudnn_for_cuda_10_0\bin 
  6. pip uninstall tenorflow pip install tenorflow-gpu

  7. check if your GPU sees tensor flow

     - restart your PC - print(get_available_devices()) - # now this code should return => ['/device:CPU:0', '/device:GPU:0'] 
+1
source

Source: https://habr.com/ru/post/1262103/


All Articles