Installing TensorFlow GPU (Updated)

Within 2 steps

Akshith Kumar
Analytics Vidhya
3 min readMay 22, 2021

--

Photo by Nana Dua on Unsplash

Good News!!…..TensorFlow provides an in-built GPU.

Great, but how to install it ?? Don’t worry we will crack this in 2 Steps.

Note: This could be done only if the system has Nvidia Graphics Card (Must and should)

Come on let’s jump into it.

Photo by Victor Rodriguez on Unsplash

Why GPU’s?

Using GPU’s we could run our neural network problems so comfortably not wasting time on unusual things (I mean sitting all day to train them by watching epoch by epoch).

So, in this blog, we would like to know the installation process very easily (Trust me) in 2 steps.

Steps :

  1. CUDA installation
  2. TensorFlow installation

CUDA Installation

Let’s do it -

First, we need to install CUDA for that check this link provided

Follow the steps in installing CUDA

  1. Select the operating system in which we need to install and the architecture is the default for windows but differs for Linux.
  2. And select based on the version that the system consists of.
  3. Select the local installer type, then click on the download that appears in right hand corner.

4. Once, the download finishes it is in the form of the zip file, and just unzip the Cuda toolkit.

5. Then, move the complete folder into My Computer\C Drive\Program Files\Nvidia GPU Computing Toolkit

6. By making a separate folder in program files with Nvidia GPU Computing Toolkit

7. Next, Open Control Panel — -> System — -> Advance System Settings — ->Environment Variables

8. Add the path of CUDA files into the environmental variables to complete the installation into the system.

TensorFlow Installation

I know, Most of them have already installed TensorFlow.

But don’t worry who hasn’t……I’m here to help you.

Follow me:

Step-1 :

Go, to anaconda prompt and just type pip install tensorflow==2.3.4 it is not fixed to install this specific version, you can use any but in my case, I had installed that specific version.

Step- 2 :

Once, it is done then start installing GPU with pip install tensorflow-gpu==2.3.4 which matches the TensorFlow version.

And it’s done!!

How can I know whether it is installed or not ?? Few Doubts

So let’s start checking with your IDE’s by typing...

That’s it, If we get True then GPU is installed successfully with no more doubts...

And, as I promised it is done with 2 initial steps.

Forgot to say. Readers, u made it.

Thanks :) Happy Learning.

--

--