Skip to content

[BUG]: betweenness_centrality OOM on large directed graphs in nx_cu_graph 26.2 when k is not specified (regression from 25.2) #5458

@madhu221b

Description

@madhu221b

Version

26.2

Which installation method(s) does this occur on?

Pip

Describe the bug.

In nx-cugraph==25.2, calling nx.betweenness_centrality() on a large directed graph (~75k nodes) without specifying k worked correctly within 15GB GPU VRAM. After upgrading to nx-cugraph-cu12 26.2.0, the same call raises an out-of-memory error unless k is explicitly passed.

The API states k=None means use all nodes as sources, and it should not silently require users to pass k to avoid OOM.

Minimum reproducible example

Working example:
!pip install --force-reinstall nx-cugraph-cu12==25.2.0 --extra-index-url https://pypi.nvidia.com

%env NX_CUGRAPH_AUTOCONFIG=True

import networkx as nx
print(f"using networkx version {nx.__version__}")

nx.config.warnings_to_ignore.add("cache")
G = pd.read_pickle(path)
nxcg_bc_results = nx.betweenness_centrality(G)

Not Working example:

!pip install nx-cugraph-cu12 --extra-index-url=https://pypi.nvidia.com

Relevant log output

RuntimeError: non-success value returned from cugraph_betweenness_centrality: CUGRAPH_UNKNOWN_ERROR std::bad_alloc: out_of_memory: CUDA error (failed to allocate 17450397660 bytes) at: /__w/rmm/rmm/cpp/include/rmm/mr/cuda_memory_resource.hpp:51: cudaErrorMemoryAllocation out of memory

Other/Misc.

A large network with 75k nodes and 266261 edges to reproduce the error.

Code of Conduct

  • I agree to follow cuGraph's Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report

Metadata

Metadata

Assignees

No one assigned

    Labels

    ? - Needs TriageNeed team to review and classifybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions