Skip to content

Instantly share code, notes, and snippets.

@xingeji
Last active March 4, 2019 20:02
Show Gist options
  • Select an option

  • Save xingeji/cfa946938e57d463dd41bc90a8cca115 to your computer and use it in GitHub Desktop.

Select an option

Save xingeji/cfa946938e57d463dd41bc90a8cca115 to your computer and use it in GitHub Desktop.

Revisions

  1. xingeji renamed this gist Mar 4, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. xingeji created this gist Mar 4, 2019.
    42 changes: 42 additions & 0 deletions #colab_cuda92_torch41.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    #!/bin/bash

    TEXT_RESET='\e[0m'
    TEXT_YELLOW='\e[1;33m'

    wget https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64
    echo -e $TEXT_YELLOW
    echo 'WEBGET finished..'
    echo -e $TEXT_RESET

    dpkg --install cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64
    echo -e $TEXT_YELLOW
    echo 'DPKG finished..'
    echo -e $TEXT_RESET

    apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub
    echo -e $TEXT_YELLOW
    echo 'APT added key..'
    echo -e $TEXT_RESET

    apt-get update
    echo -e $TEXT_YELLOW
    echo 'APT update finished..'
    echo -e $TEXT_RESET

    apt-get install cuda-9-2
    echo -e $TEXT_YELLOW
    echo 'APT finished installing cuda..'

    echo 'The CUDA version is: '
    cat /usr/local/cuda/version.txt
    echo -e $TEXT_RESET

    pip install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
    echo -e $TEXT_YELLOW
    echo 'pip fininshed installing PyTorch 0.4.1 with CUDA 9.2 backend..'
    echo -e $TEXT_RESET

    pip install torchvision
    echo -e $TEXT_YELLOW
    echo 'pip finished installing torchvision..'
    echo -e $TEXT_RESET