Skip to content

This repository contains instructions for installing the CUDA toolkit on Ubuntu and compiling CUDA samples. Perfect for developers aiming to utilize NVIDIA GPUs for parallel computing tasks. Explore the samples to enhance your GPU programming experience.

Notifications You must be signed in to change notification settings

Ibrahimghali/CUDA_Installation_Ubuntu_22.04

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CUDA Installation Guide for Ubuntu 22.04

This guide walks you through the steps to install NVIDIA's CUDA toolkit on Ubuntu 22.04. CUDA allows you to harness the power of NVIDIA GPUs for computing-intensive tasks like machine learning, simulations, and more.

Table of Contents

Prerequisites

  • A machine running Ubuntu 22.04
  • A CUDA-compatible NVIDIA GPU

Steps

1. Update Your System

Update and upgrade your system packages:

sudo apt update && sudo apt upgrade

2. Install the NVIDIA Driver

Identify and install the recommended NVIDIA driver for your GPU:

sudo ubuntu-drivers devices
sudo apt install nvidia-driver-<version>  # Replace <version> with your recommended driver

Reboot your machine:

sudo reboot

Verify NVIDIA Driver Installation

To verify that the NVIDIA driver is installed correctly, run the following command:

nvidia-smi

You should see an output similar to the following, which indicates that the driver is installed and the GPU is recognized:

NVIDIA-SMI Output

3. Install CUDA Toolkit

  1. Download and install the CUDA repository package:
    wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
    sudo dpkg -i cuda-keyring_1.1-1_all.deb
    sudo apt-get update
    sudo apt-get install -y cuda

4. Set Up the Environment

Update your environment variables by adding the following lines to your .bashrc:

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Reload the .bashrc file:

source ~/.bashrc

Reboot your machine:

sudo reboot

5. Verify Installation

After installation, check if CUDA was installed correctly:

nvcc -V

Further Information

For detailed instructions, see the official NVIDIA CUDA Toolkit Documentation.

About

This repository contains instructions for installing the CUDA toolkit on Ubuntu and compiling CUDA samples. Perfect for developers aiming to utilize NVIDIA GPUs for parallel computing tasks. Explore the samples to enhance your GPU programming experience.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published