pytorch_spline_conv icon indicating copy to clipboard operation
pytorch_spline_conv copied to clipboard

CUDA libraries not generated when building pytorch-spline-conv

Open lancioni opened this issue 2 years ago • 3 comments

I cannot manage to generate CUDA libraries when building pytorch-spline-conv. I am currently using torch-1.12.0+cu113.html under Ubuntu 18.04, python 3.7.5 and pip. I tried both installing from -f https://data.pyg.org/whll/torch-1.12.0+cu113.html and with plain pip install. All other torch and torch-geometric packages look to work just fine. In /usr/local/lib/python3.7/dist-packages/torch_spline_conv I find only _basis_cpu.so _version_cpu.so _weighting_cpu.so, which makes init.py give an error, because of suffix = 'cuda' if torch.cuda.is_available() else 'cpu' instruction. How can I force pytorch-spline-conv to build .cuda libraries?

Thank you,

Giuliano

lancioni avatar Jul 09 '22 10:07 lancioni

There is a typo in the URL (should be https://data.pyg.org/whl/torch-1.12.0+cu113.html) - might this explain your issues? If you download one of the wheels, you can see that the _cuda.so files indeed exist.

rusty1s avatar Jul 09 '22 10:07 rusty1s

Basically, since pip installations does not put _cuda.so files into the /usr/local/lib/python3.7/dist-packages/torch_spline_conv folder, when I try to import torch_spline_conv I get the error:

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.7/dist-packages/torch_spline_conv/init.py", line 12, in f'{library}_{suffix}', [osp.dirname(file)]).origin) AttributeError: 'NoneType' object has no attribute 'origin'

Basically, the _cuda.so files are not copied onto the destination folder.

lancioni avatar Jul 09 '22 10:07 lancioni

I copied the _cuda.so libraries from the .whl file and it seems to work just fine.

lancioni avatar Jul 09 '22 10:07 lancioni

I am running into this issue too, but only if I install torch-spline-conv via pipfile?

[[source]]
name = "pytorch-geometric"
url = "https://data.pyg.org/whl/torch-1.12.1+cu116.html"
verify_ssl = true

# pytorch geometric stuff
torch-scatter = {index= "pytorch-geometric"}
torch-sparse = {index= "pytorch-geometric"}
torch-cluster = {index= "pytorch-geometric"}
torch-spline-conv = {index= "pytorch-geometric"}
torch-geometric = {index= "pytorch-geometric"}

_cuda.so stuff is not built for only torch-spline-conv...this is what's inside the package __init__.py __pycache__ _basis_cpu.so _version_cpu.so _weighting_cpu.so basis.py conv.py weighting.py but if i do: pip install --force-reinstall torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.12.1+cu116.html then _cuda stuff shows up: __init__.py __pycache__ _basis_cpu.so _basis_cuda.so _version_cpu.so _version_cuda.so _weighting_cpu.so _weighting_cuda.so basis.py conv.py weighting.py

At a loss for why this is happening...

Abhishaike avatar Nov 08 '22 21:11 Abhishaike

No expert on pipfile but it looks like the url is not used. Can you confirm?

rusty1s avatar Nov 13 '22 18:11 rusty1s

I think so. Honestly, I didn't try much recently, because I started using torch from docker images and everything looks fine there. So chances are, something went wrong on my specific Python configuration, probably due to previous CUDA-related installations.

lancioni avatar Nov 14 '22 09:11 lancioni

This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?

github-actions[bot] avatar May 14 '23 01:05 github-actions[bot]