Skip to content
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

Error importing torch_scatter CPU wheel on machine with CUDA #229

Closed
aphedges opened this issue Aug 5, 2021 · 5 comments
Closed

Error importing torch_scatter CPU wheel on machine with CUDA #229

aphedges opened this issue Aug 5, 2021 · 5 comments

Comments

@aphedges
Copy link

aphedges commented Aug 5, 2021

I installed the CPU wheel because I only need to run torch_scatter on a machine without CUDA. As of #180, the code in __init__.py loads the cuda or cpu version of libraries depending on whether there is CUDA available. This ensures "CUDA wheels can now also operate on CPU-only devices" (from the 2.0.6 release notes), which I have no complaint about. However, this now prevents CPU wheels from operating on devices with CUDA support because it will try to load cuda libraries that are not present.

I don't know how to accomplish this, but it would be useful if it could detect it was compiled with cpu-only and not attempt to load from cuda.

@rusty1s
Copy link
Owner

rusty1s commented Aug 5, 2021

I pushed some changes to master which allow loading CPU wheels in a PyTorch CUDA installation, see here. Can you please try if this fixes your issues?

@aphedges
Copy link
Author

aphedges commented Aug 9, 2021

@rusty1s, thank you very much for the quick fix! It took me longer to get around to testing this than it took you to patch it. I can confirm that 778f624 fixes this issue.

@aphedges
Copy link
Author

aphedges commented Oct 6, 2021

This hasn't personally affected me yet, but I can see (from viewing the code) that the same bug still exists in torch-cluster, torch-spline-conv, and probably other related libraries. Should I make issues like this in their respective repositories?

@rusty1s
Copy link
Owner

rusty1s commented Oct 6, 2021

Yes, please go ahead :) I totally forgot about this, I'm sorry.

@aphedges
Copy link
Author

aphedges commented Oct 6, 2021

I have created issues for this bug in the 3 other repositories that look like they are affected by this. Some of your other libraries might also have it, but the code is structured too differently for me to tell from a quick read, and I don't use them, so I'm not going to go through the effort to test them out.

I don't think you need to apologize. It's a weird edge case I found, no one else seems to have reported the problem, and it's relatively easy to work around.

Given that the problem has been resolved here and is properly reported elsewhere, I am closing this issue.

@aphedges aphedges closed this as completed Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants