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

[BUG] cubic_spline throws cudaErrorInvalidAddressSpace error #319

Closed
drabastomek opened this issue Oct 29, 2020 · 3 comments · Fixed by #411
Closed

[BUG] cubic_spline throws cudaErrorInvalidAddressSpace error #319

drabastomek opened this issue Oct 29, 2020 · 3 comments · Fixed by #411
Labels
bug Something isn't working

Comments

@drabastomek
Copy link

drabastomek commented Oct 29, 2020

Describe the bug
A clear and concise description of what the bug is.

Steps/Code to reproduce bug
I tried to replicate the behavior from the docs

t = cudf.Series(np.repeat(cp.arange(100), 1000)).astype('float32')
y = cudf.Series(np.random.random(100*1000)).astype('float32')

prefix_sum = cudf.Series(cp.arange(1000)*100).astype('int32')

new_samples = cudf.Series(
    np.repeat(np.linspace(0, 100, 1000), 1000)
).astype('float32')

curve = cuspatial.CubicSpline(t, y, prefixes=prefix_sum)
new_points = curve(new_samples, prefix_sum*10)

Full stack:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-2-5745a70b247c> in <module>
      7 
      8 curve = cuspatial.CubicSpline(t, y, prefixes=prefix_sum)
----> 9 new_points = curve(new_samples, prefix_sum*10)
     10 

/opt/conda/envs/rapids/lib/python3.7/site-packages/cuspatial/core/interpolate.py in __call__(self, coordinates, groups)
    175                 ).astype("int32")
    176             result = _cubic_spline_fit(
--> 177                 coordinates, self.groups, self.prefix, self.t, self.c
    178             )
    179             return Series(result)

/opt/conda/envs/rapids/lib/python3.7/site-packages/cuspatial/core/interpolate.py in _cubic_spline_fit(points, points_ids, prefixes, original_t, c)
     28     original_t_c = original_t._column
     29     result_column = cubicspline_interpolate(
---> 30         points_c, points_ids_c, prefixes_c, original_t_c, c
     31     )
     32     return result_column

cuspatial/_lib/interpolate.pyx in cuspatial._lib.interpolate.cubicspline_interpolate()

cuspatial/_lib/interpolate.pyx in cuspatial._lib.interpolate.cubicspline_interpolate()

RuntimeError: for_each: failed to synchronize: cudaErrorInvalidAddressSpace: operation not supported on global/shared address space

Expected behavior
new_points contains interpolated points.

Environment details (please complete the following information):

  • Environment location: Docker
  • Method of cuSpatial install: Docker
    • Stable git pull from rapidsai/rapidsai, v 0.16, CUDA 11, Python 3.7.8
@drabastomek drabastomek added Needs Triage Need team to review and classify bug Something isn't working labels Oct 29, 2020
@drabastomek
Copy link
Author

drabastomek commented Dec 10, 2020

@zhangjianting I just tested in 0.17 and this call still throws cudaErrorInvalidAddressSpace. If I encounter this once, looks like the whole RMM context gets corrupted as any subsequent run of any cell throws the same error

---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)
<ipython-input-3-7dae3700009f> in <module>
----> 1 ring, poly_idx, polygons = cuspatial.io.shapefile.read_polygon_shapefile('../data/gadm36_USA_1.shp')
      2 polygons = polygons.rename(columns={'x': 'longitude', 'y': 'latitude'})
      3 polygons['line'] = cp.random.randint(10,240, len(polygons))
      4 polygons = polygons.query(
      5         'longitude > -130'

/opt/conda/envs/rapids/lib/python3.8/site-packages/cuspatial/io/shapefile.py in read_polygon_shapefile(filename)
     31                 y-components of each polygon's points
     32     """
---> 33     result = cpp_read_polygon_shapefile(filename)
     34     f_pos = Series(result[0], name="f_pos")
     35     r_pos = Series(result[1], name="r_pos")

cuspatial/_lib/shapefile_reader.pyx in cuspatial._lib.shapefile_reader.read_polygon_shapefile()

cuspatial/_lib/shapefile_reader.pyx in cuspatial._lib.shapefile_reader.read_polygon_shapefile()

MemoryError: std::bad_alloc: CUDA error at: /opt/conda/envs/rapids/include/rmm/mr/device/cuda_memory_resource.hpp:69: cudaErrorInvalidAddressSpace operation not supported on global/shared address space

In this example I read a Shape-file that, if I run it before I run the cubic_spline, reads the data without problems.

cc: @kkraus14 @harrism

@kkraus14 kkraus14 removed the Needs Triage Need team to review and classify label Dec 10, 2020
@github-actions
Copy link

This issue has been marked stale due to no recent activity in the past 30d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be marked rotten if there is no activity in the next 60d.

@github-actions github-actions bot added the stale label Feb 16, 2021
@github-actions
Copy link

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants