ImportError: Cannot load Graphbolt C++ library 3, in load_graphbolt raise ImportError("Cannot load Graphbolt C++ library")


Can you show the full list of packages? How did you install DGL?




I have tried many versions but they still don’t work.

conda install -c dglteam/label/th23_cu121 dgl
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
CUDA Version: 12.2
python: 3.11

What’s your dgl version? Can you print (dgl.__version__)?

Hi,

I am seeing this same error with dgl 2.3.0+cu121 installed through pip (pip install dgl -f https://data.dgl.ai/wheels/torch-2.3/cu121/repo.html). My torch version is 2.3.1.

>>> import dgl
Traceback (most recent call last):
  File "/global/homes/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/graphbolt/__init__.py", line 31, in load_graphbolt
    torch.classes.load_library(path)
  File "/global/common/software/nersc9/pytorch/2.3.1/lib/python3.11/site-packages/torch/_classes.py", line 51, in load_library
    torch.ops.load_library(path)
  File "/global/common/software/nersc9/pytorch/2.3.1/lib/python3.11/site-packages/torch/_ops.py", line 1032, in load_library
    ctypes.CDLL(path)
  File "/global/common/software/nersc9/pytorch/2.3.1/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: /global/u1/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/graphbolt/libgraphbolt_pytorch_2.3.1.so: undefined symbol: _ZN5torch6detail10class_baseC2ERKSsS3_SsRKSt9type_infoS6_

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/global/homes/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/__init__.py", line 16, in <module>
    from . import (
  File "/global/homes/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/dataloading/__init__.py", line 13, in <module>
    from .dataloader import *
  File "/global/homes/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/dataloading/dataloader.py", line 27, in <module>
    from ..distributed import DistGraph
  File "/global/homes/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/distributed/__init__.py", line 5, in <module>
    from .dist_graph import DistGraph, DistGraphServer, edge_split, node_split
  File "/global/homes/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/distributed/dist_graph.py", line 12, in <module>
    from .. import backend as F, graphbolt as gb, heterograph_index
  File "/global/homes/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/graphbolt/__init__.py", line 36, in <module>
    load_graphbolt()
  File "/global/homes/s/sark777/.local/perlmutter/pytorch2.3.1/lib/python3.11/site-packages/dgl/graphbolt/__init__.py", line 33, in load_graphbolt
    raise ImportError("Cannot load Graphbolt C++ library")
ImportError: Cannot load Graphbolt C++ library

What’s your glibc version? ldd --version
We recently upgrade the version required to run dgl, which cause similar issue. We are thinking about downgrade.
The min requirement should be 2.31 for now.

Mine is exactly 2.31.

Any update on this issue?

what is the gcc and g++ version on your machine? OS is Linux?

And please share the full ouput of ldd xxx/dgl/graphbolt/libgraphboltxxx.so.

From the output of ldd you could find out which libstdc++.so is linked.

Then run strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX. Please replace the so path with the one you’re using.

Then share the output as well.

I was able to build dgl from source and that fixed the error. I used torch v2.3.1 and cuda v12.2. Thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.