NVIDIA cuGraph Documentation#
Overview#
NVIDIA cuGraph is an open-source collection of GPU-accelerated graph analytics libraries. It supports creating and manipulating graphs and running scalable graph algorithms. Its Python APIs integrate with data stored in cuDF and pandas DataFrames, CuPy and SciPy sparse matrices, and NetworkX graphs. Lower-level Python, C, and C++ APIs support applications that need closer integration with cuGraph’s graph primitives.
NVIDIA cuGraph libraries and supporting projects are maintained across several repositories:
cuGraph provides the core GPU-accelerated graph analytics libraries, including the high-level Python API, the lower-level pylibcugraph Python API, the C API, and the C++ API.
cuGraph-GNN contains GPU-accelerated packages for graph neural network workflows built on NVIDIA cuGraph.
cuGraph-PyG integrates NVIDIA cuGraph with PyTorch Geometric and implements its
GraphStore,FeatureStore,Loader, andSamplerinterfaces. See the Python API.pylibwholegraph provides Python interfaces for distributed graph and key-value storage through WholeGraph. cuGraph-PyG can use WholeGraph for greater scalability. See the Python API.
nx-cugraph provides a NetworkX backend that can accelerate supported NetworkX algorithms on NVIDIA GPUs with zero code changes. See the nx-cugraph documentation.
cuGraph Docs contains the documentation sources and build configuration for NVIDIA cuGraph and its related libraries.
Note
cuGraph-DGL was removed in release 25.08. We recommend migrating to cuGraph-PyG, which provides the same functionality along with additional features such as heterogeneous sampling and a unified API. The cuGraph team is not planning further work in the DGL ecosystem.
cuGraph Using NetworkX Code#
cuGraph is now available as a NetworkX backend using nx-cugraph. Our major integration effort with NetworkX offers NetworkX users a zero code change option to accelerate their existing NetworkX code using an NVIDIA GPU and cuGraph.
Check out zero code change accelerated NetworkX. If you would like to continue using standard cuGraph, then continue down below.
Getting started with cuGraph#
Required hardware/software for cuGraph and RAPIDS
Installation#
Please see the latest RAPIDS System Requirements documentation.
This includes several ways to set up cuGraph
Note: Windows use of RAPIDS depends on prior installation of WSL2.
Cugraph API Example
import cugraph import cudf # Create an instance of the popular Zachary Karate Club graph from cugraph.datasets import karate G = karate.get_graph() # Call cugraph.degree_centrality vertex_bc = cugraph.degree_centrality(G)There are several resources containing cuGraph examples, the cuGraph notebook repository has many examples of loading graph data and running algorithms in Jupyter notebooks. The cuGraph test code contains script examples of setting up and calling cuGraph algorithms.
A simple example of testing the degree centrality algorithm is a good place to start. There are also multi-GPU examples with larger data sets as well.