Skip to main content

How to Install CUDA Toolkit 13.3 and Set Environment PATH Variables on Ubuntu 26.04 LTS

Setting up deep learning environment frameworks, GPU acceleration, or high-performance C++ applications on Linux often requires installing NVIDIA CUDA Toolkit. If you are running Ubuntu 26.04 LTS (Noble Numbat / Future LTS), this step-by-step guide will walk you through downloading, installing, and permanently configuring the CUDA PATH environment variables.




Table of Contents

  1. Prerequisites
  2. Step 1: System Preparation & Update
  3. Step 2: Add NVIDIA CUDA Repository & Pinning
  4. Step 3: Download and Install CUDA 13.3 Package
  5. Step 4: Update APT and Install CUDA Toolkit
  6. Step 5: Set CUDA PATH Environment Variables (Crucial Step)
  7. Step 6: Verify the Installation
  8. Troubleshooting & Common Issues
  9. Conclusion

Prerequisites

Before proceeding, ensure that:

  • You have an NVIDIA GPU installed in your machine.
  • You are running Ubuntu 26.04 (x86_64 architecture).
  • You have sudo administrative privileges.
  • Proper NVIDIA display drivers are installed (nvidia-smi should run successfully).

To check your GPU and current driver status, run:

nvidia-smi

Step 1: System Preparation & Update

Start by ensuring your system packages and repository headers are up to date.

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y build-essential dkms wget software-properties-common

Step 2: Add NVIDIA CUDA Repository & Pinning

APT repository pinning ensures that system package updates don't unexpectedly overwrite or conflict with official CUDA packages provided directly by NVIDIA.

Execute the following commands to download and configure the repository pin:

# Download the APT repository pin file
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2604/x86_64/cuda-ubuntu2604.pin

# Move the pin file to APT preferences
sudo mv cuda-ubuntu2604.pin /etc/apt/preferences.d/cuda-repository-pin-600

Step 3: Download and Install CUDA 13.3 Package

Next, download the local installer Debian package (.deb) for CUDA 13.3 on Ubuntu 26.04.

# Download the CUDA local repository package
wget https://developer.download.nvidia.com/compute/cuda/13.3.1/local_installers/cuda-repo-ubuntu2604-13-3-local_13.3.1-610.43.02-1_amd64.deb

# Install the repository package using dpkg
sudo dpkg -i cuda-repo-ubuntu2604-13-3-local_13.3.1-610.43.02-1_amd64.deb

# Copy the GPG keyring to APT's trusted keyrings directory
sudo cp /var/cuda-repo-ubuntu2604-13-3-local/cuda-*-keyring.gpg /usr/share/keyrings/

Step 4: Update APT and Install CUDA Toolkit

Now that the local repository and keyring are properly configured, update package lists and install cuda-toolkit-13-3:

# Update local package index
sudo apt-get update

# Install CUDA Toolkit 13.3
sudo apt-get -y install cuda-toolkit-13-3

Note: If you also need the full display drivers included alongside the toolkit, you can install sudo apt-get -y install cuda instead of just cuda-toolkit-13-3.


Step 5: Set CUDA PATH Environment Variables (Crucial Step)

By default, installing the CUDA Toolkit places binaries in /usr/local/cuda-13.3/bin and libraries in /usr/local/cuda-13.3/lib64. However, Linux will not automatically recognize commands like nvcc until you update your shell environment variables.

Option A: Set PATH for Current Shell (Temporary)

To temporarily add CUDA to your current terminal session:

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

Option B: Set PATH Permanently for User (Recommended)

To ensure CUDA paths are available every time you open a terminal or log in, append the variables to your ~/.bashrc file (or ~/.zshrc if using Zsh):

# Open bash profile
echo '' >> ~/.bashrc
echo '# NVIDIA CUDA 13.3 Environment Setup' >> ~/.bashrc
echo 'export PATH=/usr/local/cuda-13.3/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-13.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc

# Reload bashrc configuration
source ~/.bashrc

Alternatively, you can use symlinks pointing to /usr/local/cuda so that future version upgrades don't break your configuration:

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

Option C: Set System-Wide Library Path

For system-wide CUDA dynamic library access across all users:

echo "/usr/local/cuda-13.3/lib64" | sudo tee /etc/ld.so.conf.d/cuda-13-3.conf
sudo ldconfig

