dmlc / dgl

Python package built to ease deep learning on graph, on top of existing DL frameworks.
http://dgl.ai
Apache License 2.0
13.56k stars 3.02k forks source link

ImportError: Cannot load Graphbolt C++ library #7450

Open AnnaVitali opened 5 months ago

AnnaVitali commented 5 months ago

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?

Rhett-Ying commented 5 months ago

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

AnnaVitali commented 5 months ago

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
Rhett-Ying commented 5 months ago

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

mfbalin commented 4 months ago

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

yfismine commented 3 months ago

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.

github-actions[bot] commented 2 months ago

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