15 Nisan 2020 Çarşamba

Nvidia CUDA and tensorflow-GPU installation on Ubuntu 16.04

NVIDIA DRIVER INSTALLATION
Firstly install Nvidia driver, open terminal and run following commands.
  1. sudo apt update
  2. sudo add-apt-repository ppa:graphics-drivers/ppa
  3. sudo apt update
  4. sudo apt upgrade
  5. sudo ubuntu-drivers devices
  6. sudo apt install nvidia-410
After installation reboot your PC. Then if you have a problem in login (loop in login);
Open terminal in login screen with CTRL + ALT + F1 and then query your graphics card
  • sudo prime-select query
select intel graphics card, if nvidia is selected
  • sudo prime-select intel
Turn back to login screen (CTRL + ALT + F7), now you must be able to login succesfully.
Open Terminal, activate and check driver;
  • sudo prime-select intel
  • nvidia-smi
If everthing is OK, you must an output similar to;

CUDA TOOLKIT INSTALLATION
Now we are ready for CUDA installation;
Run sudo sh cuda_10.0.130_410.48_linux.run (When it asks to install driver, answer NO, because we have already did it!) Answer YES for all other questions
Then extract the downloaded cuDNN tar file and copy the lib files to /usr/local/cuda-10.0 default path with following commands
  • tar -xf cudnn-10.0-linux-x64-v7.4.2.24.tgz
  • sudo cp -R cuda/include/* /usr/local/cuda-10.0/include
  • sudo cp -R cuda/lib64/* /usr/local/cuda-10.0/lib64

PYTHON AND TENSORFLOW-GPU INSTALLATION
We suggest using conda distribution (download Python 3.7): https://www.anaconda.com/distribution/#download-section
After installation, add anaconda path to environment: export PATH=~/anaconda3/bin:$PATH
Then run : conda in Terminal to check and run: conda activate in your terminal to activate anaconda python environment
To install tensorflow for GPU:
  • pip install tensorflow-gpu==1.13.1 (This version is suitable for CUDA 10.0)

Hiç yorum yok:

Yorum Gönder