Setup RTX3080 with CUDA 11 and TensorFlow 2.6

Tzung-Chien Hsieh
3 min readSep 20, 2021

--

In this article, I will introduce how to install CUDA 11.4, TensorFlow 2.6, and Keras in the Windows 10 system for RTX3080. Although this article only shows the example on RTX3080, it should be similar to all the graphic cards in the RTX 30 series.

Hardware and environment:

  • Desktop: HP OMEN 30L
  • Graphics card: Nvidia RTX 3080
  • System: Windows 10
  • Python: 3.8
  • Keras: 2.6
  • TensorFlow: 2.6

CUDA installation

CUDA 11.4

  1. Download CUDA 11.4 from (https://developer.nvidia.com/cuda-downloads). You will need to register to Nvidia to get access to the download link.
  2. Install CUDA 11.4.
  3. You could then find CUDA files in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4
  4. Add the path into the environment. (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin)

CuDNN 8.2.4

  1. Download cuDNN (https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installwindows)
  2. Extract the download file and copy the files to the CUDA folder. You could find the CUDA folder in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4.
cuDNN files

Fix missing CUPTI files

You will encounter the error of missing cupti.dll and cupti64_114.dll when you train your model later.

The solution is simply to copy the cupti64_2021.2.1.dll and rename it to cupti.dll and cupti64_114.dll.

copy and rename to cupti.dll and cupti64_114.dll

TensorFlow and Keras installation

Create an environment by conda

conda create --name train python=3.8
conda activate train

Install TensorFlow and Keras

pip install keras==2.6
pip install tensorflow-gpu==2.6

After installation, you might see the installed packages as follows:

keras==2.6.0
Keras-Preprocessing==1.1.2
tensorboard==2.6.0 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.0 tensorflow-estimator==2.6.0 tensorflow-gpu==2.6.0

Test the environment

Check the GPU device by Python

You could run the following command to check whether CUDA, Keras, and TensorFlow were correctly installed.

import keras
import tensorflow as tf
tf.test.gpu_device_name()
tf.config.list_physical_devices('GPU')
Check whether CUDA and Tensorflow were correctly installed.

Check the GPU by nvidia-smi.exe

You will see the information and the status of your GPU. For example, you could see the memory usage, power consumption, and temperature.

Moreover, here you can see that the CUDA version 11.4.

GPU usage during training

Check the GPU by Task Manager

GPU usage during Training

Train ResNet

In the end, you could train ResNet50 by the code in the link below to see whether everything works properly.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Tzung-Chien Hsieh
Tzung-Chien Hsieh

Written by Tzung-Chien Hsieh

PhD in Computer Science, I will share what I learned in Programming, Machine Learning, and Rare Disorders.

Responses (1)

Write a response