Skip to content

Instantly share code, notes, and snippets.

@epifanio
Created April 24, 2023 18:58
Show Gist options
  • Save epifanio/61a8a31b524f7811f0493be9f7a094be to your computer and use it in GitHub Desktop.
Save epifanio/61a8a31b524f7811f0493be9f7a094be to your computer and use it in GitHub Desktop.
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
Cell In[13], line 4
2 x_pnt = points[:, 0]
3 y_pnt = points[:, 1]
----> 4 points = cuspatial.core.geoseries.GeoSeries.from_points_xy(points.flatten())
6 x_poly = polygon[:, 0]
7 y_poly = polygon[:, 1]
File /opt/conda/envs/all_cuda-118_arch-x86_64/lib/python3.10/site-packages/cuspatial/core/geoseries.py:631, in GeoSeries.from_points_xy(cls, points_xy)
616 @classmethod
617 def from_points_xy(cls, points_xy):
618 """Construct a GeoSeries of POINTs from an array of interleaved xy
619 coordinates.
620
(...)
629 A GeoSeries made of the points.
630 """
--> 631 return cls(GeoColumn._from_points_xy(as_column(points_xy)))
File /opt/conda/envs/all_cuda-118_arch-x86_64/lib/python3.10/site-packages/cuspatial/core/_column/geocolumn.py:148, in GeoColumn._from_points_xy(cls, points_xy)
137 point_col = _xy_as_variable_sized_list(points_xy)
138 num_points = len(point_col)
140 meta = GeoMeta(
141 {
142 "input_types": as_column(
143 cp.full(
144 num_points, Feature_Enum.POINT.value, dtype=cp.int8
145 )
146 ),
147 "union_offsets": as_column(
--> 148 cp.arange(num_points, dtype=cp.int32)
149 ),
150 }
151 )
153 coord_dtype = points_xy.dtype
154 return cls(
155 (
156 cudf.Series(point_col),
(...)
167 meta,
168 )
File /opt/conda/envs/all_cuda-118_arch-x86_64/lib/python3.10/site-packages/cupy/_creation/ranges.py:55, in arange(start, stop, step, dtype)
52 else:
53 return cupy.array([start], dtype=numpy.bool_)
---> 55 ret = cupy.empty((size,), dtype=dtype)
56 typ = numpy.dtype(dtype).type
57 _arange_ufunc(typ(start), typ(step), ret, dtype=dtype)
File /opt/conda/envs/all_cuda-118_arch-x86_64/lib/python3.10/site-packages/cupy/_creation/basic.py:22, in empty(shape, dtype, order)
7 def empty(shape, dtype=float, order='C'):
8 """Returns an array without initializing the elements.
9
10 Args:
(...)
20
21 """
---> 22 return cupy.ndarray(shape, dtype, order=order)
File cupy/_core/core.pyx:136, in cupy._core.core.ndarray.__new__()
File cupy/_core/core.pyx:224, in cupy._core.core._ndarray_base._init()
File cupy/cuda/memory.pyx:742, in cupy.cuda.memory.alloc()
File /opt/conda/envs/all_cuda-118_arch-x86_64/lib/python3.10/site-packages/rmm/allocators/cupy.py:37, in rmm_cupy_allocator(nbytes)
34 raise ModuleNotFoundError("No module named 'cupy'")
36 stream = Stream(obj=cupy.cuda.get_current_stream())
---> 37 buf = librmm.device_buffer.DeviceBuffer(size=nbytes, stream=stream)
38 dev_id = -1 if buf.ptr else cupy.cuda.device.get_device_id()
39 mem = cupy.cuda.UnownedMemory(
40 ptr=buf.ptr, size=buf.size, owner=buf, device_id=dev_id
41 )
File device_buffer.pyx:85, in rmm._lib.device_buffer.DeviceBuffer.__cinit__()
MemoryError: std::bad_alloc: out_of_memory: CUDA error at: /opt/conda/envs/all_cuda-118_arch-x86_64/include/rmm/mr/device/cuda_memory_resource.hpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment