Learning CUDA: Step 01: Installation

This topic shows steps to install NVIDIA driver and Cuda toolkit on Ubuntu.

My card GT630 is old then I have to use Ubuntu 16.04 that have gcc 5 and linux kernel 4. However, the steps are same for newer card and kernel. You must check cuda version before selecting suitable linux version for your card.

1. Preparation

  • Hardware: PC with NVidia Card, GT630 is used in this series (driver 384, cuda 8.0 GA2, gcc 5)
  • OS: Ubuntu 16.04

2. Remove existing driver

sudo apt-get remove --purge nvidia*
sudo apt-get remove --purge "nvidia*"

3. Install driver

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
ubuntu-drivers devices
sudo apt install -y nvidia-384 libxmu-dev freeglut3-dev libx11-dev libglu1-mesa libglu1-mesa-dev libfreeimage-dev
sudo reboot

4. Reboot and check

sudo reboot
nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.130                Driver Version: 384.130                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GT 630      Off  | 00000000:03:00.0 N/A |                  N/A |
| 40%   39C    P0    N/A /  N/A |      0MiB /  1985MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+

5. Download Cuda and patches

mkdir v8.0_ga2
cd v8.0_ga2
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/patches/2/cuda_8.0.61.2_linux-run

6. Extract packages

chmod +x cuda_8.0.61_375.26_linux-run
chmod +x cuda_8.0.61.2_linux-run
mkdir extract
./cuda_8.0.61_375.26_linux-run --extract=$(pwd)/extract

7. Install Cuda only

sudo ./extract/cuda-linux64-rel-8.0.61-21551265.run -noprompt
sudo ./cuda_8.0.61.2_linux-run --silent --accept-eula
sudo /bin/bash -c 'echo PATH=\"\$PATH:/usr/local/cuda/bin\" >> /etc/profile'
sudo /bin/bash -c 'echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf'
sudo ldconfig

8. Reboot and check

sudo reboot
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:22:03_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

9. Install CuDNN

Go to this link to download CuDNN https://developer.nvidia.com/cudnn, version should >= 7.0

Install to system

sudo dpkg -i cudnn/libcudnn7_7.1.4.18-1+cuda8.0_amd64.deb
sudo dpkg -i cudnn/libcudnn7-dev_7.1.4.18-1+cuda8.0_amd64.deb
sudo dpkg -i cudnn/libcudnn7-doc_7.1.4.18-1+cuda8.0_amd64.deb

Check version

cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2
#define CUDNN_MAJOR 7
#define CUDNN_MINOR 1
#define CUDNN_PATCHLEVEL 4
#define CUDNN_VERSION    (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
#include "driver_types.h"

Comments

7 responses to “Learning CUDA: Step 01: Installation”

  1. I’ll immediately take hold of your rss as I can’t in finding
    yor e-mailsubscription link or e-newsletter service.

    Do you’ve any? Kindly let me realize soo that I may just subscribe.
    Thanks.

    my web site; project management course, Edwin,

  2. Very interesting information!Perfect just what I was searchhing for!

    Also visit my blog: cisco ccna (https://examenzen.com/)

  3. If some one needs to bee updated wiyh newest technologies therefore he must be
    pay a visit this website and bbe up to date all
    the time.

    My web blog: diy repair – Vida,

  4. Definitely believe that that you said. Your favourite justification appeared to be at the net the easiest thing to be mindful of.

    I say to you, I definitely get annoyrd at the same time as peope consider
    concerns that they just do not recognise about. You controlled too hit the nail uon the highest annd defined out the entire thing without havig side
    effect , folks could take a signal. Will probably be again to get more.
    Thank you!

    Feel free to surf to my web blog … repair your car – Chong,

  5. First of all I would like to say great blog! I had a quickk question in which I’d
    like to ask iif yoou don’t mind. I was interested
    to know hhow you center yourfself and clear your
    thoughts prior to writing. I have had difficulty clearing my thoughts in getting my ideas out.
    I do enjoy writing but it just seems like the first 10 to 15 minutes
    are llost juyst trying to figfure out how to begin. Any suggestions or tips?

    Thank you!

    Alsso visit my homepage; Car repair (https://thedailyschematic.com/honeywell-thermostat-rth5160d-wiring-Diagram.html)

  6. I genuinely enjoy studying on this web site, it contains good posts.

    Also visit my web blog; porsche 911 parts diagram (Wilhemina)

  7. poulan 2150 chain saw diagram Avatar
    poulan 2150 chain saw diagram

    I read this article completely on the topic of the resemblance of latest and previous technologies, it’s
    amazing article.

Leave a Reply

Your email address will not be published. Required fields are marked *