Programmable CUDA/C++ GPU Graph Analytics
| Examples | Project Template | Documentation | Deprecated Documentation | GitHub Actions |
|---|
Gunrock[^1] is a CUDA library for graph-processing designed specifically for the GPU. It uses a high-level, bulk-synchronous/asynchronous, data-centric abstraction focused on operations on vertex or edge frontiers. Gunrock achieves a balance between performance and expressiveness by coupling high-performance GPU computing primitives and optimization strategies, particularly in the area of fine-grained load balancing, with a high-level programming model that allows programmers to quickly develop new graph primitives that scale from one to many GPUs on a node with small code size and minimal GPU programming knowledge.
| Branch | Purpose | Version | Status |
|---|---|---|---|
main |
Default branch, ported from gunrock/essentials, serves as the official release branch. |
$\geq$ 2.x.x |
Active |
master |
Previous release branch for gunrock/gunrock version 1.x.x interface, preserves all commit history. |
$\leq$ 1.x.x |
Deprecated |
Before building Gunrock, ensure you have the following installed:
[!WARNING] For AMD/ROCm builds, you may need to install additional ROCm packages:
rocprim-dev,rocthrust-dev,hipcub-dev,hiprand-dev,hipsparse-dev,rocrand, androctracer. These are typically installed with a full ROCm installation.
git clone https://github.com/gunrock/gunrock.git
cd gunrockmkdir build && cd buildFor AMD/ROCm Backend:
# For AMD MI350/MI355 (gfx950) - adjust CMAKE_HIP_ARCHITECTURES for your GPU
cmake -DCMAKE_BUILD_TYPE=Release \
-DESSENTIALS_AMD_BACKEND=ON \
-DESSENTIALS_NVIDIA_BACKEND=OFF \
-DCMAKE_HIP_ARCHITECTURES=gfx950 \
..For NVIDIA/CUDA Backend:
# For NVIDIA H100 (sm_90) - adjust CMAKE_CUDA_ARCHITECTURES for your GPU
cmake -DCMAKE_BUILD_TYPE=Release \
-DESSENTIALS_AMD_BACKEND=OFF \
-DESSENTIALS_NVIDIA_BACKEND=ON \
-DCMAKE_CUDA_ARCHITECTURES=90 \
..Common GPU Architecture Codes:
75 (Turing), 80 (Ampere), 86 (Ampere), 89 (Ada), 90 (Hopper)gfx906 (Vega), gfx908 (MI100), gfx942 (MI300), gfx950 (MI350/MI355)Build all algorithms:
make -j$(nproc)Build specific algorithm:
make bfs # Breadth-First Search
make sssp # Single-Source Shortest Path
make pr # PageRank
make bc # Betweenness Centrality
make color # Graph Coloring
# ... and moreBuild all examples:
make examples# Run BFS
./bin/bfs --market ../datasets/chesapeake/chesapeake.mtx --src 0
# Run SSSP with validation
./bin/sssp --market ../datasets/chesapeake/chesapeake.mtx --src 0 --validate
# Run with custom optimization options
./bin/bfs --market ../datasets/chesapeake/chesapeake.mtx \
--src 0 \
--advance_load_balance merge_path \
--enable_filter \
--filter_algorithm compact \
--num_runs 10For a detailed explanation, please see the full documentation. The following example shows simple APIs using Gunrock's data-centric, bulk-synchronous programming model, we implement Breadth-First Search on GPUs. This example skips the setup phase of creating a problem_t and enactor_t struct and jumps straight into the actual algorithm.
We first prepare our frontier with the initial source vertex to begin
push-based BFS traversal. A simple f->push_back(source) places
the initial vertex we will use for our first iteration.
void prepare_frontier(frontier_t* f,
gcuda::multi_context_t& context) override {
auto P = this->get_problem();
f->push_back(P->param.single_source);
}We then begin our iterative loop, which iterates until a convergence condition has been met. If no condition has been specified, the loop converges when the frontier is empty.
…include/gunrock/algorithms/bfs.hxx
Thank you for citing our work.
…@InProceedings{Osama:2022:EOP,
author = {Muhammad Osama and Serban D. Porumbescu and John D. Owens},
title = {Essentials of Parallel Graph Analytics},
booktitle = {Proceedings of the Workshop on Graphs,
Architectures, Programming, and Learning},
year = 2022,
series = {GrAPL 2022},
month = may,
pages = {314--317},
doi = {10.1109/IPDPSW55747.2022.00061},
url = {https://escholarship.org/uc/item/2p19z28q},
}Gunrock is copyright The Regents of the University of California. The library, examples, and all source code are released under Apache 2.0.
[^1]: This repository has been moved from https://github.com/gunrock/essentials and the previous history is preserved with tags and under master branch. Read more about gunrock and essentials in our vision paper: Essentials of Parallel Graph Analytics.
[^2]: Recommended CUDA v12.4 or higher and ROCm 6.4 or higher.
No open issues yet, or sync has not completed.