-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined symbol: cusparseScsrgemm #1
Comments
I will look into this. In the meantime, you can clone torch-sparse locally, remove the spspmm import in torch_sparse/init.py and run python setup.py install. Sparse sparse matrix multiplication currently has no use case in torch_geometric, but this may change in the near future. |
Thank you for your help. The workaround works fine. Let me know, if you need more information. |
Does the file |
Yes it does, also a
|
Same problem here |
Could you both try out a possible fix to this problem? I guess cusparse is not linked to the nvcc call. Please add -lcusparse as compiler argument to nvcc in setup.py (example can be found here). |
Just tried it but the same error remains. However the path to the .so library changed:
Modified setup.py:
|
I have the same issue. The suggested workaround gets me running though. |
Which one do you mean? Adding |
Removing the |
Please modify if torch.cuda.is_available():
ext_modules += [
CUDAExtension(
'spspmm_cuda',
['cuda/spspmm.cpp', 'cuda/spspmm_kernel.cu'],
extra_link_args=['-l', 'cusparse'],
)
]
cmdclass['build_ext'] = BuildExtension This should hopefully work now (borrowed from here). |
Hi, just tried this. Not sure if it is a fix, as I'm running into another problem but this time with torch_scatter:
Reproducible for me using following commands (everything installs fine): #!/bin/bash
pipenv --rm
rm Pipfile Pipfile.lock
pipenv --python 3.6
pipenv lock --clear
export PATH=/opt/cuda/bin:$PATH
export CPATH=/opt/cuda/include
pipenv install http://download.pytorch.org/whl/cu92/torch-0.4.1-cp36-cp36m-linux_x86_64.whl
pipenv install torchvision
pipenv install cffi
pipenv install torch-scatter
pipenv install -e --dev ../pytorch_sparse
pipenv install torch-cluster
pipenv install torch-spline-conv
pipenv install torch-geometric
pipenv run python -c "from torch_sparse import spmm" |
Ok, cool :) |
In my case, I still get the same error as before.
|
So I already tried for python 3.7 and there it works fine. pipenv --python 3.7
export path=/opt/cuda/bin:$path
export cpath=/opt/cuda/include
pipenv install http://download.pytorch.org/whl/cu92/torch-0.4.1.post2-cp37-cp37m-linux_x86_64.whl
pipenv install torchvision
pipenv install cffi
pipenv install torch-scatter
pipenv install -e --dev ../pytorch_sparse
pipenv run python -c "from torch_sparse import spmm" |
Just to confirm, you did uncomment the |
Oh yeah you are right, I forgot to uncomment the |
Ok. Sorry to make that mistake. Installing scatter from clone removes my previous error. However the cusparse error remains for me as well. Edit: That is for python 3.6 Edit: and for 3.7
|
I could reproduce the bug on another machine and hopefully fixed it. Please checkout master and verify, so we can finally close this issue :) |
Pulled from master and ran:
However I still get the same error, it's the same for all the tests:
|
I could get along a bit more but when I execute the example given in the README:
I get the error :
The complete log is available here |
Yes, |
I wonder if this issue has been fixed besides the workaround? I tried the updated master but still got the undefined cusparseScsrgemm error. Thanks!
|
It would be best if someone having this error could evaluate differing command options of -lsparse to identify the error and send a pull request. Not much else I can do :( |
I tried the different options you mentioned so far. They did not work for me yet. If you have a list of other options I could try (or know where I could get the list of possible options), I will try them all and let you know. |
I had the same problem (python 3.7) and installing from master seems to have fixed it (could run all the examples here, with values as float for @shagunsodhani example). Thank you for a great project with amazing code quality! |
Hi, |
The possible solutions seem to be to add: CUDAExtension(
...,
extra_link_args=[x],
) or CUDAExtension(
...,
extra_compile_args={'nvcc': [x]}.
}) where Can you test these with |
I tested this on 5836042. Let me know if I should be testing on any other commit as well. |
Before I accept the pull request, can you test passing both, CUDAExtension(
...,
extra_link_args=['-lcusparse', '-l', 'cusparse'],
) as using |
Sure I can do that. I have another request. Could you suggest me a minimal test to ensure that this particular issue is fixed? I did check it with the previous commit's test cases but I am not super confident that those tests are sufficient. |
If the spspmm test runs for you, the issue is fixed. |
Fixed 👍 |
Updated |
Hi,
I'm trying to get the torch-geometry package to work and everything installs just fine.
But I'm getting following error during import from torch_sparse:
For me that can be reproduced with:
More info:
I'm not sure if this is a problem on my side or not. Would appreciate your help.
The text was updated successfully, but these errors were encountered: