Nvidia Unveils Futuristic Gaming Experience at Computex 2023
News

Nvidia Unveils Futuristic Gaming Experience at Computex 2023, Blending Gaming and AI

by Isabel
May 29, 2023
0

At Computex 2023, Nvidia displays a futuristic gaming experience that...

Read more
Adobe Introduces Powerful Generative AI Tools in Photoshop

Adobe Introduces Powerful Generative AI Tools in Photoshop Beta

May 29, 2023
Adobe Photoshop's Generative Fill Feature

Exploring the Power of Adobe Photoshop’s Generative Fill Feature

May 27, 2023
NVIDIA and Microsoft Partner to Accelerate AI

NVIDIA and Microsoft Partner to Accelerate AI

May 25, 2023
google photos security and privacy

Exploring the Top 5 Privacy and Security Risks of using Google Photos

May 24, 2023
Midjourney Alternatives That Will Blow Your Mind

10 Midjourney Alternatives That Will Blow Your Mind

May 20, 2023
Create Chatbot using ChatGPT

How to Build an AI Chatbot Using the ChatGPT API

April 17, 2023
DragGAN AI editing Tool Install and Use DragGAN Photo Editor

DragGAN AI editing Tool Install and Use DragGAN Photo Editor

May 27, 2023
AgentGPT

How to install AgentGPT

May 10, 2023
Cerebras-GPT

How Cerebras-GPT is Revolutionizing Natural Language Processing

May 12, 2023
How to Use ChatGPT on Your Windows PC

How to Use ChatGPT APP on Your Windows PC

May 31, 2023
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Artificial Intelligence

How to Set Up Deep Learning with Nvidia, CUDA, cuDNN on Ubuntu 22.04

by Cloudbooklet
May 27, 2023
in Artificial Intelligence, Compute Engine, Deep Learning, Google Cloud, Linux
Reading Time: 10 mins read
Set Up Deep Learning with Nvidia, Cuda, cuDNN on Ubuntu
Share on FacebookShare on TwitterShare on WhatsAppShare on Telegram

Table of Contents

  1. System Requirements
  2. Update the System
  3. Verify GPU
  4. Install Pre-required Packages
  5. Install Kernel Headers
  6. Install NVIDIA Drivers
  7. Install CUDA Toolkit and cuDNN
    1. Install CUDA
    2. Install CUDNN
  8. Install Anaconda
  9. Create a New Conda Environment
  10. Activate the Conda Environment
  11. Install Deep Learning Frameworks
  12. Verify Your Installation
  13. Wrap Up!

Deep learning is a cutting-edge technology that enables machines to learn and improve on their own. However, setting up a deep learning environment on your Ubuntu 22.04 system can be a daunting task for those who are new to the technology.

In this article, we will walk you through the process of setting up deep learning architecture on Ubuntu 22.04, including key configurations like Nvidia driver, Cuda, cuDNN, Anaconda setups to ensure a successful installation.

You might also like

How to Setup SSH Keys on Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

May 31, 2023
ChatGPT app

The Easiest Way to Download ChatGPT App Free

May 31, 2023

System Requirements

This setup is tested on a virtual machine provisioned on Google Cloud Compute Engine with the below configurations.

  1. GPU: Tesla T4
  2. CPU: N1-Standard2 (2vCPU 7.5GB RAM)
  3. OS: Ubuntu 22.04 (x86/64)
  4. Disk space: 50 GB
  5. Secure Boot: Disabled.

The approx. cost for this machine on US-Central would cost around $250/mo.

Update the System

Before starting with the installation process, it is recommended to update the system with the latest patches and software updates. Run the following command to update your Ubuntu 22.04 system:

sudo apt update
sudo apt upgrade

Verify GPU

Verify if you have the GPU using the below command.

lspci | grep -i nvidia

If you have your GPU you can proceed with the following installation.

Output
00:04.0 3D Controller: NVIDIA Corporation TU104GL [Tesla T4] (rev a1)

In this guide I am having Nvidia Tesla T4 GPU.

Install Pre-required Packages

Before installing Nvidia driver you need to make sure you have all pre-required packages installed.

sudo apt install build-essential

Install Kernel Headers

You can use the following command to install kernel headers for your operating system.

sudo apt install linux-headers-$(uname -r)

Now you can proceed with the driver installation

Install NVIDIA Drivers

One of the most important steps to setting up deep learning on Ubuntu 22.04 is to install the appropriate NVIDIA drivers for your graphics card. To do this, open a terminal and run the following commands:

sudo apt install nvidia-driver-530

Now you need to reboot.

sudo reboot

Install CUDA Toolkit and cuDNN

Next, you will need to install the CUDA Toolkit and cuDNN, which are essential for running deep learning frameworks such as TensorFlow and PyTorch. You can download the latest version of the CUDA Toolkit from the NVIDIA website, and cuDNN from the cuDNN website. Once you have downloaded the appropriate files, you can install them by running the following commands:

Install CUDA

wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
sudo sh cuda_12.1.1_530.30.02_linux.run

Follow the on screen instructions.

  1. Accept the license agreement by typing accept
  2. Unselect the driver and then choose Install by using the arrow keys and space bar to move and select or unselect. You should not have X mark in the driver
  3. Move the arrow key down to Install and click Enter.
Cuda Installation on Ubuntu

Wait for sometime for the installation to complete.

Now CUDA will get installed in /usr/local/cuda-12.1 location.

Symlink the directory.

sudo ln -snf /usr/local/cuda-12.1 /usr/local/cuda

Install CUDNN

To install cuDNN, you need to login to Nvidia website and download the tar.gz version using this official link.

Once downloaded extract the downloaded file and copy the necessary contents to the cuda directory.

