Skip to content

Commit 700b6ad

Browse files
committed
Enable taichi debug mode if possible.
1 parent aeabb23 commit 700b6ad

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

genesis/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def init(
211211
with redirect_stdout(_ti_outputs):
212212
ti.init(
213213
arch=ti_arch,
214-
# debug is causing segfault on some machines
215-
debug=False,
214+
# Debug mode was buggy and causing segfault prior to v1.7.4
215+
debug=debug and ti.__version__ >= (1, 7, 4),
216216
check_out_of_bound=debug,
217217
# force_scalarize_matrix=True for speeding up kernel compilation
218218
# Turning off 'force_scalarize_matrix' is causing numerical instabilities ('nan') on MacOS

genesis/engine/solvers/rigid/rigid_solver_decomp.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5226,11 +5226,11 @@ def func_torque_and_passive_force(
52265226
joint_type = joints_info.type[I_j]
52275227

52285228
if joint_type != gs.JOINT_TYPE.FREE and joint_type != gs.JOINT_TYPE.FIXED:
5229-
dof_start = links_info.dof_start[I_l]
52305229
q_start = links_info.q_start[I_l]
5231-
q_end = links_info.q_end[I_l]
5230+
dof_start = links_info.dof_start[I_l]
5231+
dof_end = links_info.dof_end[I_l]
52325232

5233-
for j_d in range(q_end - q_start):
5233+
for j_d in range(dof_end - dof_start):
52345234
I_d = (
52355235
[dof_start + j_d, i_b]
52365236
if ti.static(static_rigid_sim_config.batch_dofs_info)
@@ -5256,11 +5256,11 @@ def func_torque_and_passive_force(
52565256
joint_type = joints_info.type[I_j]
52575257

52585258
if joint_type != gs.JOINT_TYPE.FREE and joint_type != gs.JOINT_TYPE.FIXED:
5259-
dof_start = links_info.dof_start[I_l]
52605259
q_start = links_info.q_start[I_l]
5261-
q_end = links_info.q_end[I_l]
5260+
dof_start = links_info.dof_start[I_l]
5261+
dof_end = links_info.dof_end[I_l]
52625262

5263-
for j_d in range(q_end - q_start):
5263+
for j_d in range(dof_end - dof_start):
52645264
I_d = (
52655265
[dof_start + j_d, i_b]
52665266
if ti.static(static_rigid_sim_config.batch_dofs_info)

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def initialize_genesis(request, backend, taichi_offline_cache):
280280
precision = "64"
281281
debug = True
282282
else:
283+
# Disabling debug mode on GPU because we are likely needing maximum performance, notably for benchmarks
283284
precision = "32"
284285
debug = False
285286

0 commit comments

Comments
 (0)