NVIDIA / warp

A Python framework for high performance GPU simulation and graphics
https://nvidia.github.io/warp/
Other
4.27k stars 243 forks source link

[BUG] I am having numpy 2.1.3 and this error raise. Is warp not support for numpy 2.x? #337

Closed louhz closed 2 weeks ago

louhz commented 2 weeks ago

Bug Description

ValueError: Unable to avoid copy while creating an array as requested. If using np.array(obj, copy=False) replace it with np.asarray(obj) to allow a copy when needed (no behavior change in NumPy 1.x). For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/lou/Desktop/warp_simulation/warp/test/test.py", line 18, in points = wp.array(np.random.rand(num_points, 3), dtype=wp.vec3) File "/home/lou/miniconda3/envs/warp/lib/python3.13t/site-packages/warp/types.py", line 1651, in init self._init_from_data(data, dtype, shape, device, copy, pinned)


  File "/home/lou/miniconda3/envs/warp/lib/python3.13t/site-packages/warp/types.py", line 1753, in _init_from_data
    raise RuntimeError(f"Failed to convert input data to an array with type {npdtype}: {e}") from e
RuntimeError: Failed to convert input data to an array with type <class 'numpy.float32'>: Unable to avoid copy while creating an array as requested.
If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x).
For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.

### System Information

_No response_
louhz commented 2 weeks ago

Sorry, i did not notice that i am using python 3.13, after go back to python 3.12 everything works! I did not notice the recent updates