Setup RTX3080 with CUDA 11 and TensorFlow 2.6

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.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tzung-Chien Hsieh

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