avatarDavid Littlefield

Summary

The web content provides a comprehensive guide on installing the NVIDIA CUDA driver, toolkit, cuDNN, and TensorRT in WSL2 (Windows Subsystem for Linux 2) with step-by-step instructions and screenshots.

Abstract

The article titled "The Founder’s Guide: How to Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT in WSL2" is a detailed tutorial aimed at developers looking to set up their WSL2 environment for AI and machine learning tasks. It includes a condensed version with copy-and-paste commands and illustrative screenshots, as well as an expanded version that provides explanations for a deeper understanding of the installation process. The guide begins with instructions on joining the NVIDIA Developer Program, followed by steps to download and install the necessary NVIDIA CUDA driver. It then proceeds with updating and shutting down WSL2, adding NVIDIA to the source list directory, and installing the NVIDIA CUDA Toolkit, cuDNN, and TensorRT libraries. The article concludes with running a sample application to verify the installation and invites readers to subscribe for more content on AI, machine learning, deep learning, and data science.

Opinions

  • The guide is designed to be user-friendly, with both concise and expanded explanations to cater to different learning preferences.
  • The inclusion of copy-and-paste commands and screenshots is intended to simplify the installation process for users.
  • The article emphasizes the importance of having the correct WSL2 version number (4.19.121 or higher) for compatibility.
  • The author suggests that following these instructions will help readers achieve their goal of setting up their development environment efficiently.
  • The tutorial is part of a mini-series aimed at helping readers set up everything they need to start learning about artificial intelligence and related fields.
  • The guide encourages readers to subscribe for more in-depth content, indicating a commitment to ongoing educational support.

The Founder’s Guide

How to Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT in WSL2

The condensed tutorial with copy and paste code and screenshots

Image by Nana Dua

“The expanded version of this article uses concise explanations to help you learn what’s happening 💡”

Join the NVIDIA Developer Program:

  1. Visit the official website.
  2. Click “Join Now”
  3. Enter email address
  4. Click “Next”
  5. Click “Create Account”
  6. Enter user information
  7. Click “Create Account”
  8. Verify email address
  9. Click “Submit”
  10. Enter user information
  11. Click “Submit”

Download the NVIDIA CUDA Driver:

  1. Visit the official website
  2. Click “Get CUDA Driver”
  3. Click “Download Now”

Install the NVIDIA CUDA Driver:

  1. Open “460.15_gameready_win10-dch_64bit_international.exe”
  2. Click “OK”
  3. Select “NVIDIA Graphics Driver”
  4. Click “Agree and Continue”
  5. Click “Next”
  6. Click “Close”

Open PowerShell:

  1. Press “⊞ Windows”
  2. Enter “PowerShell” into the search bar
  3. Click “Run as Administrator”

Update WSL2:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”

The WSL2 version number must be 4.19.121 or higher.

wsl --update

Shut Down WSL2:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
wsl --shutdown

Open WSL2:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
wsl

Get the NVIDIA Public Key:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub

Add NVIDIA to the Source List Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo sh -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'

Update the Source List and Source List Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt-get update

Install NVIDIA CUDA Toolkit 11:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt-get --yes install cuda-toolkit-11-0 cuda-toolkit-10-2

Add NVIDIA to the Source List Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo sh -c 'echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/nvidia-machine-learning.list'

Update the Source List and Source List Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt-get update

Install the CUDA and cuDDN Libraries:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt-get install --yes --no-install-recommends cuda-11-0 libcudnn8=8.0.5.39-1+cuda11.0 libcudnn8-dev=8.0.5.39-1+cuda11.0

Install the TensorRT Library:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt-get install --yes --no-install-recommends libnvinfer7=7.1.3-1+cuda11.0 libnvinfer-dev=7.1.3-1+cuda11.0 libnvinfer-plugin7=7.1.3-1+cuda11.0

Open the BlackScholes Directory:

  1. Find the Python version from below these instructions
  2. Copy the provided command
  3. Paste the command into PowerShell
  4. Press “Enter”
cd /usr/local/cuda-11.0/samples/4_Finance/BlackScholes

Run the MakeFile:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo make

Run the Sample:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
./BlackScholes

“Hopefully, this article helped you get the 👯‍♀️🏆👯‍♀️, remember to subscribe to get more content 🏅”

Next Steps:

This article is part of a mini-series that helps readers set up everything they need to start learning about artificial intelligence, machine learning, deep learning, and or data science. It includes articles that contain instructions with copy and paste code and screenshots to help readers get the outcome as soon as possible. It also includes articles that contain instructions with explanations and screenshots to help readers learn about what’s happening.

Linux:
01. Install and Manage Multiple Python Versions
02. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
03. Install the Jupyter Notebook Server
04. Install Virtual Environments in Jupyter Notebook
05. Install the Python Environment for AI and Machine Learning
WSL2:
01. Install Windows Subsystem for Linux 2
02. Install and Manage Multiple Python Versions
03. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT 
04. Install the Jupyter Notebook Server
05. Install Virtual Environments in Jupyter Notebook
06. Install the Python Environment for AI and Machine Learning
07. Install Ubuntu Desktop With a Graphical User Interface (Bonus)
Windows 10:
01. Install and Manage Multiple Python Versions
02. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
03. Install the Jupyter Notebook Server
04. Install Virtual Environments in Jupyter Notebook
05. Install the Python Environment for AI and Machine Learning
Mac:
01. Install and Manage Multiple Python Versions
02. Install the Jupyter Notebook Server
03. Install Virtual Environments in Jupyter Notebook
04. Install the Python Environment for AI and Machine Learning
Data Science
Artificial Intelligence
Machine Learning
Technology
Programming
Recommended from ReadMedium