Skip to content

[BUG] wp.Mesh constructor fails with "Warp CUDA error 101: invalid device ordinal" #960

@liblaf

Description

@liblaf

Bug Description

When creating a wp.Mesh object from wp.arrays, the constructor fails with a series of CUDA errors, including "invalid device ordinal" and "out of memory". This happens even on a system with a single, correctly identified GPU.

Steps to Reproduce:

The following minimal code snippet consistently reproduces the error:

import pyvista as pv
import warp as wp

# Initialize Warp
wp.init()

# Create a PyVista mesh
mesh_pv: pv.PolyData = pv.Box(quads=False)

# Convert mesh data to Warp arrays
points: wp.array = wp.from_numpy(mesh_pv.points, dtype=wp.vec3)
indices: wp.array = wp.from_numpy(mesh_pv.regular_faces.flatten(), dtype=wp.int32)

print(f"{points=}")
print(f"{indices=}")

# Create a Warp mesh (this is where the error occurs)
mesh_wp: wp.Mesh = wp.Mesh(points=points, indices=indices)

print(f"{mesh_wp=}")
Error Output (click to expand)
Warp 1.9.0 initialized:
   CUDA Toolkit 12.8, Driver 13.0
   Devices:
     "cpu"      : "CPU"
     "cuda:0"   : "NVIDIA GeForce GTX 1080 Ti" (11 GiB, sm_61, mempool enabled)
   Kernel cache:
     /home/liblaf/.cache/warp/1.9.0
points=array(shape=(8,), dtype=vec3f)
indices=array(shape=(36,), dtype=int32)
Warp CUDA error 101: invalid device ordinal (in function scan_device, /builds/omniverse/warp/warp/native/scan.cu:35)
Warp CUDA error 209: no kernel image is available for execution on the device (in function scan_device, /builds/omniverse/warp/warp/native/scan.cu:44)
Warp CUDA error 101: invalid device ordinal (in function radix_sort_reserve_internal, /builds/omniverse/warp/warp/native/sort.cu:49)
Warp CUDA error 2: out of memory (in function wp_alloc_device_async, /builds/omniverse/warp/warp/native/warp.cu:611)
Warp CUDA error 101: invalid device ordinal (in function radix_sort_pairs_device, /builds/omniverse/warp/warp/native/sort.cu:92)
mesh_wp=<warp.types.Mesh object at 0x7cc6e160b770>

System Information

  • Warp: 1.9.0
  • Python: 3.13.7
  • OS: linux-64

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions