Nov/04/2018 Updated by

CUDA

How to install CUDA


[Up] Japanese English

For Windows 10

Install CUDA and cuDNN.

Installation of CUDA 9


Installation of cuDNN

  1. Go to the nVidia official web site https://developer.nvidia.com/rdp/cudnn-download .
  2. Dwonload the cuDNN package for your OS.
  3. As of Oct/2018, it was the next package for Windows 10.

    cuDNN v7.3.1 [Sept 28, 2018], for CUDA 9.0
      cuDNN v7.3.1 Library for Windows 10
    
  4. Read https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html carefully and install according to the instructions.
  5. Copy 3 files to the indicated folder as follows.
  6. The path of the folder is represented by PATH.

    copy PATH\cuda\bin\cudnn64_7.dll  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
    copy PATH>\cuda\ include\cudnn.h  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include
    copy PATH>\cuda\lib\x64\cudnn.lib  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64
    
  7. Set the environment variable CUDA_PATH to the following value.
  8.   variable naem:   CUDA_PATH 
      variable value:  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
    

CUDA Toolkit

If you just run tensorflow-gpu on python, it works just for "Cuda 9" and "cuDNN". However, in order to compile the CUDA program by yourself, you need to install the "CUDA Toolkit".

  1. Read the manual carefully.
  2. https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html

    CUDA_Installation_Guide_Windows.pdf (loca copy)

  3. Download "NVIDIA CUDA Toolkit".
  4. http://developer.nvidia.com/cuda-downloads
  5. Double click "cuda_10.0.130_411.31_win10.exe", and follow the instructions.
  6. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
    
  7. Confirm the CUDA_PATH Environment Variable is changed.
  8.  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
    

    When installing "cuDNN", you set the environment variable CUDA_PATH manually, but it is changed automatically by the "CUDA Toolkit" installer.

  9. The precompiled executable files exist in the following path.
  10. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\demo_suite
    

    In order to confirm the correct installation, run the programs like bandwidthTest.exe, deviceQuery.exe, nbody.exe oceanFFT.exe, etc.

  11. The .prop file to register CUDA plugin into Microsoft Visual Studio is there.
  12. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\visual_studio_integration\MSBuildExtensions
    
  13. NVIDA driver has 2 modes, WDDM and TCC (Tesla Compute Cluster). The default mode i TCC. To check the mode and switch it, use nvidia-smi.
  14. The are sample programs in the following path.
  15. C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0
    
    1. From the manual, you would better to compile bandwidthTest of 1_Utilities\bandwidthTest.
    2. Double click C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0\1_Utilities\bandwidthTest\bandwidthTest_vs2017.sln, and start Visual Studio 2017.
    3. On the project name, right click → dependencies of build → build customization → Confirm "CUDA 10.0(.targets, props)" and "CUDA 10.0(.targets)" are checked.



    4. Build with "Release", "x64" and run. It works.



    Environment variable is set automatically by the Build Customization CUDA 10.0.props file which exists in the following path.

    [For VS2015]  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations
    [For VS2017]  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\BuildCustomizations
    

    When you compile your cuda application with Visual Studio, set the dependencies of build to "Cuda 10.0(.progs) checked.

  16. When you create a new CUDA project, do as follows
  17. File → New Project ... → NVIDIA &arr; CUDA 10.0 &arr; CUDA 10.0 Runtime
    
    To refer custom CUDA Toolkit, Set CUDA C/C++ → Common → CUDA Toolkit Custom Dir
  18. When you use CUDA in the existing project,
  19. right click on the project name → "build dependencies" → "Build customization"
    → "CUDA 10.0(.targets, props)" is checked.
    
    OR
    right click on the project name → Properties → CUDA C/C++ →、Common → CUDA Toolkit Custom Dir →
    set $(CUDA_PATH)
    
  20. Document location
  21. file:///C:/Program%20Files/NVIDIA%20GPU%20Computing%20Toolkit/CUDA/v10.0/doc/html/index.html