CUDA, CuDNN, and Tensorflow installation on windows and Linux.

Machine Learning (3 Part Series)

1 Introduction to Machine Learning and it’s Type
2 Gradient Descent: The Mother of All Algorithms?
3 CUDA, CuDNN, and Tensorflow installation on windows and Linux.

Deep learning task especially computer vision requires hardware for training purpose. Tensorflow-Gpu enables GPU for training using the CUDA.

We are going to install CUDA11.0 on windows and Linux. Before starting the tutorial please check if your GPU Cuda enabled also install a GPU driver for your pc. Visit Here for Check CUDA GPUs | NVIDIA Developer

1. For Linux Users( Ubuntu, Debian based)

Installation on Linux is quite easy compared to windows. Before installation please check the Nvidia GPU driver is installed properly.

You have to install 3 things.

  1. Cuda 11.0 Update 1
  2. Cudnn 8.1

It will show the Driver details.

<span>$ </span>nvidia-smi
<span>$ </span>nvidia-smi
$ nvidia-smi

Enter fullscreen mode Exit fullscreen mode

Download the Cuda 11.0 from CUDA Toolkit 11.0 Update 1 Download | NVIDIA Developer. We are installing “Cuda ToolKit 11.0 Update 1”.

After Downloading the File Run the below command to install Cuda.

<span>$ </span><span>sudo </span>sh Downloads/cuda_11.0.3_451.82_win10.exe
<span>$ </span><span>sudo </span>sh Downloads/cuda_11.0.3_451.82_win10.exe
$ sudo sh Downloads/cuda_11.0.3_451.82_win10.exe

Enter fullscreen mode Exit fullscreen mode

For downloading the Cudnn you need to create an account there. And then you can download the cuDNN. For downloading click here.

Download all three files Developer, Runtime, and sample. Then run the following command.

<span>$ </span><span>sudo </span>dpkg <span>-i</span> <path-to-dev-file>
<span>$ </span><span>sudo </span>dpkg <span>-i</span> <path-to-runtime-file>
<span>$ </span><span>sudo </span>dpkg <span>-i</span> <path-to-samples-file>
<span>$ </span><span>sudo </span>dpkg <span>-i</span> <path-to-dev-file>
<span>$ </span><span>sudo </span>dpkg <span>-i</span> <path-to-runtime-file>
<span>$ </span><span>sudo </span>dpkg <span>-i</span> <path-to-samples-file>
$ sudo dpkg -i <path-to-dev-file> $ sudo dpkg -i <path-to-runtime-file> $ sudo dpkg -i <path-to-samples-file>

Enter fullscreen mode Exit fullscreen mode

After installing Reboot your Pc then Run the following command to install Tensorflow-GPU.

<span>$ </span>pip <span>install </span>tensorflow-gpu
<span>$ </span>pip <span>install </span>tensorflow-gpu
$ pip install tensorflow-gpu

Enter fullscreen mode Exit fullscreen mode

2. For Windows 10 users.

Installation on windows is a little bit tricky. You need some tools before starting the tutorial.

• Nvidia Graphis Driver
• Visual Studio 2019
• Microsoft Visual C++
• Nvidia Graphis Driver
• Visual Studio 2019
• Microsoft Visual C++ 
• Nvidia Graphis Driver • Visual Studio 2019 • Microsoft Visual C++

Enter fullscreen mode Exit fullscreen mode

Download the Cuda 11.0 from CUDA Toolkit 11.0 Update 1 Download | NVIDIA Developer. We are installing “Cuda ToolKit 11.0 Update 1”

图片[1]-CUDA, CuDNN, and Tensorflow installation on windows and Linux. - 拾光赋-拾光赋
Download the cuDNN Library for Windows (x86).

Extract the CuDNN library in the Download Folder. Under the extracted Folder There will be 3 Folders “include”, “bin” and “lib/x64”. Go to the “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0”

and Copy the content to extracted Folders to the CUDA/11.0 Respective Folder. There will be folder names include, bin and lib/x64.

After installing Reboot your Pc then Run the following command to install Tensorflow-GPU.

$ pip install tensorflow-gpu

3. Test the installation

For testing, the whole installation on windows and Linux are the same.
Open your terminal/cmd/powershell and type.

<span>$ </span>python
<span>$ </span>import tensorflow as tf
<span>$ </span>tf.test.is_gpu_available<span>()</span>
<span>$ </span>python
<span>$ </span>import tensorflow as tf
<span>$ </span>tf.test.is_gpu_available<span>()</span>
$ python $ import tensorflow as tf $ tf.test.is_gpu_available()

Enter fullscreen mode Exit fullscreen mode

It will show True and import some libraries.

Machine Learning (3 Part Series)

1 Introduction to Machine Learning and it’s Type
2 Gradient Descent: The Mother of All Algorithms?
3 CUDA, CuDNN, and Tensorflow installation on windows and Linux.

原文链接:CUDA, CuDNN, and Tensorflow installation on windows and Linux.

© 版权声明
THE END
喜欢就支持一下吧
点赞7 分享
People are not just to love and live.
人不是仅仅为了爱而生存的
评论 抢沙发

请登录后发表评论

    暂无评论内容