Install#

You can install Hiperwalk locally or its docker distribution. We recommend to use Hiperwalk’s docker distribution.

Docker Installation#

Using Hiperwalk on its Docker distribution offers numerous benefits to users. Docker provides a lightweight, portable, and scalable environment, ensuring seamless deployment across different operating systems and environments. With Docker, users can easily manage dependencies, streamline updates, and replicate configurations, leading to improved consistency and reliability. Additionally, Docker enables efficient resource utilization, facilitating faster development cycles and easier collaboration among team members. Overall, opting for Hiperwalk on its Docker distribution empowers users with enhanced flexibility, efficiency, and agility in their development and deployment processes.

Todo

Add installation guidelines

Local Installation#

Hiperwalk relies on a number of Python libraries. However, installing these Python libraries alone does not enable Hiperwalk to leverage High-Performance Computing (HPC). If you desire to install Hiperwalk with HPC support, please refer to HPC Prerequisites before proceeding with the Hiperwalk installation.

On this page, we outline the process for installing Hiperwalk on a newly installed Ubuntu 20.04 operating system. The steps will cover identifying the GPU, installing the GPU drivers, hiperblas-core, hiperblas-opencl-bridge, pyhiperblas, and all necessary Python libraries.

Hiperwalk#

Hiperwalk can be conveniently installed using pip. To begin, ensure that pip is installed on your system.

sudo apt install python3-pip

The following command will install Hiperwalk as well as all its Python dependencies, which include numpy, scipy, networkx, and matplotlib.

Warning

If you have older versions of these packages, they will likely be updated. If you prefer not to have them updated, we recommend creating a virtual environment.

pip3 install hiperwalk

To verify the success of the installation, you can execute any code found in the examples directory of the repository or proceed to the Tutorial.

To update an older version of the hiperwalk package:

pip3 install hiperwalk --upgrade

HPC Prerequisites#

Before proceeding, it’s advisable to update and upgrade your Ubuntu packages. Execute the following commands:

sudo apt update
sudo apt upgrade

Next, run the following commands to install the prerequisites:

sudo apt install git
sudo apt install g++
sudo apt install cmake
sudo apt install libgtest-dev
sudo apt install python3-distutils
sudo apt install python3-pip
pip3 install pytest

These newly installed programs serve the following purposes:

  • git: used to download hiperblas-core, hiperblas-opencl-bridge, pyhiperblas, and hiperwalk;

  • g++: used for compiling hiperblas-core, and hiperblas-opencl-bridge;

  • cmake: essential for compiling hiperblas-core, hiperblas-opencl-bridge;

  • libgtest-dev: verifies the successful installation of hiperblas-core, and hiperblas-opencl-bridge;

  • python3-distutils: aids in the installation of pyhiperblas;

  • python3-pip: necessary for installing Python libraries;

  • pytest: helps test pyhiperblas.

Although it’s not essential, we recommend installing FFmpeg, which is used for generating animations.

sudo apt install ffmpeg

GPU Driver#

To install the GPU driver, you can follow this tutorial for installing NVIDIA drivers Below, we have outlined the essential steps.

First, you’ll need to identify your GPU by running the following command:

lspci | grep -e VGA

You can then verify if the outputted GPU is CUDA compatible. If it is, execute the following command:

ubuntu-drivers devices

This will list the available drivers for your GPU. We recommend installing the driver tagged with recommended at the end. The driver’s name typically follows the format nvidia-driver-XXX where XXX is a specific number. For the subsequent steps in the installation process, substitute XXX as required. To install the GPU driver, execute the following command:

sudo apt install nvidia-driver-XXX

Finally, reboot you computer. After rebooting, if the installation was successful, running the following command:

nvidia-smi

should display GPU information such as the name, driver version, CUDA version, and so on. Alternatively, you can verify the availability of the NVIDIA Settings application by pressing the Super key on your keyboard and typing nvidia settings.

NVIDIA Toolkit#

Once the GPU drivers have been successfully installed, it’s necessary to install the NVIDIA Toolkit, allowing hiperblas-core to use CUDA. To do this, execute the following command:

sudo apt install nvidia-cuda-toolkit

To verify the correct installation of the NVIDIA Toolkit, you can check if the nvcc compiler has been installed. This can be simply done by running the following command:

nvcc --version

Installing hiperblas-core hiperblas-opencl-bridge and pyhiperblas#

For HPC support, Hiperwalk uses hiperblas-core, hiperblas-opencl-bridge, and pyhiperblas. Note that a computer with a GPU compatible with CUDA is required for this.

The information in this guide is compiled from Paulo Motta’s blog, hiperblas-core github, and pyhiperblas github.

It is strongly recommended that hiperblas-core, hiperblas-opencl-bridge, and pyhiperblas are installed (i.e. cloned) in the same directory. In this guide, we will install both projects into the home directory. In Linux, the tilde (~) serves as an alias for the home directory.

hiperblas-core#

Firstly, clone the repository in the home directory.

cd ~
git clone https://github.com/hiperblas/hiperblas-core.git

Next, navigate to the hiperblas-core directory to compile and install the code.

cd hiperblas-core
cmake .
make
sudo make install
sudo ldconfig

The ldconfig command creates a link for the newly installed hiperblas-core, making it accessible for use by pyhiperblas. Before moving forward, reboot your computer to ensure that the ldconfig command takes effect.

After rebboting, run the following ln command to create a symbolic link to another directory.

sudo ln -s /usr/local/lib /usr/local/lib64

To verify the successful installation of hiperblas-core, execute the vector_test and matrix_test tests.

./vector_test
./matrix_test

hiperblas-opencl-bridge#

The installation of the hiperblas-opencl-bridge is very similar to the installation of hiperblas-core. To install hiperblas-opencl-bridge, first clone the repository into the same directory hiperblas-core was cloned. In this guide, we cloned hiperblas-core into the home directory.

cd ~
git clone https://github.com/hiperblas/hiperblas-opencl-bridge.git

Now, enter the new hiperblas-opencl-bridge directory to compile and install the code.

cd hiperblas-opencl-bridge
cmake .
make
sudo make install

To verify the succesful installation of hiperblas-opencl-bridge, execute the tests

./vector_test
./matrix_test

pyhiperblas#

To install pyhiperblas, first clone the repository into the same directory hiperblas-core was cloned. In this guide, we cloned hiperblas-core into the home directory. Thus, execute:

cd ~
git clone https://github.com/hiperblas/pyhiperblas.git

Next, navigate to the newly created pyhiperblas directory to install it.

cd pyhiperblas
sudo python3 setup.py install

To verify whether the installation was successful, run the following test:

python3 test.py