This is going to be a tutorial on how to install
Tensorflow is an open source software library developed and used by Google that is fairly common among students, researchers, and developers for deep learning applications such as neural networks. It has both the CPU as well as GPU version available and although the CPU version works quite well, realistically, if you are going for deep learning, you will need GPU. In order to use the GPU version of TensorFlow, you will need an NVIDIA GPU with a compute capability > 3.0.
Using latest version of Tensorflow provides you latest features and optimization, using latest CUDA Toolkit provides you speed improvement with latest gpu support and using latest CUDNN greatly improves deep learing training time.
There must be 64-bit python installed tensorflow does not work on 32-bit python installation. Goto here for instruction on how to install python 3.6 on Windows. Also make sure python is set to %PATH% environment.
Also make sure if you have enough ~ 15 GB of free space in C drive. You can use another drive as well but need to change path.
Step 1: Verify you have a CUDA-Capable GPU:
Before doing anything else, you need to verify that you have a CUDA-Capable GPU in order to install Tensorflow GPU. You can verify that you have a CUDA-capable GPU through the Display Adapters section in the Windows Device Manager. Here you will find the vendor name and model of your graphics card(s).
The Windows Device Manager can be opened via the following steps:
Open a run window from the Start Menu or (Win+R)
Run:
control /name Microsoft.DeviceManager
Then goto Display Adapters.
If your graphics card is from NVIDIA then go to http://developer.nvidia.com/cuda-gpus and verify if listed in CUDA enabled GPU list.
Note down its Compute Capability. eg. GeForce 840M 5.0
Step 2: Install Visual C++ Build Tools 2015
We need Visual Studio 2015 stuffs here. If you have installed Visual Studio 2015 or 2017 no problem run the following setup and be okay with instructions on screen
Goto https://visualstudio.microsoft.com/vs/older-downloads and move to end you will find “Redistributables and Build Tools”
Download and install following :
1. Microsoft Visual C++ 2015 Redistributable Update 3 x64
2. Microsoft Build Tools 2015 Update 3
Step 3: Download the NVIDIA CUDA Toolkit:
If you have already CUDA stuffs other than CUDA 10 then uninstall all one by one from control panel.
Go to https://developer.nvidia.com/cuda-downloads and download Installer for Windows [your version][network]. For me, version is Windows 10. I recommend you to use network installer.
Install it in default location with default settings. It will update your GPU driver if required.
Step 4: Reboot the system to load the NVIDIA drivers.
Step 5: Check Cuda Toolkit:
Go to run (Win + R) type cmd
The following command will check for nvcc version and insure that it is set in path environment variable.
nvcc --version
You will see something like:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018
Cuda compilation tools, release 10.0, V10.0.130
Now test a sample to see setup is working by running following
Go to run (Win + R) type
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\demo_suite\nbody.exe"
Step 6: Install MSYS2:
MSYS2 provides you basic useful command-line Linux programs to your windows.
Download http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe and install with all default settings
Goto run [Win+R] and enter following command:
"C:\msys64\msys2_shell.cmd" -use-full-path
MSYS2 shell will opened update it using:
pacman -Syu
It will take some time to get updated if all completed then close the shell.
Again goto run [Win+R] and enter following command:
"C:\msys64\msys2_shell.cmd" -use-full-path
MSYS2 shell will opened update it using:
pacman -Su
pacman -S git patch unzip zip ed
Complete all installation with [y]
Step 7: Install cuDNN 7.3.1:
Goto https://developer.nvidia.com/cudnn (Membership required)
After login
Download the following:
cuDNN v7.3.1 Library for Windows [your version] for me Windows 10
Goto downloaded folder and extract cudnn-10.0-windows10-x64-v7.3.1.20.zip
Go inside extracted folder and copy all files and folder from cuda folder (eg. Bin, include, lib) and paste to “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0”.
Step 8: Install bazel build:
Goto run [Win+R] and enter following command:
"C:\msys64\msys2_shell.cmd" -use-full-path
MSYS2 shell will opened, then do following:
cd /c/
mkdir bazel
cd bazel/
wget https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel-0.17.2-windows-x86_64.exe -O bazel.exe
Step 9: Set Windows to use long path :
Go to run (Win + R) enter following:
gpedit.msc
Then goto Computer Configuration -> Administrative Templates -> System -> Filesystem
Configure “Enable Win32 long paths” to “Enabled”
Leave a Reply