⚙️ LOCAL#

Here you will find the instructions on how to setup BLIP LOCALLY. If you are using the Wilson Cluster, please see the Wilson Cluster Setup page.

Table of Contents#

  1. Docker Installation [RECOMENDED]

  2. Anaconda Installation

  3. Run BLIP

Docker Container#

The easiest way to run Blip is to grab the docker container. First, you must install docker and start it up using the commands,

sudo apt-get update
sudo apt-get install docker.io
sudo systemctl start docker
sudo systemctl enable docker

Now we want to install the nvidia-container-toolkit, which can be done with the following (instructions are here). First, set your distribution using the following command:

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

If you are not using a LTS version of ubuntu, then you can do the following instead:

distribution=ubuntu18.04 \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

You should then be able to download the container toolkit,

sudo apt-get update
sudo apt-get install nvidia-container-toolkit

Restart the docker service, and then you should be ready to grab a container,

sudo systemctl restart docker

Now grab the official pytorch container from docker by issuing the command:

docker pull pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel

The image can then be loaded by issuing

docker run -it --gpus all $(pwd):/workspace/ pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel bash

From inside the container, we can issue the following commands:

?

Anaconda Installation#

  • Environment YAML

The easiet way to install is to create a conda environment dedicated to the API using the packages defined in environment_blip.yml:

conda env create -f environment_blip.yml
conda activate blip

You can optionally add the flag -n <name> to specify a name for the environment.

  • MinkowskiEngine

Due to the nature of the large datasets generated from LArTPC data, parts of Blip make use of SparseTensors in order to be more memory efficient, and to speed up overall performance. SpraseTensors are handled through the MinkowskiEngine package, which interfaces with pytorch. With the libopenblas dependency, we can install MinkowskiEngine via the following

sudo apt-get install libopenblas-dev
pip install -U git+https://github.com/NVIDIA/MinkowskiEngine -v --no-deps --install-option="--blas_include_dirs=${CONDA_PREFIX}/include" --install-option="--blas=openblas"

You may need to switch to a different version of GCC in order to install CUDA. To do this, switch to the older version with:

sudo apt -y install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11

You’ll then need to select the alternative version

$ sudo update-alternatives --config gcc

There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

Selection    Path             Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gcc-12   12        auto mode
1            /usr/bin/gcc-11   11        manual mode
2            /usr/bin/gcc-12   12        manual mode

Press <enter> to keep the current choice[*], or type selection number: 1

BLIP#

From the main folder of Blip you can run:

pip install .

which should install the API for you.

Note

If you are planning to work on the Wilson Cluster check Wilson Cluster Setup