Saturday, 4 February 2017

Installing NVIDIA Graphic Driver on G752VS xUbuntu

  1. 1)     Firstly, make sure that you use the correct compatible version of Ubuntu (xUbuntu), use a LTS version.
    2)     Make sure you have disabled the Secure Boot in BIOS. Press F2 and F12 to enter BIOS while powering on GPU.
    a.      Enter in BIOS > Security > Secure Boot and then disable.
    b.      Press F10 to save & exit.

    3)     If the system is new, know the password of root.
    a.      From the local terminal shell type in
    b.     sudo -i
    c.      passwd
    d.      enter your password
    e.      Press Ctrl + d to logout & return to local user.

    4)     Update your Repo
    a.     sudo apt-get update
    b.     sudo apt-get upgrade
    c.      This may take a few minutes, don’t worry

    5)     Install some system dependencies
    a.     sudo apt-get install build-essential cmake git unzip pkg-config
    b.     sudo apt-get install libopenblas-dev liblapack-dev
    c.      sudo apt-get install linux-image-generic linux-image-extra-virtual
    d.     sudo apt-get install linux-source linux-headers-generic
    e.   sudo apt-get install libcupti-dev

    6)     Make sure you have installed important tools like your favourite editor vim, gedit  (I don’t like nano and you won’t like vi)
    a.     sudo apt-get install vim

    7)     Make sure you have downloaded the CUDA & cdDNN library compatible with your Hardware.
    b.      cuDNN - https://developer.nvidia.com/cudnn (You need to register at NVIDIA for downloading cuDNN)

    8)     NVIDIA Graphic Drivers will be installed if you install CUDA directly, we do not need to install it explicitly.
    a.      NVIDIA Driver installation excepts a terminal console, so let’s boot in our Single User mode (or commonly known as Maintenance Mode).

    9)      sudo vim /etc/default/grub
    a.      Comment the line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
    b.     Add a new line GRUB_CMDLINE_LINUX=”text”
    c.      and
    d.     Uncomment the line #GRUB_TERMINAL=console

    10)  Now let’s update GRUB
    a.     sudo update-grub

    11)  Now restart the System
    a.     sudo reboot

    12)  You would be prompted to a BLACK Screen, don’t worry this would be your Terminal for the next couple of minutes.
    a.      As the Directory Structure for Setup has been decided a, so kindly keep all setups here.
    b.     “/home/shivam/setup”

    13)  Make the CUDA library executable Script runnable and then execute it.
    a.     cd /home/shivam/setup
    b.     chmod +x cuda_8.0_linux.run
    c.      mkdir drivers
    d.     sudo ./cuda_8.0_linux.run –extract=`pwd`/drivers

    14)  After this runnable, you can now see three .run files in drivers directory.
    15)  NVIDIA Graphic Driver
    16)  Cuda Linux 64 Rel
    17)  Cuda Samples

    18)  Run the NVIDIA graphic driver executable and select the default directory & options.
    a.     cd drivers
    b.     sudo ./NVIDIA-Linux-x86_64.run
    c.      modprobe nvidia

    19)  Now similarly run CUDA Linux & Cuda Samples.
    a.     sudo ./cuda-linux64-rel.run
    b.     sudo ./cuda-samples-linux.run

    20)  To cross check whether CUDA is installed or not, check in /usr/local
    a.      Check your NVIDIA with nvidia-smi

    21)  Now revert back to Graphical Mode of Ubuntu by changing GRUB (But it’s purely your wish, you can stay in CONSOLE & feel it)

    22)  Add CUDA’s path to your environment.
    a.     vim ~/.bashrc
    b.      and add these lines at the end of the file
    c.      export PATH=$PATH:/usr/local/cuda
    d.     export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64

    23)  Activate your Environment
    a.      source ~/.bashrc

    24)  Now turn for cuDNN
    a.     tar -xvf cudnn-8.0-linux-x64-v5.tgz
    b.     cd cuda
    c.      sudo cp lib64/* /usr/local/cuda/lib64/
    d.     sudo cp include/* /usr/local/cuda/include/
    e.   sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

    25)  Install OS Level Dependencies
    a.     sudo apt-get install build-essential
    b.     sudo apt-get install python-dev
    c.      Matplotlib Prerequisites
    d.     sudo apt-get install pkg-config libpng-dev libfreetype6-dev
    e.      Scipy Prerequisites
    f.       sudo apt-get install gfortran libopenblas-dev liblapack-dev
    g.      Pillow Prerequisites
    h.     sudo apt-get install libjpeg-dev

    26)  For setting up SSH
    a.     sudo apt-get install ssh
    b.     sudo /etc/init.d/ssh restart
    c.      Note down your IP Address, put it in your PUTTY Session on Windows with Port Number 22 (default).

No comments:

Post a Comment