Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Ubuntu Setting

Tensor, CNN and


Nvidia

Jinha yoon
18th June 2022
Nvidia Driver Install
○ Update Ubuntu
○ Install NVIDIA Drivers
a. Check GPU version and Drivers
b. Install Drivers
○ Check

1. Update Ubuntu
sudo apt update && sudo apt upgrade -y

2. Install NVIDIA Drivers

Check GPU version and Drivers


$ ubuntu-drivers devices

In this output, my model [GeForce GTX 1660 SUPER], and the recommended driver (latest
driver) is nvidia-driver-515. So, now I will install nvidia-driver-515 packages

Install Drivers

sudo apt install nvidia-driver-515

After installed, I will reboot my server computer system using


$ sudo reboot

1
3. Check installed driver
$ nvidia-smi

2
Tensorflow
○ Python version check (or install)
○ Install Require Python Libraries and Virtual Environment
a. PIP install , dev
b. Virtual Environment
○ Install Tensorflow
a. Install
b. Check

1. Python version check

Python is already installed in Ubuntu 22.04, just check the version. If there is no python, please
install python.

$ python3 -V

1. Install Require Python Libraries and Virtual Environment


$ sudo apt install python3-pip

$ sudo apt install python3-venv


$ sudo apt install python3-dev

2. Install Cuda, Tensorflow

Cuda is Compute Unified Device Architecture (CUDA), it enables GPUs to parallel computing.
$ sudo apt-get -y install nvidia-cuda-toolkit

3
CUDA Deep Neural Network library (DNN), cuDNN library .
$ sudo apt-get -y install nvidia-cudnn

$ sudo apt-get update && upgrade -y

$ mkdir tensorflow
$ cd tensorflow

I just choose tensorflow as folder name, and tensorvenv as virtual environment, so please
customize as your own.
$ python3 -m venv tensorvenv

Move to folder and activate tensorflow


$ cd tensorflow
$ cd bin
$ source activate

4
** upgrade
$ pip install --upgrade pip
$ pip install --upgrade tensorflow

3. Check
$ python3 -c 'import tensorflow as tf;print(tf.version.VERSION)'

Or

GPU available check


$ python3

import tensorflow as tf;


tf.test.is_gpu_available('GPU');

exit();

And
$ deactivate
jinhaslab@gmail.com

You might also like