tensionmap icon indicating copy to clipboard operation
tensionmap copied to clipboard

Crash when using the numba branch

Open VincentKueszter opened this issue 4 years ago • 4 comments

Blender version: 2.81 (sub 16) numba version: 0.47.0 OS: Windows

I get the following crash with the numba branch as soon as I press play for my test animation:

..\addons\tensionmap_numba.py:206: NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function "change_colors" failed type inference due to: non-precise type pyobject
[1] During: typing of argument at ..\addons\tensionmap_numba.py (208)

File "..\addons\tensionmap_numba.py", line 208:
def change_colors(mesh,num_polygons,loop_indices,vertex_colors_data,vertex_idxs,vertex_colors,num_of_channels):
    for poly_idx in range(num_polygons):
    ^

  @jit()
..\addons\tensionmap_numba.py:206: NumbaWarning:
Compilation is falling back to object mode WITHOUT looplifting enabled because Function "change_colors" failed type inference due to: cannot determine Numba type of <class 'numba.dispatcher.LiftedLoop'>

File "..\addons\tensionmap_numba.py", line 208:
def change_colors(mesh,num_polygons,loop_indices,vertex_colors_data,vertex_idxs,vertex_colors,num_of_channels):
    for poly_idx in range(num_polygons):
    ^

  @jit()
C:\Program Files\Blender Foundation\Blender 2.81\2.81\python\lib\site-packages\numba\object_mode_passes.py:178: NumbaWarning: Function "change_colors" was compiled in object mode without forceobj=True, but has lifted loops.

File "..\addons\tensionmap_numba.py", line 208:
def change_colors(mesh,num_polygons,loop_indices,vertex_colors_data,vertex_idxs,vertex_colors,num_of_channels):
    for poly_idx in range(num_polygons):
    ^

  state.func_ir.loc))
C:\Program Files\Blender Foundation\Blender 2.81\2.81\python\lib\site-packages\numba\object_mode_passes.py:188: NumbaDeprecationWarning:
Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.

For more information visit http://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit

File "..\addons\tensionmap_numba.py", line 208:
def change_colors(mesh,num_polygons,loop_indices,vertex_colors_data,vertex_idxs,vertex_colors,num_of_channels):
    for poly_idx in range(num_polygons):
    ^

  state.func_ir.loc))
Windows fatal exception: access violation

Current thread 0x00004080 (most recent call first):
  File "..\addons\tensionmap_numba.py", line 180 in tm_update
  File "..\addons\tensionmap_numba.py", line 257 in tm_update_handler

If I add forceobj=True, it doesn't crash, but loops the following error:

IndexError: index 3360 is out of bounds for axis 0 with size 8
Traceback (most recent call last):
  File "..\addons\tensionmap_numba.py", line 257, in tm_update_handler
    tm_update(obj, bpy.context)
  File "..\addons\tensionmap_numba.py", line 180, in tm_update
    change_colors(mesh,num_polygons,loop_indices,vertex_colors_data,vertex_idxs,vertex_colors,number_of_tm_channels)

(Also tagging @Juksten)

VincentKueszter avatar Jan 26 '20 11:01 VincentKueszter

Thank you for reporting. I hope @Juksten can have a look at this, as I haven't worked on the numba version.

ScottishCyclops avatar Jan 26 '20 17:01 ScottishCyclops

#19 Fixes 1st bug. 2nd error is probably caused by some wrong indexes, but i dont know how to reproduce this issue. Could you provide a blend file or more informations about your blender scene? In my case when i was testing mesh with armature everything seems to work fine.

Juksten avatar Jan 30 '20 08:01 Juksten

Thanks for helping out! Here is my test scene: https://www.dropbox.com/s/buqnbp5yyi6nvix/crash.zip?dl=1

VincentKueszter avatar Jan 30 '20 21:01 VincentKueszter

Check #20

Juksten avatar Feb 01 '20 21:02 Juksten