Skip to content

Latest commit

 

History

History
142 lines (124 loc) · 5.99 KB

install.md

File metadata and controls

142 lines (124 loc) · 5.99 KB

Prerequisites for Local Installation

  • Compiler with C++14 support
  • CMake>=3.23
  • CUDA toolkit (optional)

pyTAGI Installation

pyTAGI is a Python wrapper of C++/CUDA backend for TAGI method. The developers can install either the distributed or local versions of pyTAGI. Currently pyTAGI only supports Python version >=3.9 on both MacOS and Ubuntu.

Create Miniconda Environment

We recommend installing miniconda for managing Python environment, yet pyTAGI works well with other alternatives.

  1. Install miniconda by following these instructions
  2. Create a conda environment
    conda create --name your_env_name python=3.10
    
  3. Activate conda environment
    conda activate your_env_name
    

PyPI Installation

  1. Create conda environment
  2. Install requirements
    pip install -r requirements.txt
    
  3. Install pyTAGI
    pip install pytagi
    
  4. Test pyTAGI package
    python -m python_examples.regression_runner

NOTE: This PyPI distributed version does not require the codebase in this repository. The developers can create their own applications (see python_examples).

Local Installation

  1. Clone this repository. Note that git submodule command allows cloning pybind11 which is the binding python package of C++/CUDA.
    git clone https://github.com/lhnguyen102/cuTAGI.git
    cd cuTAGI
    git submodule update --init --recursive
    
  2. Create conda environment
  3. Install requirements
    pip install -r requirements.txt
    
  4. Install pyTAGI package
    pip install .
  5. Test pyTAGI package
    python -m python_examples.regression_runner

cuTAGI Installation

cuTAGI is the native version implemented in C++/CUDA for TAGI method. We highly recommend installing cuTAGI using Docker method to facilitate the installation.

Docker Build

  1. Install Docker by following these instructions
  2. Build docker image
  • CPU build
    bash bin/build.sh
  • CUDA build
    bash bin/build.sh -d cuda

*NOTE: During the build and run, make sure that Docker desktop application is opened. The commands for runing tasks such as classification and regression can be found here

Ubuntu 20.04

  1. Install CUDA toolkit >=10.1 in /usr/local/ and add the CUDA location to PATH. For example, adding the following to your ~/.bashrc

    export PATH="/usr/local/cuda-10.1/bin:$PATH"
    export LD_LIBRARY_PATH="/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH"
  2. Install GCC compiler by entering this line in Terminal

    sudo apt install g++
  3. Install CMake by following these instructions

  4. Build the project using CMake by the folder cuTAGI and entering these lines in Terminal

    cmake . -B build
    cmake --build build --config RelWithDebInfo -j 16

Windows

  1. Download and install MS Visual Studio 2019 community and C/C++ by following these instructions

  2. Install CUDA toolkit >=10.1 and add CUDA location to Environment variables (see Step 5.3)

  3. Copy all extenstion files from CUDA to MS Visual Studio. See this link for further details.

    COPY FROM C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\visual_studio_integration\MSBuildExtensions 
    TO        C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations
  4. Download and install CMake Windows x64 Installer and add the install directory (e.g., C:\Program Files\CMake\bin) to PATH in Environment variables

  5. Add CMake CUDA compiler to Environment variables.

    variable = CMAKE_CUDA_COMPILER 
    value = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe
  6. Build the project using CMake by navigating to the folder cuTAGI and entering these lines in Command Prompt

    cmake . -B build
    cmake --build build --config RelWithDebInfo -j 16

*NOTE: Users must enter the CUDA version installed on their machine. Here, we illustrate the installation with CUDA version v10.1 (see Step 1 for Ubuntu and 3 & 5 for Windows).

Mac OS (CPU Version)

  1. Install gcc and g++ via Terminal

    brew install gcc
  2. Install CMake by following these instructions

  3. Add CMake to PATH. Add the following line to your .zshrc file

    export PATH="/Applications/CMake.app/Contents/bin/:$PATH"
  4. Build the project using CMake by the folder cuTAGI and entering these lines in Terminal

    cmake . -B build
    cmake --build build --config RelWithDebInfo -j 16

VS Code

  1. Install gcc and g++ w.r.t operating system such as Ubuntu, Window, and Mac OS
  2. Install CMake
  3. Install the following prerequites
  • Visual Studio Code
  • C++ extension for VS Code
  • CMake Tools extension for VS Code