Skip to content

Installation Guide

Markus edited this page Feb 2, 2024 · 1 revision

Installation Guide for Linux with an Nvidia Graphic Card

As installing this package on the Linux operating systems can be challenging, we provide the following installation guide to help you navigate this process with ease.

Based on our testing and experience, we recommend using Ubuntu 22.04.3 LTS with x84_64 architecture, as we can confirm its compatibility with our program's need as of today (October 13th, 2023).

Prerequisite

CUDA

To optimize the duration of your calculation, QuantumCatch offers GPU computing using ArrayFire library. In the case of using an Nvidia Graphic card, you need to use the CUDA backend. Consequently, installing CUDA Toolkit is essential. To learn about the compatibility of CUDA with your GPU, look at Your GPU Compute Capability provided by Nvidia.

Once you have confirmed that your GPU is compatible, you can proceed with installing the CUDA Toolkit. The installation procedure for compatible target platforms is provided here. However, we can confirm the compatibility of this particular installer. In the last step of the installation sudo apt-get -y install cuda, you might encounter errors due to dependency issues. If and only if you experience such issues, it is recommended to use the aptitude package manager to resolve them (as described below). Otherwise, you can proceed to the next part of the installation guide, which covers the installation of Arrayfire.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install aptitude

Then redo the last step using aptitude:

sudo aptitude install cuda

The installation can be confirmed using the following command:

nvcc --vesion

If the nvcc command is not recognized by the system, first, make sure that the CUDA Toolkit is installed correctly. You can double-check by looking into the installation directory. If you haven't changed the installation directory manually, it has to be at:

ls /usr/local/cuda

If the installation directory is empty, then, it might be that the installer was corrupt and CUDA has to be installed again. However, if the installation is done correctly and the directory is not empty, open the ~/.bashrc file and add the following at the end of the script:

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

change the PATH to your own installation directory.

Now, reload the ~/.bashrc using:

source ~/.bashrc

At this point, the nvcc command should be recognized by the system.

ArrayFire

Installing ArrayFire from the Linux package manager is advised since we can confirm its success. Moreover, there was no complexity in installation. The instruction for this installation is provided here. It will install the ArrayFire C/C++ libraries and the wanted backend packages. Nonetheless, we provide a summary here:

sudo apt-key adv --fetch-key https://repo.arrayfire.com/GPG-PUB-KEY-ARRAYFIRE-2020.PUB
echo "deb [arch=amd64] https://repo.arrayfire.com/debian all main" | sudo tee /etc/apt/sources.list.d/arrayfire.list

Update your package list and install your desired packages. As an example, in case you like to install all-backends package:

sudo apt-get update
sudo apt-get install arrayfire

Installing QuantumCatch

Installation of QuantumCatch can be done using pip. Note that as of today, QuantumCatch is compatible with Python versions older than 3.11. A more detailed description of dependencies can be found here.