Install MAGE × NVIDIA cuGraph
Follow this guide to install Memgraph with NVIDIA cuGraph GPU-powered graph algorithms.
Prerequisites
To be able to run cuGraph analytics, make sure you have compatible infrastructure first. The exact system requirements are available at the NVIDIA RAPIDS site, and include an NVIDIA Pascal (or better) GPU and up-to-date CUDA & NVIDIA drivers.
Docker requirements 🐳
If running MAGE × NVIDIA cuGraph in Docker, the following applies:
- Official NVIDIA driver for your operating system.
- To run on NVIDIA-powered GPUs, RAPIDS requires Docker CE v19.03+ and nvidia-container-toolkit installed.
- Legacy Docker CE v17-18 users require the installation of the nvidia-docker2 package.
Local build requirements:
If building MAGE × NVIDIA cuGraph locally, these requirements apply (tested on Ubuntu):
- Official NVIDIA driver for your operating system.
- CMake version above 3.20
- NVIDIA CUDA developer toolkit – CUDA version 11.6
- System dependencies:
libblas-dev
,liblapack-dev
,libboost-all-dev
- NVIDIA NCCL communications library
Installing the Docker image from Docker Hub
The simplest way of starting Memgraph with cuGraph GPU analytics is to download the image from Docker Hub. Just pull the image, and get it running with these simple commands:
docker run --rm --gpus all -p 7687:7687 -p 7444:7444 memgraph/memgraph-mage:1.3-cugraph-22.02-cuda-11.5
Depending on your environment, different versions of MAGE/cuGraph/CUDA can be installed:
docker run --gpus all -p 7687:7687 -p 7444:7444 memgraph/memgraph-mage:${MAGE_VERSION}-cugraph-${CUGRAPH_VERSION}-cuda-${CUDA_VERSION}
To see the available versions, explore our Docker Hub organization and look for the images tagged memgraph-mage.
The development image with cuGraph support is not available yet. If you want to develop cuGraph-powered query modules in Docker, do not hesitate to contact us about it.
Building MAGE with NVIDIA cuGraph locally with Docker
Download the MAGE source code from GitHub:
git clone https://github.com/memgraph/mage.git && cd mage
Build the MAGE × cuGraph-tagged Docker image:
docker build -f Dockerfile.cugraph -t memgraph-mage .
Start Memgraph-MAGE with the following command:
docker run --rm --gpus all -p 7687:7687 -p 7444:7444 --name mage memgraph-mage
You can now query Memgraph from querying platforms such as Memgraph Lab or mgconsole.
If you made any changes while the Docker container was running, you need to stop the container and rebuild the image. For a workaround, check Development process for MAGE with Docker.
Installing MAGE natively from the source
Make sure you have installed all prerequisites and dependencies before building the MAGE × NVIDIA cuGraph from source.
Download the MAGE source code from GitHub and run the
setup
script. It will generate adist
directory with all the needed files:python3 setup build --gpu
infoThe
--gpu
flag enables building the cuGraph dependencies and creating the shared library with cuGraph algorithms that are loaded into Memgraph.Copy the contents of the newly created
dist
directory to/usr/lib/memgraph/query_modules
:infoTo speed the installation up, you can specify a path for the setup script to copy the built executables:
python3 setup build -p /usr/lib/memgraph/query_modules --gpu
Start Memgraph and enjoy MAGE × cuGraph!
infoIf your Memgraph instance was already running, execute the following query inside one of the querying platforms to reload the modules:
CALL mg.load_all();
If the modules are still missing, restart the instance by running
systemctl stop memgraph
and thensystemctl start memgraph
.For more about loading query modules, consult this guide.