pytorch_geometric: Please help me with OSError: libcusparse.so.10: cannot open shared object file: No such file or directory
❓ Questions & Help
this is the traceback
`Traceback (most recent call last): File “/home/yrwang/.local/lib/python3.6/site-packages/torch_sparse/init.py”, line 15, in <module> library, [osp.dirname(file)]).origin) File “/home/yrwang/.local/lib/python3.6/site-packages/torch/_ops.py”, line 106, in load_library ctypes.CDLL(path) File “/usr/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 “<stdin>”, line 1, in <module> File “/home/yrwang/.local/lib/python3.6/site-packages/torch_geometric/init.py”, line 2, in <module> import torch_geometric.nn File “/home/yrwang/.local/lib/python3.6/site-packages/torch_geometric/nn/init.py”, line 2, in <module> from .data_parallel import DataParallel File “/home/yrwang/.local/lib/python3.6/site-packages/torch_geometric/nn/data_parallel.py”, line 5, in <module> from torch_geometric.data import Batch File “/home/yrwang/.local/lib/python3.6/site-packages/torch_geometric/data/init.py”, line 1, in <module> from .data import Data File “/home/yrwang/.local/lib/python3.6/site-packages/torch_geometric/data/data.py”, line 7, in <module> from torch_sparse import coalesce File “/home/yrwang/.local/lib/python3.6/site-packages/torch_sparse/init.py”, line 23, in <module> raise OSError(e) OSError: libcusparse.so.10: cannot open shared object file: No such file or directory `
my cuda,cudnn is well installed :
nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Sun_Jul_28_19:07:16_PDT_2019 Cuda compilation tools, release 10.1, V10.1.243
my torch version:
>>> print(torch.__version__) 1.4.0
I use
`pip3 install torch-scatter==2.0.4+cu101 -f https://pytorch-geometric.com/whl/torch-1.4.0.html
pip3 install torch-sparse==0.6.1+cu101 -f https://pytorch-geometric.com/whl/torch-1.4.0.html
pip3 install torch-cluster==1.5.4+cu101 -f https://pytorch-geometric.com/whl/torch-1.4.0.html
pip3 install torch-spline-conv==1.2.0+cu101 -f https://pytorch-geometric.com/whl/torch-1.4.0.html
pip3 install torch-geometric` to install torch-geometric, but the problem occur, thanks for helping me
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 39 (12 by maintainers)
Ubuntu 18.04 This is my procedure to fix this bug.
find -name libcus*if you see “libcusparse.so.11”, continue following steps:
remove current cuda
sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*"sudo apt-get --purge remove "*nvidia*"install new cuda-10-2 5.
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin6.sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-6007.wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb8.sudo dpkg -i cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb9.sudo apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub10.sudo apt-get update11.sudo apt-get -y install cuda-10-2add CUDA to PATH
I had this problem when using conda. In my conda environment I had installed pytorch and torchvision with pip, but
pip uninstallpytorch and torchvision and then install them through conda instead solved the issueDear author, I made it. Thank you for your help. I downgrade CUDA to version 10.0, pytorch to version 1.4.0+cu100, torchvision to 0.5.0+cu100, and install torch-scatter torch-sparse torch-cluster torch-spline-conv from source. I tried to use version cu100 .whl to install them, but it doesn’t work. The commands I used are as follows:
pip3 install torch-scatter pip3 install torch-sparse pip3 install torch-cluster pip3 install torch-spline-conv pip3 install torch-geometric torch==1.4.0+cu100 torchvision==0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html
If someone need help, please contact me.
I think i found the answer… the reason is when you are inside the virtual environment, you can not open shared directory of cudatoolkit which is standing outside the virtual environment.
you can use sudo like
–> sudo python main.py
or just install cudatoolkit inside the virtual environment like
–> conda activate [your env] –> conda install -c anaconda cudatoolkit=10.1 –> python main.py
I used second way (installing cudatoolkit inside the environment) because “sudo python” uses “python” outside the virtual environment. So it’s not using the right version I want to use inside the virtual environment.
Had this problem on a cluster (cuda11, pytorch1.7).
export LD_LIBRARY_PATH=somewhere/cudacore/11.0.2/lib64solved the problem.