Skip to content

Latest commit

 

History

History
81 lines (66 loc) · 3.35 KB

INSTALL.md

File metadata and controls

81 lines (66 loc) · 3.35 KB

Installation

1.) Install CUDA 10.1 (if not yet installed)

Tested on: Ubuntu 18.04, CUDA: 10.1 (10.1.105)

1.1) Install NVIDIA drivers (using the terminal):

  • sudo add-apt-repository ppa:graphics-drivers/ppa
  • sudo apt update
  • sudo apt install nvidia-driver-440
  • nvidia-smi
  • sudo reboot

1.2) Download CUDA 10.1:

1.3) Install CUDA 10.1 (using the terminal, cd to the directory where the file has been downloaded):

  • sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.105-418.39_1.0-1_amd64.deb
  • sudo apt-key add /var/cuda-repo-10-1-local-10.1.105-418.39/7fa2af80.pub
  • sudo apt-get update
  • sudo apt-get install cuda-toolkit-10-1

1.4) Set the environmental path:

  • sudo gedit ~/.bashrc
  • add the following 2 lines at the end of the bashrc file: export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  • save the bashrc file and close it
  • source ~/.bashrc

1.5) Check if CUDA has been installed properly:

  • nvcc --version (should the CUDA details)

2.) Install SizeCNN in a virtual environment (using Anaconda)

Tested with: Pytorch 1.4 and torchvision 0.5

2.1) Download and install Anaconda:

2.2) Make a virtual environment (called sizecnn) using the terminal:

  • conda create --name sizecnn python=3.8 pip
  • conda activate sizecnn

2.3) Download the code repository:

2.4) Install the required software libraries (in the sizecnn virtual environment, using the terminal):

2.5) Reboot/restart the computer (sudo reboot)

2.6) Check if Pytorch links with CUDA (in the sizecnn virtual environment, using the terminal):

  • python
  • import torch
  • torch.version.cuda (should print 10.1)
  • torch.cuda.is_available() (should True)
  • torch.cuda.get_device_name(0) (should print the name of the first GPU)
  • quit()

2.7) Check if detectron2 is found in python (in the sizecnn virtual environment, using the terminal):

  • python
  • import detectron2 (should not print an error)
  • from detectron2 import model_zoo (should not print an error)
  • quit()