wheels segfault when on CUDA
See original GitHub issueExpected behavior and actual behavior.
Something is still wrong with the 1.8.5.post1 wheels: When importing from Shapely in a certain way, I later-on get segfaults when running code on the GPU.
(My guess is that somehow the way the post-release was done in https://github.com/shapely/shapely/issues/1567 is unusual and broken.)
Steps to reproduce the problem.
python -c "from shapely.geometry import Polygon; import torch; torch.randn(10).cuda()"
Segmentation fault (core dumped)
(This is the minimal example I could come up with. There are lots of real segfaults when doing other CUDA stuff with this version of Shapely.)
It goes away with importing all of Shapely.
It also goes away when installing 1.8.5.post1 from source (either pip install --no-binary shapely --force-reinstall shapely
or pip install --force-reinstall git+https://github.com/shapely/shapely@maint-1.8
).
Operating system
This is Linux with Python 3.8. (I tried different versions of Pytorch and CUDA toolkit – always the same.)
Shapely version and provenance
1.8.5.post1 wheel as published on PyPI
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top GitHub Comments
What I think is happening here is that
from shapely import *
is also not doing anything (for the same reason). So the reason that this “workaround” seems to work, is also because it just not yet imports anything, just likeimport shapely
(and in contrast withimport shapely.geometry
).So the issue is still that in general importing actual shapely functionality before importing torch gives segfaults.
Yes, the problem is that (in my experience) most errors only happen rarely, as they depend on so much from the data side. As soon as we have our data regression test ready, we’ll include prereleases in CI to get early warnings.