Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thekitp/b4c2d330d2fae6202ed241c8295d13a1 to your computer and use it in GitHub Desktop.
Save thekitp/b4c2d330d2fae6202ed241c8295d13a1 to your computer and use it in GitHub Desktop.

Revisions

  1. @Mahedi-61 Mahedi-61 revised this gist Aug 13, 2018. 1 changed file with 8 additions and 11 deletions.
    19 changes: 8 additions & 11 deletions cuda_installation_on_ubuntu_18.04
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,11 @@
    #!/bin/bash
    ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.1 in ubuntu 18.04
    ## see official guide: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
    ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04

    ### steps ####
    # verify the system has a cuda-capable gpu
    # verify the system has gcc installed
    # download and install the nvidia cuda toolkit and cudnn
    # setup environment variables
    # verify the system
    # setup environmental variables
    # verify the installation
    ###

    ### to verify your gpu is cuda enable check
    @@ -50,19 +48,18 @@ echo 'export PATH=/usr/local/cuda-9.0/bin:$PATH' >> ~/.bashrc
    echo 'export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
    source ~/.bashrc

    # install cuDNN v7.1
    # install cuDNN v7.2
    # in order to download cuDNN you have to regeistered here https://developer.nvidia.com/developer-program/signup
    # then download cuDNN v7.1 form https://developer.nvidia.com/cudnn
    CUDNN_TAR_FILE="cudnn-9.0-linux-x64-v7.1"
    wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.1/${CUDNN_TAR_FILE}
    # then download cuDNN v7.2 form https://developer.nvidia.com/cudnn
    CUDNN_TAR_FILE="cudnn-9.0-linux-x64-v7.2.1.38"
    wget https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.2.1/prod/9.0_20180806/${CUDNN_TAR_FILE}
    tar -xzvf ${CUDNN_TAR_FILE}

    # copy the following files into the cuda toolkit directory.
    sudo cp -P cuda/include/cudnn.h /usr/local/cuda-9.0/include
    sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-9.0/lib64/
    sudo chmod a+r /usr/local/cuda-9.0/lib64/libcudnn*

    # to verify the system, check
    # finally, to verify the installation, check
    nvidia-smi
    nvcc -V

  2. @Mahedi-61 Mahedi-61 revised this gist Jul 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cuda_installation_on_ubuntu_18.04
    Original file line number Diff line number Diff line change
    @@ -62,7 +62,7 @@ sudo cp -P cuda/include/cudnn.h /usr/local/cuda-9.0/include
    sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-9.0/lib64/
    sudo chmod a+r /usr/local/cuda-9.0/lib64/libcudnn*

    # to verify the system, type
    # to verify the system, check
    nvidia-smi
    nvcc -V

  3. @Mahedi-61 Mahedi-61 revised this gist Jul 24, 2018. 1 changed file with 8 additions and 7 deletions.
    15 changes: 8 additions & 7 deletions cuda_installation_on_ubuntu_18.04
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,16 @@
    #!/bin/bash
    ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.1 in ubuntu 18.04
    ## official guide: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
    ## see official guide: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

    ### steps ####
    # verify the system has a cuda-capable gpu
    # verify the system has gcc installed
    # download and install the nvidia cuda toolkit
    # download cudnn
    # download and install the nvidia cuda toolkit and cudnn
    # setup environment variables
    # verify the system
    ###

    ### checking your NVIDIA gpu is cuda enable or not got to https://developer.nvidia.com/cuda-gpus
    ### to verify your gpu is cuda enable enter in to the comman line
    ### to verify your gpu is cuda enable check
    lspci | grep -i nvidia

    ### gcc compiler is required for development using the cuda toolkit. to verify the version of gcc install enter
    @@ -38,7 +36,7 @@ wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.
    chmod +x cuda_9.0.176_384.81_linux-run
    sudo ./cuda_9.0.176_384.81_linux-run --override

    # Answer questions following while installation begin
    # answer following questions while installation begin
    # You are attempting to install on an unsupported configuration. Do you wish to continue? y
    # Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81? n
    # Install the CUDA 9.0 Toolkit? y
    @@ -59,9 +57,12 @@ CUDNN_TAR_FILE="cudnn-9.0-linux-x64-v7.1"
    wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.1/${CUDNN_TAR_FILE}
    tar -xzvf ${CUDNN_TAR_FILE}

    #copy the following files into the cuda toolkit directory.
    # copy the following files into the cuda toolkit directory.
    sudo cp -P cuda/include/cudnn.h /usr/local/cuda-9.0/include
    sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-9.0/lib64/
    sudo chmod a+r /usr/local/cuda-9.0/lib64/libcudnn*

    # to verify the system, type
    nvidia-smi
    nvcc -V

  4. @Mahedi-61 Mahedi-61 revised this gist Jul 9, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cuda_installation_on_ubuntu_18.04
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    ## This gist is a step by step instructions to install cuda v9.0 and cudnn 7.1 on ubuntu 18.04
    ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.1 in ubuntu 18.04
    ## official guide: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

    ### steps ####
  5. @Mahedi-61 Mahedi-61 revised this gist Jul 9, 2018. 1 changed file with 20 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions cuda_installation_on_ubuntu_18.04
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,23 @@
    #!/bin/bash
    ## This gist is a step by step instructions to install cuda v9.0 and cudnn 7.1 on ubuntu 18.04
    ## official guide: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

    ### steps ####
    # verify the system has a cuda-capable gpu
    # verify the system has gcc installed
    # download and install the nvidia cuda toolkit
    # download cudnn
    # setup environment variables
    # verify the system
    ###

    ### checking your NVIDIA gpu is cuda enable or not got to https://developer.nvidia.com/cuda-gpus
    ### to verify your gpu is cuda enable enter in to the comman line
    lspci | grep -i nvidia

    ### gcc compiler is required for development using the cuda toolkit. to verify the version of gcc install enter
    gcc --version

    # first get the PPA repository driver
    sudo add-apt-repository ppa:graphics-drivers/ppa

  6. @Mahedi-61 Mahedi-61 revised this gist Jul 9, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions cuda_installation_on_ubuntu_18.04
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # first get the PPA repository driver
    sudo add-apt-repository ppa:graphics-drivers/ppa

    # install nvidai driver
    # install nvidia driver
    sudo apt install nvidia-384 nvidia-384-dev

    # install other import packages
    @@ -29,7 +29,7 @@ sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++

    # setup your paths
    echo 'export PATH=/usr/local/cuda-9.0/bin:$PATH' >> ~/.bashrc
    echo 'export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH' >> ~/.bash.rc
    echo 'export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
    source ~/.bashrc

    # install cuDNN v7.1
  7. @Mahedi-61 Mahedi-61 revised this gist Jun 3, 2018. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions cuda_installation_on_ubuntu_18.04
    Original file line number Diff line number Diff line change
    @@ -32,4 +32,16 @@ echo 'export PATH=/usr/local/cuda-9.0/bin:$PATH' >> ~/.bashrc
    echo 'export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH' >> ~/.bash.rc
    source ~/.bashrc

    # install cuDNN v7.1
    # in order to download cuDNN you have to regeistered here https://developer.nvidia.com/developer-program/signup
    # then download cuDNN v7.1 form https://developer.nvidia.com/cudnn
    CUDNN_TAR_FILE="cudnn-9.0-linux-x64-v7.1"
    wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.1/${CUDNN_TAR_FILE}
    tar -xzvf ${CUDNN_TAR_FILE}

    #copy the following files into the cuda toolkit directory.
    sudo cp -P cuda/include/cudnn.h /usr/local/cuda-9.0/include
    sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-9.0/lib64/
    sudo chmod a+r /usr/local/cuda-9.0/lib64/libcudnn*


  8. @Mahedi-61 Mahedi-61 created this gist Jun 3, 2018.
    35 changes: 35 additions & 0 deletions cuda_installation_on_ubuntu_18.04
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    # first get the PPA repository driver
    sudo add-apt-repository ppa:graphics-drivers/ppa

    # install nvidai driver
    sudo apt install nvidia-384 nvidia-384-dev

    # install other import packages
    sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

    # CUDA 9 requires gcc 6
    sudo apt install gcc-6
    sudo apt install g++-6

    # downoad one of the "runfile (local)" installation packages from cuda toolkit archive
    wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run

    # make the download file executable
    chmod +x cuda_9.0.176_384.81_linux-run
    sudo ./cuda_9.0.176_384.81_linux-run --override

    # Answer questions following while installation begin
    # You are attempting to install on an unsupported configuration. Do you wish to continue? y
    # Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81? n
    # Install the CUDA 9.0 Toolkit? y

    # set up symlinks for gcc/g++
    sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
    sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++

    # setup your paths
    echo 'export PATH=/usr/local/cuda-9.0/bin:$PATH' >> ~/.bashrc
    echo 'export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH' >> ~/.bash.rc
    source ~/.bashrc