pytorch_spline_conv: Cannot import torch-spline-conv when installed from pip wheel in Torch 1.9.0

As discussed here, installing torch-spline-conv via the provided wheels fails with OSError: /lib64/libm.so.6: version 'GLIBC_2.27' not found . We know that:

  • the issue is unaffected by the cudatoolkit version
  • the issue is unaffected by python version
  • the issue triggers only with torch 1.9.0
  • the issue triggers only on systems with CUDA acceleration.
  • recompiling solves the issue

As per @rusty1s suggestion, adding a print statement in torch_spline_conv/__init__.py between lines 10 and 11, produces the following output:

>>> import torch_spline_conv
_version
_basis
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".conda/envs/test39/lib/python3.9/site-packages/torch_spline_conv/__init__.py", line 12, in <module>
    torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
  File ".conda/envs/test39/lib/python3.9/site-packages/torch/_ops.py", line 104, in load_library
    ctypes.CDLL(path)
  File ".conda/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 .conda/envs/test39/lib/python3.9/site-packages/torch_spline_conv/_basis_cuda.so)

Meaning that the culprit is _basis_cuda, as also mentioned in the last line of the error. Further examination using diff between the recompiled (working) package in the pytorch conda environment and the original one the test39 environment produced the following output:

❯ diff -qr envs/test39/lib/python3.9/site-packages/torch_spline_conv envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/_basis_cpu.so and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/_basis_cpu.so differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/_basis_cuda.so and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/_basis_cuda.so differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/__pycache__/basis.cpython-39.pyc and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/__pycache__/basis.cpython-39.pyc differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/__pycache__/conv.cpython-39.pyc and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/__pycache__/conv.cpython-39.pyc differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/__pycache__/__init__.cpython-39.pyc and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/__pycache__/__init__.cpython-39.pyc differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/__pycache__/weighting.cpython-39.pyc and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/__pycache__/weighting.cpython-39.pyc differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/_version_cpu.so and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/_version_cpu.so differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/_version_cuda.so and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/_version_cuda.so differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/_weighting_cpu.so and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/_weighting_cpu.so differ
Files envs/test39/lib/python3.9/site-packages/torch_spline_conv/_weighting_cuda.so and envs/pytorch/lib/python3.9/site-packages/torch_spline_conv/_weighting_cuda.so differ

I don’t know enough about the subject to make wild speculations, but could it be possible that the provided wheels were compiled in a different environment than the one they’re supposed to work in?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

Can you try to install via:

pip uninstall torch-spline-conv
pip install https://s3.eu-central-1.amazonaws.com/pytorch-geometric.com/whl/torch-1.9.0%2Bcu102/torch_spline_conv-1.2.1-cp39-cp39-linux_x86_64.whl

Actually I was able to pip install this successfully once I loaded the right cuda environment variables. Thanks!

FYI you may not require torch_spline_conv; I solved this issue by pip uninstall torch-spline-conv so the import does not search for the package