tar -zvxf cudnn-linux-x86_64-8.9.0.131_cuda12-archive.tar.xz

cd cudnn-linux-x86_64-8.9.0.131_cuda12-archive

sudo cp include/cudnn.h /usr/local/cuda-12.1/include
sudo cp lib/libcudnn* /usr/local/cuda-12.1/lib64

sudo chmod a+r /usr/local/cuda-12.1/include/cudnn.h /usr/local/cuda-12.1/lib64/libcudnn*

Now you have CUDA and CUDNN installed.

Once the installation is complete, update the environment variables, and add the following lines to ~/.bashrc

export CUDA_HOME=/usr/local/cuda-12.1
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64
export PATH=${CUDA_HOME}/bin:${PATH}

Activate the environment variables:

source ~/.bashrc

You can check cuda version using the below command.

nvcc -V
Cuda Version

You can also check Nvidia driver installation status using the following command.

nvidia-smi

You will get an output similar to the below one.

Nvidia Driver Installation

Install Anaconda

Anaconda is a popular Python distribution that comes with many pre-installed libraries and tools used in deep learning. To install Anaconda, run the following commands:

You can update the below link using the latest version from the official anaconda website.

curl https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh --output anaconda.sh
bash anaconda.sh

Follow the on screen instructions.

In the final step you can safely answer Yes to initialize Anaconda3.

Create a New Conda Environment

A Conda environment is a virtual environment that allows you to install and manage different versions of packages and libraries. To create a new Conda environment, run the following command:

conda create --name deep-learning

Activate the Conda Environment

After creating a new Conda environment, you need to activate it by running the following command:

conda activate deep-learning

Install Deep Learning Frameworks

Now that you have installed the necessary drivers and tools, you can install the deep learning frameworks of your choice, such as TensorFlow or PyTorch. You can install these frameworks using pip, the Python package manager, as shown below:

pip3 install tensorflow
pip3 install keras
pip install torch

Verify Your Installation

To test the installation, you can run a sample script that uses TensorFlow, Keras, and PyTorch. Create a new Python file and paste the following code:

sudo nano learning.py

Paste the below code and save the file.

import tensorflow as tf
import keras
import torch
print("TensorFlow version:", tf.version)
print("Keras version:", keras.version)
print("PyTorch version:", torch.version)

Execute the file using the following command:

python learning.py

If everything is installed correctly, you should see the versions of TensorFlow, Keras, and PyTorch printed on the screen.

Wrap Up!

In conclusion, setting up a deep learning environment in Ubuntu 22.04 can be a challenging task, but by following the steps outlined above, you can ensure a smooth and successful installation. By installing the necessary drivers and tools, and then installing your preferred deep learning frameworks, you will be well on your way to developing and running your own deep learning models.

Tags: AnacondaCUDANvidiaUbuntu
Share10Tweet6SendShare
Cloudbooklet

Cloudbooklet

Help us grow and support our blog! Your contribution can make a real difference in providing valuable content to our readers. Join us in our journey by supporting our blog today!
Buy me a Coffee

Related Posts

LLM Connected with APIs

Gorilla: LLM Connected with APIs

May 31, 2023
Soundstorm-Pytorch

Soundstorm-Pytorch: A Powerful Tool for Audio Generation

May 30, 2023
Midjourney vs Adobe Firefly

Midjourney vs Adobe Firefly: A Comparison of Two AI Image Generation Tools

May 30, 2023
ChatGPT

How to Use ChatGPT Code Interpreter

May 31, 2023

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

  • Trending
  • Comments
  • Latest
DragGAN The AI-Powered Image Editing Tool

DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

May 30, 2023
DragGAN AI editing Tool Install and Use DragGAN Photo Editor

DragGAN AI editing Tool Install and Use DragGAN Photo Editor

May 27, 2023
Bard API key

Everything You Need to Know About Google’s Bard API Key

May 20, 2023
Install PHP 8.1 on Ubuntu

How to Install or Upgrade PHP 8.1 on Ubuntu 20.04

May 17, 2023
DragGAN The AI-Powered Image Editing Tool

DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

75
Upgrade PHP version to PHP 7.4 on Ubuntu

Upgrade PHP version to PHP 7.4 on Ubuntu

28
Install Odoo 13 on Ubuntu 18.04 with Nginx - Google Cloud

Install Odoo 13 on Ubuntu 18.04 with Nginx – Google Cloud

25
Best Performance WordPress with Google Cloud CDN and Load Balancing

Best Performance WordPress with Google Cloud CDN and Load Balancing

23
How to Setup SSH Keys on Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

May 31, 2023
ChatGPT app

The Easiest Way to Download ChatGPT App Free

May 31, 2023
LLM Connected with APIs

Gorilla: LLM Connected with APIs

May 31, 2023
Soundstorm-Pytorch

Soundstorm-Pytorch: A Powerful Tool for Audio Generation

May 30, 2023

Popular Articles

  • DragGAN The AI-Powered Image Editing Tool

    DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

    1436 shares
    Share 574 Tweet 359
  • DragGAN AI editing Tool Install and Use DragGAN Photo Editor

    332 shares
    Share 133 Tweet 83
  • Auto-Photoshop-Stable Diffusion-Plugin: A New Way to Create AI-Generated Images in Photoshop

    70 shares
    Share 28 Tweet 18
  • InternGPT: A New Way to Interact with ChatGPT

    53 shares
    Share 21 Tweet 13
  • Midjourney vs Adobe Firefly: A Comparison of Two AI Image Generation Tools

    10 shares
    Share 4 Tweet 3
Cloudbooklet

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS

Cloudbooklet © 2023 All rights reserved.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.