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.

Question about the cuda version.

See original GitHub issue

❓ Questions & Help

I use Arch Linux, and I looked up my cuda version through package management

pacman -Q cuda
cuda 11.0.3-1

However, when I run

python -c "import torch; print(torch.version.cuda)"
10.2

The cuda version is inconsistent. I think maybe pytorch automatically install a cuda version for me?

But when I import pytorch_geometric

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-2-3482cc0f8637> in <module>
      5 
      6 from tqdm.notebook import tqdm
----> 7 import torch_geometric
      8 
      9 from sklearn.model_selection import RepeatedKFold, RepeatedStratifiedKFold

~/.local/lib/python3.8/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

~/.local/lib/python3.8/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

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

~/.local/lib/python3.8/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

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

~/.local/lib/python3.8/site-packages/torch_sparse/__init__.py in <module>
     10         '_saint', '_sample', '_relabel'
     11 ]:
---> 12     torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
     13         library, [osp.dirname(__file__)]).origin)
     14 

~/.local/lib/python3.8/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 

/opt/miniconda3/lib/python3.8/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    371 
    372         if handle is None:
--> 373             self._handle = _dlopen(self._name, mode)
    374         else:
    375             self._handle = handle

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

So how to solve it? I have no problem when I was working with pytorch.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jmandivarapu1commented, Oct 2, 2020

working now. Here is the below commands followed Incase if anyone need

conda create --no-default-packages -n myenv python=3.7
conda activate myenv
conda install pytorch torchvision -c pytorch
pip install torch-scatter==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.6.0.html
pip install torch-sparse==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.6.0.html
pip install torch-cluster==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.6.0.html
pip install torch-spline-conv==latest+cu102 -f https://pytorch-geometric.com/whl/torch-1.6.0.html
pip install torch-geometric
Now I typed "find . -name "libcublas*" in my home directory

output gave me

./anaconda3/lib/libcublas.so.10.0
./anaconda3/lib/libcublas.so.10.0.130
./anaconda3/lib/libcublas.so
./anaconda3/envs/myenv/lib/libcublas.so.10
./anaconda3/envs/myenv/lib/libcublasLt.so.10
./anaconda3/envs/myenv/lib/libcublasLt.so
./anaconda3/envs/myenv/lib/libcublas.so.10.2.1.243
./anaconda3/envs/myenv/lib/libcublasLt.so.10.2.1.243
./anaconda3/envs/myenv/lib/libcublas.so
./anaconda3/pkgs/cudatoolkit-10.0.130-0/lib/libcublas.so.10.0
./anaconda3/pkgs/cudatoolkit-10.0.130-0/lib/libcublas.so.10.0.130
./anaconda3/pkgs/cudatoolkit-10.0.130-0/lib/libcublas.so
./anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10
./anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublasLt.so.10
./anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublasLt.so
./anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so.10.2.1.243
./anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublasLt.so.10.2.1.243
./anaconda3/pkgs/cudatoolkit-10.1.243-h6bb024c_0/lib/libcublas.so
./anaconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/libcublas.so.10
./anaconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/libcublasLt.so.10
./anaconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/libcublasLt.so
./anaconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/libcublasLt.so.10.2.2.89
./anaconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/libcublas.so.10.2.2.89
./anaconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/libcublas.so

Finally I added this to my .bash_profile and everything is working perfect

export LD_LIBRARY_PATH="$HOME/anaconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/:$PATH"
0reactions
jmandivarapu1commented, Oct 2, 2020

I got below and tried to set it as export LD_LIBRARY_PATH= ~/anaconda3/lib/ or export LD_LIBRARY_PATH=~/anaconda3/lib/libcublas.so.10.0.130.' Both didn’t work. Can you help in which of the below to set as path?

Screen Shot 2020-10-02 at 10 05 24 AM
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get the CUDA version? - Stack Overflow
You should find the CUDA Version highest CUDA version the installed driver supports on the top right corner of the comand's output.
Read more >
Question about cuda version : r/nvidia - Reddit
I just installed Ubuntu 18.04.1 on my PC and I am looking at tutorials of how to install NVIDIA drivers, cuda toolkit and...
Read more >
Question about the cuda version. · Issue #1679 - GitHub
Questions & Help I use Arch Linux, and I looked up my cuda version through package management pacman -Q cuda cuda 11.0.3-1 However, ......
Read more >
Let other applications use Matlab's version of the CUDA toolkit
The main problem is the GCC compiler version compatibility. CUDA toolkit 10.2 requires GCC 7, but Ubuntu 20.04 has as default GCC 9....
Read more >
CUDA FAQ | NVIDIA Developer
General Questions. Q: What is CUDA? CUDA® is a parallel computing platform and programming model that enables dramatic increases in computing performance by ......
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