Step 6: Verify the Installation



After setting your environment variables, verify that CUDA compiler and driver communications work properly:

1. Check nvcc Compiler Version

nvcc --version

Expected Output:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on ...
Cuda compilation tools, release 13.3, V13.3.x

2. Verify CUDA Installation Path

which nvcc

Expected Output: /usr/local/cuda-13.3/bin/nvcc (or /usr/local/cuda/bin/nvcc)

3. Test GPU Driver Communication

nvidia-smi

Troubleshooting & Common Issues

Issue 1: command not found: nvcc

  • Cause: The PATH environment variable is not updated or current shell session was not reloaded.
  • Fix: Run source ~/.bashrc or verify that export lines are in ~/.bashrc.

Issue 2: dpkg: error processing package...

  • Cause: Interrupted package installations or missing dependencies.
  • Fix: Run sudo apt-get install -f to repair broken dependencies.

Issue 3: Driver Mismatch / Kernel Modules Not Loaded

  • Cause: Kernel updated without DKMS rebuilding modules.
  • Fix: Reboot system (sudo reboot) or reinstall driver packages.

Quick Cheat Sheet (Commands Summary)

# 1. Download Repository Pinning
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2604/x86_64/cuda-ubuntu2604.pin
sudo mv cuda-ubuntu2604.pin /etc/apt/preferences.d/cuda-repository-pin-600

# 2. Download & Install Repository
wget https://developer.download.nvidia.com/compute/cuda/13.3.1/local_installers/cuda-repo-ubuntu2604-13-3-local_13.3.1-610.43.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2604-13-3-local_13.3.1-610.43.02-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2604-13-3-local/cuda-*-keyring.gpg /usr/share/keyrings/

# 3. Install Toolkit
sudo apt-get update
sudo apt-get -y install cuda-toolkit-13-3

# 4. Set PATH Permanently
echo 'export PATH=/usr/local/cuda-13.3/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-13.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc
source ~/.bashrc

# 5. Verify
nvcc --version





Conclusion


You have successfully installed CUDA Toolkit 13.3 on Ubuntu 26.04 LTS and properly configured environment PATH variables! You are now ready to compile CUDA programs, run GPU acceleration frameworks like PyTorch and TensorFlow, or build custom C++/CUDA kernels.

Comments

Popular posts from this blog

Unreal Engine Product Showcase: Mesmerizing Video Sequence Render

  4k Image:

Cloudflare Is Down Worldwide: What Happened, What It Means & What You Can Do

🌍 Cloudflare Is Down Worldwide: What Happened & Why the Internet Broke Today On 18 November 2025 , the internet experienced one of the largest global outages in years as Cloudflare , the backbone of countless websites and online services, went down unexpectedly. The outage caused millions of websites to become slow, unreachable, or return 5xx internal server errors , leading to widespread disruption across businesses, apps, and essential online platforms. This blog post explains what happened, why the internet broke for many users, and what Cloudflare has officially said so far. What Exactly Happened? Around 4:30 PM IST , reports began flooding social media and outage trackers like Downdetector. Users across India, Europe, the US, and Southeast Asia noticed that: Websites were not loading Requests were timing out Services dependent on Cloudflare CDN or DNS stopped responding APIs hosted through Cloudflare were failing Even some security and protection layers were ...

Install TensorFlow on Windows 11: Step-by-Step Guide for CPU & GPU

 --- Installing **TensorFlow on Windows 11** requires setting up system dependencies, configuring Python, and ensuring compatibility with CPU or GPU acceleration. This step-by-step guide provides everything needed to install **TensorFlow 2.10 or lower** on **Windows Native**, including software prerequisites, Microsoft Visual C++ Redistributable installation, Miniconda setup, GPU driver configuration, and verification steps.   ### **System Requirements:**   Before installing TensorFlow, ensure your system meets these requirements:   - **Operating System:** Windows 7 or higher (64-bit)   - **Python Version:** 3.9–3.12   - **pip Version:** 19.0 or higher for Linux and Windows, 20.3 or higher for macOS   - **Microsoft Visual C++ Redistributable:** Required for Windows Native   - **Long Paths Enabled:** Ensure long paths are enabled in Windows settings   For **GPU support**, install:   - **NVIDIA ...