warp-lang 0.11.0__py3-none-manylinux2014_x86_64.whl → 1.0.0__py3-none-manylinux2014_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of warp-lang might be problematic. Click here for more details.

Files changed (170) hide show
  1. warp/__init__.py +8 -0
  2. warp/bin/warp-clang.so +0 -0
  3. warp/bin/warp.so +0 -0
  4. warp/build.py +7 -6
  5. warp/build_dll.py +70 -79
  6. warp/builtins.py +10 -6
  7. warp/codegen.py +51 -19
  8. warp/config.py +7 -8
  9. warp/constants.py +3 -0
  10. warp/context.py +948 -245
  11. warp/dlpack.py +198 -113
  12. warp/examples/assets/bunny.usd +0 -0
  13. warp/examples/assets/cartpole.urdf +110 -0
  14. warp/examples/assets/crazyflie.usd +0 -0
  15. warp/examples/assets/cube.usda +42 -0
  16. warp/examples/assets/nv_ant.xml +92 -0
  17. warp/examples/assets/nv_humanoid.xml +183 -0
  18. warp/examples/assets/quadruped.urdf +268 -0
  19. warp/examples/assets/rocks.nvdb +0 -0
  20. warp/examples/assets/rocks.usd +0 -0
  21. warp/examples/assets/sphere.usda +56 -0
  22. warp/examples/assets/torus.usda +105 -0
  23. warp/examples/benchmarks/benchmark_api.py +383 -0
  24. warp/examples/benchmarks/benchmark_cloth.py +279 -0
  25. warp/examples/benchmarks/benchmark_cloth_cupy.py +88 -0
  26. warp/examples/benchmarks/benchmark_cloth_jax.py +100 -0
  27. warp/examples/benchmarks/benchmark_cloth_numba.py +142 -0
  28. warp/examples/benchmarks/benchmark_cloth_numpy.py +77 -0
  29. warp/examples/benchmarks/benchmark_cloth_pytorch.py +86 -0
  30. warp/examples/benchmarks/benchmark_cloth_taichi.py +112 -0
  31. warp/examples/benchmarks/benchmark_cloth_warp.py +146 -0
  32. warp/examples/benchmarks/benchmark_launches.py +295 -0
  33. warp/examples/core/example_dem.py +221 -0
  34. warp/examples/core/example_fluid.py +267 -0
  35. warp/examples/core/example_graph_capture.py +129 -0
  36. warp/examples/core/example_marching_cubes.py +177 -0
  37. warp/examples/core/example_mesh.py +154 -0
  38. warp/examples/core/example_mesh_intersect.py +193 -0
  39. warp/examples/core/example_nvdb.py +169 -0
  40. warp/examples/core/example_raycast.py +89 -0
  41. warp/examples/core/example_raymarch.py +178 -0
  42. warp/examples/core/example_render_opengl.py +141 -0
  43. warp/examples/core/example_sph.py +389 -0
  44. warp/examples/core/example_torch.py +181 -0
  45. warp/examples/core/example_wave.py +249 -0
  46. warp/examples/fem/bsr_utils.py +380 -0
  47. warp/examples/fem/example_apic_fluid.py +391 -0
  48. warp/examples/fem/example_convection_diffusion.py +168 -0
  49. warp/examples/fem/example_convection_diffusion_dg.py +209 -0
  50. warp/examples/fem/example_convection_diffusion_dg0.py +194 -0
  51. warp/examples/fem/example_deformed_geometry.py +159 -0
  52. warp/examples/fem/example_diffusion.py +173 -0
  53. warp/examples/fem/example_diffusion_3d.py +152 -0
  54. warp/examples/fem/example_diffusion_mgpu.py +214 -0
  55. warp/examples/fem/example_mixed_elasticity.py +222 -0
  56. warp/examples/fem/example_navier_stokes.py +243 -0
  57. warp/examples/fem/example_stokes.py +192 -0
  58. warp/examples/fem/example_stokes_transfer.py +249 -0
  59. warp/examples/fem/mesh_utils.py +109 -0
  60. warp/examples/fem/plot_utils.py +287 -0
  61. warp/examples/optim/example_bounce.py +248 -0
  62. warp/examples/optim/example_cloth_throw.py +210 -0
  63. warp/examples/optim/example_diffray.py +535 -0
  64. warp/examples/optim/example_drone.py +850 -0
  65. warp/examples/optim/example_inverse_kinematics.py +169 -0
  66. warp/examples/optim/example_inverse_kinematics_torch.py +170 -0
  67. warp/examples/optim/example_spring_cage.py +234 -0
  68. warp/examples/optim/example_trajectory.py +201 -0
  69. warp/examples/sim/example_cartpole.py +128 -0
  70. warp/examples/sim/example_cloth.py +184 -0
  71. warp/examples/sim/example_granular.py +113 -0
  72. warp/examples/sim/example_granular_collision_sdf.py +185 -0
  73. warp/examples/sim/example_jacobian_ik.py +213 -0
  74. warp/examples/sim/example_particle_chain.py +106 -0
  75. warp/examples/sim/example_quadruped.py +179 -0
  76. warp/examples/sim/example_rigid_chain.py +191 -0
  77. warp/examples/sim/example_rigid_contact.py +176 -0
  78. warp/examples/sim/example_rigid_force.py +126 -0
  79. warp/examples/sim/example_rigid_gyroscopic.py +97 -0
  80. warp/examples/sim/example_rigid_soft_contact.py +124 -0
  81. warp/examples/sim/example_soft_body.py +178 -0
  82. warp/fabric.py +29 -20
  83. warp/fem/cache.py +0 -1
  84. warp/fem/dirichlet.py +0 -2
  85. warp/fem/integrate.py +0 -1
  86. warp/jax.py +45 -0
  87. warp/jax_experimental.py +339 -0
  88. warp/native/builtin.h +12 -0
  89. warp/native/bvh.cu +18 -18
  90. warp/native/clang/clang.cpp +8 -3
  91. warp/native/cuda_util.cpp +94 -5
  92. warp/native/cuda_util.h +35 -6
  93. warp/native/cutlass_gemm.cpp +1 -1
  94. warp/native/cutlass_gemm.cu +4 -1
  95. warp/native/error.cpp +66 -0
  96. warp/native/error.h +27 -0
  97. warp/native/mesh.cu +2 -2
  98. warp/native/reduce.cu +4 -4
  99. warp/native/runlength_encode.cu +2 -2
  100. warp/native/scan.cu +2 -2
  101. warp/native/sparse.cu +0 -1
  102. warp/native/temp_buffer.h +2 -2
  103. warp/native/warp.cpp +95 -60
  104. warp/native/warp.cu +1053 -218
  105. warp/native/warp.h +49 -32
  106. warp/optim/linear.py +33 -16
  107. warp/render/render_opengl.py +202 -101
  108. warp/render/render_usd.py +82 -40
  109. warp/sim/__init__.py +13 -4
  110. warp/sim/articulation.py +4 -5
  111. warp/sim/collide.py +320 -175
  112. warp/sim/import_mjcf.py +25 -30
  113. warp/sim/import_urdf.py +94 -63
  114. warp/sim/import_usd.py +51 -36
  115. warp/sim/inertia.py +3 -2
  116. warp/sim/integrator.py +233 -0
  117. warp/sim/integrator_euler.py +447 -469
  118. warp/sim/integrator_featherstone.py +1991 -0
  119. warp/sim/integrator_xpbd.py +1420 -640
  120. warp/sim/model.py +765 -487
  121. warp/sim/particles.py +2 -1
  122. warp/sim/render.py +35 -13
  123. warp/sim/utils.py +222 -11
  124. warp/stubs.py +8 -0
  125. warp/tape.py +16 -1
  126. warp/tests/aux_test_grad_customs.py +23 -0
  127. warp/tests/test_array.py +190 -1
  128. warp/tests/test_async.py +656 -0
  129. warp/tests/test_bool.py +50 -0
  130. warp/tests/test_dlpack.py +164 -11
  131. warp/tests/test_examples.py +166 -74
  132. warp/tests/test_fem.py +8 -1
  133. warp/tests/test_generics.py +15 -5
  134. warp/tests/test_grad.py +1 -1
  135. warp/tests/test_grad_customs.py +172 -12
  136. warp/tests/test_jax.py +254 -0
  137. warp/tests/test_large.py +29 -6
  138. warp/tests/test_launch.py +25 -0
  139. warp/tests/test_linear_solvers.py +20 -3
  140. warp/tests/test_matmul.py +61 -16
  141. warp/tests/test_matmul_lite.py +13 -13
  142. warp/tests/test_mempool.py +186 -0
  143. warp/tests/test_multigpu.py +3 -0
  144. warp/tests/test_options.py +16 -2
  145. warp/tests/test_peer.py +137 -0
  146. warp/tests/test_print.py +3 -1
  147. warp/tests/test_quat.py +23 -0
  148. warp/tests/test_sim_kinematics.py +97 -0
  149. warp/tests/test_snippet.py +126 -3
  150. warp/tests/test_streams.py +108 -79
  151. warp/tests/test_torch.py +16 -8
  152. warp/tests/test_utils.py +32 -27
  153. warp/tests/test_verify_fp.py +65 -0
  154. warp/tests/test_volume.py +1 -1
  155. warp/tests/unittest_serial.py +2 -0
  156. warp/tests/unittest_suites.py +12 -0
  157. warp/tests/unittest_utils.py +14 -7
  158. warp/thirdparty/unittest_parallel.py +15 -3
  159. warp/torch.py +10 -8
  160. warp/types.py +363 -246
  161. warp/utils.py +143 -19
  162. warp_lang-1.0.0.dist-info/LICENSE.md +126 -0
  163. warp_lang-1.0.0.dist-info/METADATA +394 -0
  164. {warp_lang-0.11.0.dist-info → warp_lang-1.0.0.dist-info}/RECORD +167 -86
  165. warp/sim/optimizer.py +0 -138
  166. warp_lang-0.11.0.dist-info/LICENSE.md +0 -36
  167. warp_lang-0.11.0.dist-info/METADATA +0 -238
  168. /warp/tests/{walkthough_debug.py → walkthrough_debug.py} +0 -0
  169. {warp_lang-0.11.0.dist-info → warp_lang-1.0.0.dist-info}/WHEEL +0 -0
  170. {warp_lang-0.11.0.dist-info → warp_lang-1.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,394 @@
1
+ Metadata-Version: 2.1
2
+ Name: warp-lang
3
+ Version: 1.0.0
4
+ Summary: A Python framework for high-performance simulation and graphics programming
5
+ Author-email: NVIDIA <mmacklin@nvidia.com>
6
+ License: NVIDIA Software License
7
+ Project-URL: GitHub, https://github.com/NVIDIA/warp
8
+ Project-URL: Documentation, https://nvidia.github.io/warp
9
+ Project-URL: Changelog, https://github.com/NVIDIA/warp/blob/main/CHANGELOG.md
10
+ Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: License :: Other/Proprietary License
16
+ Classifier: Operating System :: OS Independent
17
+ Requires-Python: >=3.7
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE.md
20
+ Requires-Dist: numpy
21
+ Provides-Extra: dev
22
+ Requires-Dist: flake8 ; extra == 'dev'
23
+ Requires-Dist: black ; extra == 'dev'
24
+ Requires-Dist: isort ; extra == 'dev'
25
+ Requires-Dist: nvtx ; extra == 'dev'
26
+ Requires-Dist: furo ; extra == 'dev'
27
+ Requires-Dist: sphinx-copybutton ; extra == 'dev'
28
+ Requires-Dist: coverage[toml] ; extra == 'dev'
29
+
30
+ # NVIDIA Warp
31
+
32
+ Warp is a Python framework for writing high-performance simulation and graphics code. Warp takes
33
+ regular Python functions and JIT compiles them to efficient kernel code that can run on the CPU or GPU.
34
+
35
+ Warp is designed for spatial computing and comes with a rich set of primitives that make it easy to write
36
+ programs for physics simulation, perception, robotics, and geometry processing. In addition, Warp kernels
37
+ are differentiable and can be used as part of machine-learning pipelines with frameworks such as PyTorch and JAX.
38
+
39
+ Please refer to the project [Documentation](https://nvidia.github.io/warp/) for API and language reference and [CHANGELOG.md](./CHANGELOG.md) for release history.
40
+
41
+ <div align="center">
42
+ <img src="https://github.com/NVIDIA/warp/raw/main/docs/img/header.jpg">
43
+ <p><i>A selection of physical simulations computed with Warp</i></p>
44
+ </div>
45
+
46
+
47
+ ## Installing
48
+
49
+ Warp supports Python versions 3.7 onwards. It can run on x86-64 and ARMv8 CPUs on Windows, Linux, and macOS. GPU support requires a CUDA capable NVIDIA GPU and driver (minimum GeForce GTX 9xx).
50
+
51
+ The easiest way to install Warp is from [PyPI](https://pypi.org/project/warp-lang/):
52
+
53
+ pip install warp-lang
54
+
55
+ Pre-built binary packages are also available on the [Releases](https://github.com/NVIDIA/warp/releases) page. To install in your local Python environment run the following command from the download directory:
56
+
57
+ pip install warp_lang-<version and platform>.whl
58
+
59
+ ## Getting Started
60
+
61
+ An example first program that computes the lengths of random 3D vectors is given below:
62
+
63
+ ```python
64
+ import warp as wp
65
+ import numpy as np
66
+
67
+ wp.init()
68
+
69
+ num_points = 1024
70
+
71
+ @wp.kernel
72
+ def length(points: wp.array(dtype=wp.vec3),
73
+ lengths: wp.array(dtype=float)):
74
+
75
+ # thread index
76
+ tid = wp.tid()
77
+
78
+ # compute distance of each point from origin
79
+ lengths[tid] = wp.length(points[tid])
80
+
81
+
82
+ # allocate an array of 3d points
83
+ points = wp.array(np.random.rand(num_points, 3), dtype=wp.vec3)
84
+ lengths = wp.zeros(num_points, dtype=float)
85
+
86
+ # launch kernel
87
+ wp.launch(kernel=length,
88
+ dim=len(points),
89
+ inputs=[points, lengths])
90
+
91
+ print(lengths)
92
+ ```
93
+
94
+ ## Running Examples
95
+
96
+ The `examples` directory contains a number of scripts that show how to implement different simulation methods using the Warp API. Most examples will generate USD files containing time-sampled animations (stored in the same directory as the example). Before running examples, users should ensure that the ``usd-core`` package is installed using:
97
+
98
+ pip install usd-core
99
+
100
+ Examples can be run from the command-line as follows:
101
+
102
+ python -m warp.examples.<example_subdir>.<example>
103
+
104
+ Most examples can be run on either the CPU or a CUDA-capable device, but a handful require a CUDA-capable device. These are marked at the top of the example script.
105
+
106
+ USD files can be viewed or rendered inside [NVIDIA Omniverse](https://developer.nvidia.com/omniverse), Pixar's UsdView, and Blender. Note that Preview in macOS is not recommended as it has limited support for time-sampled animations.
107
+
108
+ Built-in unit tests can be run from the command-line as follows:
109
+
110
+ python -m warp.tests
111
+
112
+
113
+ ### examples/core
114
+
115
+ <table>
116
+ <tbody>
117
+ <tr>
118
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_dem.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_dem.png"></a></td>
119
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_fluid.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_fluid.png"></a></td>
120
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_graph_capture.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_graph_capture.png"></a></td>
121
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_marching_cubes.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_marching_cubes.png"></a></td>
122
+ </tr>
123
+ <tr>
124
+ <td align="center">dem</td>
125
+ <td align="center">fluid</td>
126
+ <td align="center">graph capture</td>
127
+ <td align="center">marching cubes</td>
128
+ </tr>
129
+ <tr>
130
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_mesh.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_mesh.png"></a></td>
131
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_nvdb.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_nvdb.png"></a></td>
132
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_raycast.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_raycast.png"></a></td>
133
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_raymarch.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_raymarch.png"></a></td>
134
+ </tr>
135
+ <tr>
136
+ <td align="center">mesh</td>
137
+ <td align="center">nvdb</td>
138
+ <td align="center">raycast</td>
139
+ <td align="center">raymarch</td>
140
+ </tr>
141
+ <tr>
142
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_sph.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_sph.png"></a></td>
143
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_torch.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_torch.png"></a></td>
144
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/core/example_wave.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/core_wave.png"></a></td>
145
+ <td></td>
146
+ </tr>
147
+ <tr>
148
+ <td align="center">sph</td>
149
+ <td align="center">torch</td>
150
+ <td align="center">wave</td>
151
+ <td align="center"></td>
152
+ </tr>
153
+ </tbody>
154
+ </table>
155
+
156
+
157
+ ### examples/fem
158
+
159
+ <table>
160
+ <tbody>
161
+ <tr>
162
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_apic_fluid.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_apic_fluid.png"></a></td>
163
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_convection_diffusion.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_convection_diffusion.png"></a></td>
164
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_diffusion_3d.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_diffusion_3d.png"></a></td>
165
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_diffusion.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_diffusion.png"></a></td>
166
+ </tr>
167
+ <tr>
168
+ <td align="center">apic fluid</td>
169
+ <td align="center">convection diffusion</td>
170
+ <td align="center">diffusion 3d</td>
171
+ <td align="center">diffusion</td>
172
+ </tr>
173
+ <tr>
174
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_mixed_elasticity.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_mixed_elasticity.png"></a></td>
175
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_navier_stokes.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_navier_stokes.png"></a></td>
176
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_stokes_transfer.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_stokes_transfer.png"></a></td>
177
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/fem/example_stokes.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/fem_stokes.png"></a></td>
178
+ </tr>
179
+ <tr>
180
+ <td align="center">mixed elasticity</td>
181
+ <td align="center">navier stokes</td>
182
+ <td align="center">stokes transfer</td>
183
+ <td align="center">stokes</td>
184
+ </tr>
185
+ </tbody>
186
+ </table>
187
+
188
+
189
+ ### examples/optim
190
+
191
+ <table>
192
+ <tbody>
193
+ <tr>
194
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/optim/example_bounce.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/optim_bounce.png"></a></td>
195
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/optim/example_cloth_throw.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/optim_cloth_throw.png"></a></td>
196
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/optim/example_diffray.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/optim_diffray.png"></a></td>
197
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/optim/example_drone.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/optim_drone.png"></a></td>
198
+ </tr>
199
+ <tr>
200
+ <td align="center">bounce</td>
201
+ <td align="center">cloth throw</td>
202
+ <td align="center">diffray</td>
203
+ <td align="center">drone</td>
204
+ </tr>
205
+ <tr>
206
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/optim/example_inverse_kinematics.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/optim_inverse_kinematics.png"></a></td>
207
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/optim/example_spring_cage.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/optim_spring_cage.png"></a></td>
208
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/optim/example_trajectory.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/optim_trajectory.png"></a></td>
209
+ <td></td>
210
+ </tr>
211
+ <tr>
212
+ <td align="center">inverse kinematics</td>
213
+ <td align="center">spring cage</td>
214
+ <td align="center">trajectory</td>
215
+ <td align="center"></td>
216
+ </tr>
217
+ </tbody>
218
+ </table>
219
+
220
+
221
+ ### examples/sim
222
+
223
+ <table>
224
+ <tbody>
225
+ <tr>
226
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_cartpole.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_cartpole.png"></a></td>
227
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_cloth.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_cloth.png"></a></td>
228
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_granular.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_granular.png"></a></td>
229
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_granular_collision_sdf.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_granular_collision_sdf.png"></a></td>
230
+ </tr>
231
+ <tr>
232
+ <td align="center">cartpole</td>
233
+ <td align="center">cloth</td>
234
+ <td align="center">granular</td>
235
+ <td align="center">granular collision sdf</td>
236
+ </tr>
237
+ <tr>
238
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_jacobian_ik.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_jacobian_ik.png"></a></td>
239
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_quadruped.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_quadruped.png"></a></td>
240
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_rigid_chain.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_rigid_chain.png"></a></td>
241
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_rigid_contact.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_rigid_contact.png"></a></td>
242
+ </tr>
243
+ <tr>
244
+ <td align="center">jacobian ik</td>
245
+ <td align="center">quadruped</td>
246
+ <td align="center">rigid chain</td>
247
+ <td align="center">rigid contact</td>
248
+ </tr>
249
+ <tr>
250
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_rigid_force.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_rigid_force.png"></a></td>
251
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_rigid_gyroscopic.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_rigid_gyroscopic.png"></a></td>
252
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_rigid_soft_contact.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_rigid_soft_contact.png"></a></td>
253
+ <td><a href="https://github.com/NVIDIA/warp/tree/main/warp/examples/sim/example_soft_body.py"><img src="https://github.com/NVIDIA/warp/raw/main/docs/img/examples/sim_soft_body.png"></a></td>
254
+ </tr>
255
+ <tr>
256
+ <td align="center">rigid force</td>
257
+ <td align="center">rigid gyroscopic</td>
258
+ <td align="center">rigid soft contact</td>
259
+ <td align="center">soft body</td>
260
+ </tr>
261
+ </tbody>
262
+ </table>
263
+
264
+
265
+ ## Building
266
+
267
+ For developers who want to build the library themselves, the following tools are required:
268
+
269
+ * Microsoft Visual Studio 2019 upwards (Windows)
270
+ * GCC 7.2 upwards (Linux)
271
+ * CUDA Toolkit 11.5 or higher
272
+ * [Git LFS](https://git-lfs.github.com/) installed
273
+
274
+ After cloning the repository, users should run:
275
+
276
+ python build_lib.py
277
+
278
+ This will generate the `warp.dll` / `warp.so` core library respectively. It will search for the CUDA Toolkit in the default install directory. This path can be overridden by setting the `CUDA_PATH` environment variable. Alternatively, the path to the CUDA Toolkit can be passed to the build command as `--cuda_path="..."`. After building, the Warp package should be installed using:
279
+
280
+ pip install -e .
281
+
282
+ This ensures that subsequent modifications to the library will be reflected in the Python package.
283
+
284
+ ## Omniverse
285
+
286
+ A Warp Omniverse extension is available in the extension registry inside Omniverse Kit or USD Composer:
287
+
288
+ <img src="https://github.com/NVIDIA/warp/raw/main/docs/img/omniverse.png" width=550px/>
289
+
290
+ Enabling the extension will automatically install and initialize the Warp Python module inside the Kit Python environment.
291
+ Please see the [Omniverse Warp Documentation](https://docs.omniverse.nvidia.com/extensions/latest/ext_warp.html) for more details on how to use Warp in Omniverse.
292
+
293
+ ## Learn More
294
+
295
+ Please see the following resources for additional background on Warp:
296
+
297
+ * [GTC 2022 Presentation](https://www.nvidia.com/en-us/on-demand/session/gtcspring22-s41599)
298
+ * [GTC 2021 Presentation](https://www.nvidia.com/en-us/on-demand/session/gtcspring21-s31838)
299
+ * [SIGGRAPH Asia 2021 Differentiable Simulation Course](https://dl.acm.org/doi/abs/10.1145/3476117.3483433)
300
+
301
+ The underlying technology in Warp has been used in a number of research projects at NVIDIA including the following publications:
302
+
303
+ * Accelerated Policy Learning with Parallel Differentiable Simulation - Xu, J., Makoviychuk, V., Narang, Y., Ramos, F., Matusik, W., Garg, A., & Macklin, M. [(2022)](https://short-horizon-actor-critic.github.io)
304
+ * DiSECt: Differentiable Simulator for Robotic Cutting - Heiden, E., Macklin, M., Narang, Y., Fox, D., Garg, A., & Ramos, F [(2021)](https://github.com/NVlabs/DiSECt)
305
+ * gradSim: Differentiable Simulation for System Identification and Visuomotor Control - Murthy, J. Krishna, Miles Macklin, Florian Golemo, Vikram Voleti, Linda Petrini, Martin Weiss, Breandan Considine et al. [(2021)](https://gradsim.github.io)
306
+
307
+ ## Citing
308
+
309
+ If you use Warp in your research please use the following citation:
310
+
311
+ ```bibtex
312
+ @misc{warp2022,
313
+ title= {Warp: A High-performance Python Framework for GPU Simulation and Graphics},
314
+ author = {Miles Macklin},
315
+ month = {March},
316
+ year = {2022},
317
+ note= {NVIDIA GPU Technology Conference (GTC)},
318
+ howpublished = {\url{https://github.com/nvidia/warp}}
319
+ }
320
+ ```
321
+
322
+ ## FAQ
323
+
324
+ ### How does Warp relate to other Python projects for GPU programming, e.g.: Numba, Taichi, cuPy, PyTorch, etc?
325
+ -------
326
+
327
+ Warp is inspired by many of these projects and is closely related to Numba and Taichi, which both expose kernel programming to Python. These frameworks map to traditional GPU programming models, so many of the high-level concepts are similar, however there are some functionality and implementation differences.
328
+
329
+ Compared to Numba, Warp supports a smaller subset of Python, but offers auto-differentiation of kernel programs, which is useful for machine learning. Compared to Taichi, Warp uses C++/CUDA as an intermediate representation, which makes it convenient to implement and expose low-level routines. In addition, we are building in data structures to support geometry processing (meshes, sparse volumes, point clouds, USD data) as first-class citizens that are not exposed in other runtimes.
330
+
331
+ Warp does not offer a full tensor-based programming model like PyTorch and JAX, but is designed to work well with these frameworks through data sharing mechanisms like `__cuda_array_interface__`. For computations that map well to tensors (e.g.: neural-network inference) it makes sense to use these existing tools. For problems with a lot of e.g.: sparsity, conditional logic, heterogeneous workloads (like the ones we often find in simulation and graphics), then the kernel-based programming model like the one in Warp is often more convenient since users have control over individual threads.
332
+
333
+ ### Does Warp support all of the Python language?
334
+ -------
335
+
336
+ No, Warp supports a subset of Python that maps well to the GPU. Our goal is to not have any performance cliffs so that users can expect consistently good behavior from kernels that is close to native code. Examples of unsupported concepts that don't map well to the GPU are dynamic types, list comprehensions, exceptions, garbage collection, etc.
337
+
338
+ ### When should I call `wp.synchronize()`?
339
+ -------
340
+
341
+ One of the common sources of confusion for new users is when calls to `wp.synchronize()` are necessary. The answer is "almost never"! Synchronization is quite expensive, and should generally be avoided unless necessary. Warp naturally takes care of synchronization between operations (e.g.: kernel launches, device memory copies).
342
+
343
+ For example, the following requires no manual synchronization, as the conversion to NumPy will automatically synchronize:
344
+
345
+ ```python
346
+ # run some kernels
347
+ wp.launch(kernel_1, dim, [array_x, array_y], device="cuda")
348
+ wp.launch(kernel_2, dim, [array_y, array_z], device="cuda")
349
+
350
+ # bring data back to host (and implicitly synchronize)
351
+ x = array_z.numpy()
352
+ ```
353
+
354
+ The _only_ case where manual synchronization is needed is when copies are being performed back to CPU asynchronously, e.g.:
355
+
356
+ ```python
357
+ # copy data back to cpu from gpu, all copies will happen asynchronously to Python
358
+ wp.copy(cpu_array_1, gpu_array_1)
359
+ wp.copy(cpu_array_2, gpu_array_2)
360
+ wp.copy(cpu_array_3, gpu_array_3)
361
+
362
+ # ensure that the copies have finished
363
+ wp.synchronize()
364
+
365
+ # return a numpy wrapper around the cpu arrays, note there is no implicit synchronization here
366
+ a1 = cpu_array_1.numpy()
367
+ a2 = cpu_array_2.numpy()
368
+ a3 = cpu_array_3.numpy()
369
+ ```
370
+
371
+ ### What happens when you differentiate a function like `wp.abs(x)`?
372
+ -------
373
+
374
+ Non-smooth functions such as `y=|x|` do not have a single unique gradient at `x=0`, rather they have what is known as a `subgradient`, which is formally the convex hull of directional derivatives at that point. The way that Warp (and most auto-differentiation frameworks) handles these points is to pick an arbitrary gradient from this set, e.g.: for `wp.abs()`, it will arbitrarily choose the gradient to be 1.0 at the origin. You can find the implementation for these functions in `warp/native/builtin.h`.
375
+
376
+ Most optimizers (particularly ones that exploit stochasticity) are not sensitive to the choice of which gradient to use from the subgradient, although there are exceptions.
377
+
378
+ ### Does Warp support multi-GPU programming?
379
+ -------
380
+
381
+ Yes! Since version `0.4.0` we support allocating, launching, and copying between multiple GPUs in a single process. We follow the naming conventions of PyTorch and use aliases such as `cuda:0`, `cuda:1`, `cpu` to identify individual devices.
382
+
383
+ ### Should I switch to Warp over IsaacGym / PhysX?
384
+ -------
385
+
386
+ Warp is not a replacement for IsaacGym, IsaacSim, or PhysX - while Warp does offer some physical simulation capabilities this is primarily aimed at developers who need differentiable physics, rather than a fully featured physics engine. Warp is also integrated with IsaacGym and is great for performing auxiliary tasks such as reward and observation computations for reinforcement learning.
387
+
388
+ ## Discord
389
+
390
+ We have a **#warp** channel on the public [Omniverse Discord](https://discord.com/invite/nvidiaomniverse) server, come chat to us!
391
+
392
+ ## License
393
+
394
+ Warp is provided under the NVIDIA Software License, please see [LICENSE.md](./LICENSE.md) for full license text.