Skip to content

Latest commit

 

History

History
118 lines (96 loc) · 5.27 KB

INSTALL.md

File metadata and controls

118 lines (96 loc) · 5.27 KB

Installation (choose to either install CUDA 10.1 (step 1a) or 11.1 (step 1b))

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

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

1a.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

1a.2) Download CUDA 10.1:

1a.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

1a.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

1a.5) Check if CUDA has been installed properly:

  • nvcc --version (should the CUDA details)

1b.) Install CUDA 11.1.1 (if not yet installed)

Tested on: Ubuntu 20.04, and 22.04, CUDA: 11.1.1 (11.1.105-1)

1b.1) Install NVIDIA drivers (using the terminal):

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

1b.2) Install CUDA 11.1.1:

1b.3) Set the environmental path:

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

1b.4) Check if CUDA has been installed properly:

  • nvcc --version (should the CUDA details)

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

Tested with: Pytorch 1.8.0 & torchvision 0.9.0 (Ubuntu 16.04/18.04 and CUDA 10.1), Pytorch 1.7.1 & torchvision 0.8.2 (Ubuntu 20.04 and CUDA 11.1), Pytorch 1.9.0 & torchvision 0.10.0 (Ubuntu 22.04 and CUDA 11.1)

2.1) Download and install Anaconda:

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

  • conda create --name maskal python=3.9 pip
  • conda activate maskal

2.3) Downgrade setuptools, to prevent this error:

  • pip uninstall setuptools
  • pip install setuptools==59.5.0

2.4) Download the code repository:

2.5) Install the required software libraries (in the maskal virtual environment, using the terminal):

2.6) Reboot/restart the computer (sudo reboot)

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

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

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

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