0

GPU (Cuda) Configuration for Deep Learning Frameworks (Tensorflow, Pytorch)

Speed your algorithms with GPU. Using GPU increases your computation speed x45-x50 times more than using CPU.

Look at the speed benchmark: Deep Learning Tensorflow Benchmark: Intel i5 4210U Vs GeForce Nvidia 1060 6GB. Sometimes, enabling GPU Cuda platform can be difficult.

Configuration List:

  1. Download Microsoft Visual Studio with SDK (Visual Studio 2017 Recommended)
    1. Once the IDE is installed successfully, the components for C++ development and Windows 10 SDK (Version 10.0.15063.0) must be installed.
  2. Download NVIDIA GeForce Experience
  3. Download CUDA Toolkit 10.0
  4. Add to environment variables>path:
    1. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin
    2. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64
    3. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include
  5. Download NVIDIA cuDNN
  6. Copy files from NVIDIA cuDNN
    1. Copy <installpath>\cuda\bin\cudnn64_7.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin.
    2. Copy <installpath>\cuda\ include\cudnn.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include
    3. Copy <installpath>\cuda\lib\x64\cudnn.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\lib\x64.
  7.  Download and update Anaconda:
    1. conda update conda
  8.  Download Pytorch or Tensorflow.
    1. pip install tensorflow-gpu
  9. Pytorch CUDA control:
    1. torch.cuda.is_available() returns True if GPU CUDA is configured correctly.
  10. Tensorflow CUDA control:
    1. tf.test.gpu_device_name() returns /device:GPU:0

Reference:

https://towardsdatascience.com/python-environment-setup-for-deep-learning-on-windows-10-c373786e36d1