Open k-ye opened 2 years ago
Tried the command valgrind --leak-check=full --log-file='mem-leak-test.txt' --track-origins=yes -v ${CMD} ${ARGS}
on taichi-aot-demo. However, both tutorial
and mpm88
does not seem to observe the memory leak mentioned above.
Does notice a mem-leak in C-API, but that's more related to Vulkan implementation of vkCmdBindPipeline()
==2628974== 5,496 bytes in 1 blocks are definitely lost in loss record 1,569 of 1,587
==2628974== at 0x484147B: calloc (vg_replace_malloc.c:1340)
==2628974== by 0x8D4D58F: ???
==2628974== by 0x90F9DB1: ???
==2628974== by 0x90FB8C4: ???
==2628974== by 0x91096BE: ???
==2628974== by 0x54D75A0: taichi::lang::vulkan::VulkanCommandList::bind_pipeline(taichi::lang::Pipeline*) (taichi/rhi/vulkan/vulkan_device.cpp:831)
==2628974== by 0x54744CA: taichi::lang::gfx::GfxRuntime::launch_kernel(taichi::lang::gfx::GfxRuntime::KernelHandle, taichi::lang::RuntimeContext*) (taichi/runtime/gfx/runtime.cpp:508)
==2628974== by 0x54ADF49: taichi::lang::gfx::KernelImpl::launch(taichi::lang::RuntimeContext*) (taichi/runtime/gfx/aot_graph_data.h:14)
==2628974== by 0x4ED1582: ti_launch_kernel (c_api/src/taichi_core_impl.cpp:607)
==2628974== by 0x404030: launch (taichi4/_skbuild/linux-x86_64-3.8/cmake-install/c_api/include/taichi/cpp/taichi.hpp:533)
==2628974== by 0x404030: launch (taichi4/_skbuild/linux-x86_64-3.8/cmake-install/c_api/include/taichi/cpp/taichi.hpp:536)
==2628974== by 0x404030: App0_tutorial::run() (0_tutorial_kernel/app.cpp:42)
==2628974== by 0x40387C: main (0_tutorial_kernel/app.cpp:68)
To further investigate the memory leak problem, we'll probably have to separate out a minimal AOT run from taco.
Describe the bug
I've run Taichi AOT with valgrind, which reported memory leaks in several places:
You can check with
valgrind
with this cmd line: