pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.31k stars 3.65k forks source link

OSError: libcusparse.so.10 #5218

Open faziii0 opened 2 years ago

faziii0 commented 2 years ago

šŸ› Describe the bug

Traceback (most recent call last): File "/home/fazal/anaconda3/envs/dev3/lib/python3.6/site-packages/torch_sparse/init.py", line 15, in library, [osp.dirname(file)]).origin) File "/home/fazal/anaconda3/envs/dev3/lib/python3.6/site-packages/torch/_ops.py", line 106, in load_library ctypes.CDLL(path) File "/home/fazal/anaconda3/envs/dev3/lib/python3.6/ctypes/init.py", line 348, in init self._handle = _dlopen(self._name, mode) OSError: libcusparse.so.10: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "track_gnn.py", line 20, in from tracker.multitracker import GNNTracker File "/home/fazal/Downloads/MOT/GSDT-main/src/lib/tracker/multitracker.py", line 8, in from models.model import create_model, load_model File "/home/fazal/Downloads/MOT/GSDT-main/src/lib/models/model.py", line 9, in from .networks.pose_dla_dcn import get_pose_net_with_gnn as get_dla_dcn_gnn File "/home/fazal/Downloads/MOT/GSDT-main/src/lib/models/networks/pose_dla_dcn.py", line 14, in from torch_geometric.nn import GATConv, GraphConv, GCNConv, AGNNConv, EdgeConv File "/home/fazal/anaconda3/envs/dev3/lib/python3.6/site-packages/torch_geometric/init.py", line 4, in import torch_geometric.data File "/home/fazal/anaconda3/envs/dev3/lib/python3.6/site-packages/torch_geometric/data/init.py", line 1, in from .data import Data File "/home/fazal/anaconda3/envs/dev3/lib/python3.6/site-packages/torch_geometric/data/data.py", line 3, in from torch_geometric.typing import OptTensor, NodeType, EdgeType File "/home/fazal/anaconda3/envs/dev3/lib/python3.6/site-packages/torch_geometric/typing.py", line 4, in from torch_sparse import SparseTensor File "/home/fazal/anaconda3/envs/dev3/lib/python3.6/site-packages/torch_sparse/init.py", line 23, in raise OSError(e) OSError: libcusparse.so.10: cannot open shared object file: No such file or directory

Environment

rusty1s commented 2 years ago

Can you share some more information about how you tried to install PyG? I am seeing that you are using PyTorch 1.4.0 on CUDA 10.1, so it might be best to directly install from wheels using this link: https://data.pyg.org/whl/torch-1.4.0%2Bcu101.html. Note that you may need to specify older versions for torch-sparse, torch-scatter, etc.

faziii0 commented 2 years ago

CUDA=$1 pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.4.0+${CUDA}z.html pip install --no-index torch-sparse -f https://pytorch-geometric.com/whl/torch-1.4.0+${CUDA}.html pip install --no-index torch-cluster -f https://pytorch-geometric.com/whl/torch-1.4.0+${CUDA}.html pip install --no-index torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.4.0+${CUDA}.html pip install torch-geometric

i use these commands

rusty1s commented 2 years ago

Try

pip install --no-index torch-scatter==2.0.4 torch-sparse==0.5.1 torch-cluster==1.5.2 torch-spline-conv==1.2.0 -f https://pytorch-geometric.com/whl/torch-1.4.0+cu101.html
faziii0 commented 2 years ago

I have tried but got the same error

Traceback (most recent call last): File "/home/fazal/anaconda3/envs/dev/lib/python3.6/site-packages/torch_sparse/init.py", line 13, in '_version', [osp.dirname(file)]).origin) File "/home/fazal/anaconda3/envs/dev/lib/python3.6/site-packages/torch/_ops.py", line 106, in load_library ctypes.CDLL(path) File "/home/fazal/anaconda3/envs/dev/lib/python3.6/ctypes/init.py", line 348, in init self._handle = _dlopen(self._name, mode) OSError: libcusparse.so.10: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "track_gnn.py", line 20, in from tracker.multitracker import GNNTracker File "/home/fazal/Downloads/MOT/GSDT-main/src/lib/tracker/multitracker.py", line 8, in from models.model import create_model, load_model File "/home/fazal/Downloads/MOT/GSDT-main/src/lib/models/model.py", line 9, in from .networks.pose_dla_dcn import get_pose_net_with_gnn as get_dla_dcn_gnn File "/home/fazal/Downloads/MOT/GSDT-main/src/lib/models/networks/pose_dla_dcn.py", line 14, in from torch_geometric.nn import GATConv, GraphConv, GCNConv, AGNNConv, EdgeConv File "/home/fazal/anaconda3/envs/dev/lib/python3.6/site-packages/torch_geometric/init.py", line 4, in import torch_geometric.data File "/home/fazal/anaconda3/envs/dev/lib/python3.6/site-packages/torch_geometric/data/init.py", line 1, in from .data import Data File "/home/fazal/anaconda3/envs/dev/lib/python3.6/site-packages/torch_geometric/data/data.py", line 3, in from torch_geometric.typing import OptTensor, NodeType, EdgeType File "/home/fazal/anaconda3/envs/dev/lib/python3.6/site-packages/torch_geometric/typing.py", line 4, in from torch_sparse import SparseTensor File "/home/fazal/anaconda3/envs/dev/lib/python3.6/site-packages/torch_sparse/init.py", line 22, in raise OSError(e) OSError: libcusparse.so.10: cannot open shared object file: No such file or directory

rusty1s commented 2 years ago

I am sorry to hear. Are you sure that nvcc --version refers to CUDA 10? Does libcusparse.so.10 exist in /usr/local/cuda/lib?

faziii0 commented 2 years ago

libcusparse.so.10.3.0.243 libcusparse.so.10

yes found those two

rusty1s commented 2 years ago

Super, can you add the root directory of these two files to the LD_LIBRARY_PATH environment variable?

faziii0 commented 2 years ago

in the virtual env or from home dir. Can you guide me little bit how can i do it. thanks

rusty1s commented 2 years ago

This would something like this

export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH

Note that you may adjust the path dependent on your CUDA installation. After that, libcusparse.so.10 should be picked up correctly.