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.

Cannot import torch-spline-conv when installed from pip wheel in Torch 1.9.0 and CUDA 11.1

See original GitHub issue

📚 Installation

I had been able install all pytorch-geometric related packages via pip prior to the new 1.7.1 release and it all works well. However, with the new release, pip install seems to skip “building the wheel” for torch-spline-conv, but still give a successful installation. When importing the torch-spline-conv, it then gives this error:

—> 46 from torch_geometric.nn import MetaPath2Vec

/opt/anaconda3/lib/python3.7/site-packages/torch_geometric/nn/init.py in <module> 3 from .data_parallel import DataParallel 4 from .reshape import Reshape ----> 5 from .conv import * # noqa 6 from .norm import * # noqa 7 from .glob import * # noqa

/opt/anaconda3/lib/python3.7/site-packages/torch_geometric/nn/conv/init.py in <module> 22 from .point_conv import PointConv 23 from .gmm_conv import GMMConv —> 24 from .spline_conv import SplineConv 25 from .nn_conv import NNConv, ECConv 26 from .cg_conv import CGConv

/opt/anaconda3/lib/python3.7/site-packages/torch_geometric/nn/conv/spline_conv.py in <module> 12 13 try: —> 14 from torch_spline_conv import spline_basis, spline_weighting 15 except ImportError: 16 spline_basis = None

/opt/anaconda3/lib/python3.7/site-packages/torch_spline_conv/init.py in <module> 10 for library in [‘_version’, ‘_basis’, ‘weighting’]: 11 torch.ops.load_library(importlib.machinery.PathFinder().find_spec( —> 12 f’{library}{suffix}’, [osp.dirname(file)]).origin) 13 14 if torch.cuda.is_available(): # pragma: no cover

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

/opt/anaconda3/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: /lib64/libm.so.6: version `GLIBC_2.27’ not found (required by /opt/anaconda3/lib/python3.7/site-packages/torch_spline_conv/_basis_cuda.so)

Environment

  • OS: Centos 7
  • Python version: 3.7
  • PyTorch version: 1.9
  • CUDA/cuDNN version: 11.1
  • GCC version: 6.3.0
  • How did you try to install PyTorch Geometric and its extensions (wheel, source): wheel
  • Any other relevant information:

CUDA=“cu111” pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.9.0+${CUDA}.html

Checklist

  • 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.
  • I do have multiple CUDA versions on my machine.

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
mariuaascommented, Apr 5, 2022

FYI, it seems that this issue persists with torch 1.11.0, however uninstalling torch-spline-conv solves the problem.

1reaction
saiden89commented, Jun 22, 2021

I’d like to reopen this issue since building from source doesn’t fix the underlying problem of the wheels. It doesn’t seem to be a CUDA version specific issue, since I’ve experienced the same with CUDA 10.2. Moreover, I’ve tested it with several python versions, from 3.7 to 3.9, but without success.

Reproducibility

Pytorch and dependencies installed with conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

torch-spline-conv installed with:

❯ pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html

Looking in links: https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
Collecting torch-spline-conv
  Downloading https://pytorch-geometric.com/whl/torch-1.9.0%2Bcu102/torch_spline_conv-1.2.1-cp39-cp39-linux_x86_64.whl (368 kB)
     |████████████████████████████████| 368 kB 29.4 MB/s 
Installing collected packages: torch-spline-conv
Successfully installed torch-spline-conv-1.2.1

Python output

❯ python
Python 3.9.5 | packaged by conda-forge | (default, Jun 19 2021, 00:32:32) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch_spline_conv
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "envs/test39/lib/python3.9/site-packages/torch_spline_conv/__init__.py", line 11, in <module>
    torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
  File "envs/test39/lib/python3.9/site-packages/torch/_ops.py", line 104, in load_library
    ctypes.CDLL(path)
  File "envs/test39/lib/python3.9/ctypes/__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by envs/test39/lib/python3.9/site-packages/torch_spline_conv/_basis_cuda.so)

The bug only shows up in a CUDA capable machine. Importing the module on a machine without CUDA support works fine. I’ll be happy to report additional details as well as submit this issue on the official torch-spline-conv repository.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot import torch-spline-conv when installed from pip ...
Installation I had been able install all pytorch-geometric related packages via pip prior to the new 1.7.1 release and it all works well....
Read more >
Installation — pytorch_geometric documentation
Installation via Pip Wheels · Ensure that at least PyTorch 1.12.0 is installed: · Find the CUDA version PyTorch was installed with: python...
Read more >
How does one pip install torch 1.9.x with cuda 11.1 when ...
Not sure why this is the case but it seems once I got a node to run the installs (with a gpu) the...
Read more >
torch-geometric - PyPI
import torch from torch import Tensor from torch_geometric.nn import GCNConv from torch_geometric.datasets import Planetoid dataset = Planetoid(root='.
Read more >
Install PyTorch on Jetson Nano - Q-engineering
A thorough guide on how to install PyTorch 1.8.1 on your Jetson Nano with CUDA support. Build with pip or from source code...
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