Issue with dgl, torch 2.2 and cuda 118

Sorry to disturb you. I write because when I try to access the function dgl.DGLGraph.adj() I get the following error:

File “/home/rafael/.local/lib/python3.12/site-packages/dgl/heterograph.py”, line 3823, in adj from .sparse import spmatrix File “/home/rafael/.local/lib/python3.12/site-packages/dgl/sparse/init.py”, line 43, in load_dgl_sparse() File “/home/rafael/.local/lib/python3.12/site-packages/dgl/sparse/init.py”, line 40, in load_dgl_sparse raise ImportError(“Cannot load DGL C++ sparse library”) ImportError: Cannot load DGL C++ sparse library

I tried to reinstall other version but gives the same error always.

Sorry for the disturbance.

Solved I had to manually install the c++ files. Sorry for the time spent.

could you explain it more specific, i met this problem too.Thank you so much

Yes of course, in my case it was because it lacked c files that were inside the cudnn package in ubuntu. When I installed them it stopped giving that error. Also I reinstalled cusparse.

Another thing I tried was incorporate repositories of with previous packages of cuda like the ones from universe repositories.

I hope this helps, if not ask me again any time.

oh,thank you so much. and when i searched for this lacked c files,i could not find it. could you tell me what ways you find c files, do you find them in your computer or other ways

i changed torch version,and it did not occur this problem again,it just lacks some packings. i don’t know if this works .in this web site: Deep Graph Library (dgl.ai),it talks windows uses 2.0 2.1 torch version.so the following is my env:openhgnn2
torch 2.0.0+cu118
torchaudio 2.0.0+cu118
torchdata 0.6.0
torchvision 0.15.0+cu118
dgl 1.1.2+cu118

Yes so the missing c files are because some packages like cudnn and cu parse fails in the instalation if you include universe, to your repositories then it should be able to install those packages. (Note is not dgl but cuda issue in this case), what exactly did it tell you if I can get to know?

oh thank you. i think maybe it caused that dgl website said it did not keep windows version.maybe this is why i have this problem.

Ah it can be, I haven’t tried the installation on windows. Sorry for that, maybe I can take a look but I do not have too much idea to be honest.

oh, now i tryed to use linux,and it also occured this problem.Actually,i still do not know where i can load c++ file,and what specific name of this file? i can’t find it in website

And in this path: at /root/miniconda3/envs/opehgnn/lib/python3.11/site-packages/dgl/dgl_sparse/libdgl_sparse_pytorch_2.4.1so,it has this file

For me it did not work only including the cpp file because there were many dependencies. Is better is you find the package that contains it. For example c_sparse is in sudo apt get install cusparse. C_*** is normally in cu*** packages in dgl at least, from what I get to see.

Is not so much python dependency error I think