dgl icon indicating copy to clipboard operation
dgl copied to clipboard

ImportError: Cannot load Graphbolt C++ library

Open AnnaVitali opened this issue 1 year ago • 6 comments

Hi, I have a problem in using the library on my pc in which I have the following configuration

PyTorch version: 2.3.1+cu121 CUDA version: 12.1

As indicated in the documentation I have installed the library with the command:

pip install dgl -f https://data.dgl.ai/wheels/torch-2.3/cu121/repo.html

but when I launch my script I get this error:

ImportError: Cannot load Graphbolt C++ library

I also did tests on Google Colab and in that case no error is generated, so the problems you have with running locally.

What can I do to solve this problem, if I do not want to run in Colab but in local?

AnnaVitali avatar Jun 06 '24 07:06 AnnaVitali

Pytorch 2.3.1 is not supported in the latest DGL yet. Please try with Pytorch 2.3.0 or previous versions.

Rhett-Ying avatar Jun 07 '24 00:06 Rhett-Ying

Sorry but even with torch 2.3.0 the problem persists

import torch

print(torch.__version__)

output: 2.3.0+cu121

Error

File "/opt/conda/lib/python3.10/site-packages/dgl/__init__.py", line 16, in <module>
    from . import (
File "/opt/conda/lib/python3.10/site-packages/dgl/dataloading/__init__.py", line 13, in <module>
  from .dataloader import *
File "/opt/conda/lib/python3.10/site-packages/dgl/dataloading/dataloader.py", line 27, in <module>
  from ..distributed import DistGraph
File "/opt/conda/lib/python3.10/site-packages/dgl/distributed/__init__.py", line 5, in <module>
  from .dist_graph import DistGraph, DistGraphServer, edge_split, node_split
File "/opt/conda/lib/python3.10/site-packages/dgl/distributed/dist_graph.py", line 11, in <module>
  from .. import backend as F, graphbolt as gb, heterograph_index
File "/opt/conda/lib/python3.10/site-packages/dgl/graphbolt/__init__.py", line 36, in <module>
  load_graphbolt()
File "/opt/conda/lib/python3.10/site-packages/dgl/graphbolt/__init__.py", line 33, in load_graphbolt
  raise ImportError("Cannot load Graphbolt C++ library")
ImportError: Cannot load Graphbolt C++ library

AnnaVitali avatar Jun 14 '24 14:06 AnnaVitali

what is your local OS version? and please check the glibc version as well.

Rhett-Ying avatar Jun 17 '24 00:06 Rhett-Ying

@AnnaVitali DGL 2.3 release is out. It should support torch 2.3.1.

mfbalin avatar Jul 11 '24 03:07 mfbalin

what is your local OS version? and please check the glibc version as well. python: 3.12.0 os: centos8 lld: ldd (GNU libc) 2.28

conda install pytorch=2.3.0 cpuonly torchmetrics=1.4.0 -c pytorch -c conda-forge -y
conda install dgl=2.2.1 -c dglteam/label/th23_cpu -y

It works normally on x86, but there is a general error on arm.

yfismine avatar Jul 31 '24 04:07 yfismine

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

github-actions[bot] avatar Aug 31 '24 01:08 github-actions[bot]