question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSError: libcusparse.so.11: cannot open shared object file: No such file or directory

See original GitHub issue

📚 Installation


Error occurs when I run from torch_geometric.data import Data

OSError Traceback (most recent call last) <ipython-input-1-767c8a8c19d6> in <module> 1 import torch ----> 2 from torch_geometric.data import Data

~/anaconda3/envs/pytorch_env/lib/python3.7/site-packages/torch_geometric/init.py in <module> 1 from .debug import is_debug_enabled, debug, set_debug ----> 2 import torch_geometric.nn 3 import torch_geometric.data 4 import torch_geometric.datasets 5 import torch_geometric.transforms

~/anaconda3/envs/pytorch_env/lib/python3.7/site-packages/torch_geometric/nn/init.py in <module> 1 from .meta import MetaLayer ----> 2 from .data_parallel import DataParallel 3 from .reshape import Reshape 4 from .conv import * # noqa 5 from .norm import * # noqa

~/anaconda3/envs/pytorch_env/lib/python3.7/site-packages/torch_geometric/nn/data_parallel.py in <module> 3 4 import torch ----> 5 from torch_geometric.data import Batch 6 7

~/anaconda3/envs/pytorch_env/lib/python3.7/site-packages/torch_geometric/data/init.py in <module> ----> 1 from .data import Data 2 from .batch import Batch 3 from .dataset import Dataset 4 from .in_memory_dataset import InMemoryDataset 5 from .dataloader import DataLoader, DataListLoader, DenseDataLoader

~/anaconda3/envs/pytorch_env/lib/python3.7/site-packages/torch_geometric/data/data.py in <module> 6 import torch 7 import torch_geometric ----> 8 from torch_sparse import coalesce, SparseTensor 9 from torch_geometric.utils import (contains_isolated_nodes, 10 contains_self_loops, is_undirected)

~/anaconda3/envs/pytorch_env/lib/python3.7/site-packages/torch_sparse/init.py in <module> 11 ]: 12 torch.ops.load_library(importlib.machinery.PathFinder().find_spec( —> 13 library, [osp.dirname(file)]).origin) 14 15 if torch.cuda.is_available() and torch.version.cuda: # pragma: no cover

~/anaconda3/envs/pytorch_env/lib/python3.7/site-packages/torch/_ops.py in load_library(self, path) 103 # static (global) initialization code in order to register custom 104 # operators with the JIT. –> 105 ctypes.CDLL(path) 106 self.loaded_libraries.add(path) 107

~/anaconda3/envs/pytorch_env/lib/python3.7/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error) 362 363 if handle is None: –> 364 self._handle = _dlopen(self._name, mode) 365 else: 366 self._handle = handle

OSError: libcusparse.so.11: cannot open shared object file: No such file or directory

Environment

  • OS: Ubuntu 18.04
  • Python version: 3.7.6
  • PyTorch version: 1.7.1
  • CUDA/cuDNN version: 11.0
  • GCC version: 7.5.0
  • How did you try to install PyTorch Geometric and its extensions (wheel, source): Binaries
  • Any other relevant information: followed this guide Installation via Binaries

Checklist

  • [y] I followed the installation guide.
  • I cannot find my error message in the FAQ.
  • I set up CUDA correctly and can compile CUDA code via nvcc. <— not sure how to do this, but I have been running pytorch on GPU fine all this while
  • I do have multiple CUDA versions on my machine. <— not sure how to check but when I run python -c "import torch; print(torch.__version__)" returns 1.7.1+cu110 and python -c "import torch; print(torch.version.cuda)" returns 11.0

Additional context

Installed via:

pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.7.0+cu110.html
pip install --no-index torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.0+cu110.html
pip install --no-index torch-cluster -f https://pytorch-geometric.com/whl/torch-1.7.0+cu110.html
pip install --no-index torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.7.0+cu110.html
pip install torch-geometric

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:26 (10 by maintainers)

github_iconTop GitHub Comments

11reactions
rusty1scommented, Jan 25, 2021

You can try to add the minconda CUDA libs installed by PyTorch to $LD_LIBRARY_PATH, e.g.:

export LD_LIBRARY_PATH="your_miniconda_path/lib:$LD_LIBRARY_PATH"

This folder should contain libcusparse.so.11.

4reactions
xuhongzuocommented, Aug 23, 2022

I have write it “export PATH=/usr/local/cuda-11.0/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib64:$LD_LIBRARY_PATH” in ~/.bashrc, but it doesn’t work, it’s so weird.

However, I can use geometric in terminal, but can’t pycharm

@smiles724 @zilangch @domilay I found a solution in Pycharm. It can be solved by manually adding LIBRARY_PATH in the run/debug configurations. image

Read more comments on GitHub >

github_iconTop Results From Across the Web

libcusparse.so.10.0: cannot open shared object file: No such ...
Your current ThunderGBM install might not be compatible with the CUDA version that you have. You can check your version via: echo ...
Read more >
有效解决OSError: libcusparse.so.11: cannot open shared ...
有效解决OSError: libcusparse.so.11: cannot open shared object file: No such file or directory. 华为云开发者联盟 该内容已被华为云开发者联盟社区收录,社区免费抽大奖🎉,赢华为平板、Switch等好礼!
Read more >
成功解决OSError: libcusparse.so.11: cannot open shared ...
成功解决OSError: libcusparse.so.11: cannot open shared object file: No such file or directory ; 3.8 conda activate BIONIC ; pip install torch- ...
Read more >
OSError: libcusparse.so.11: cannot open shared object file
11 : cannot open shared object file: No such file or directory のメモ. sell. PyTorch-geometric,Ubuntu22.04. pytorch_geometric を 使ったときに、
Read more >
Jetson_voice docker image run gives "OSError: libcurand.so ...
There are a TON of these “OSError: libcurand.so.10: cannot open shared object file: No such file or directory” reported on the forums.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found