meiqua / shape_based_matching

try to implement halcon shape based matching, refer to machine vision algorithms and applications, page 317 3.11.5, written by halcon engineers
BSD 2-Clause "Simplified" License
1.23k stars 481 forks source link

ipc检测耗时波动异常 #137

Open wly2020-robot opened 3 years ago

wly2020-robot commented 3 years ago

你好,我测试检测算法耗时,发现init_Scene_kdtree_cpu里面的Canny耗时波动比较大,波动范围5-22ms;函数里面的一个for循环耗时波动也比较大,9-21ms波动;检测当中就这个函数init_Scene_kdtree_cpu耗时有可能造成30ms之差,能优化吗?谢谢。

meiqua commented 3 years ago

可能是由于不同图像边缘数量不同,这种导致的波动是正常的;当然也可以绑在大核心上试试

wly2020-robot commented 3 years ago

不是不同图像,几乎是同一图像,多次检测的打印信息。

------------------ 原始邮件 ------------------ 发件人: "meiqua/shape_based_matching" @.>; 发送时间: 2021年3月11日(星期四) 晚上10:34 @.>; @.**@.>; 主题: Re: [meiqua/shape_based_matching] ipc检测耗时波动异常 (#137)

可能是由于不同图像边缘数量不同,这种导致的波动是正常的;当然也可以绑在大核心上试试

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

wly2020-robot commented 3 years ago

有绑定在两个大核心上跑的。

------------------ 原始邮件 ------------------ 发件人: "meiqua/shape_based_matching" @.>; 发送时间: 2021年3月11日(星期四) 晚上10:34 @.>; @.**@.>; 主题: Re: [meiqua/shape_based_matching] ipc检测耗时波动异常 (#137)

可能是由于不同图像边缘数量不同,这种导致的波动是正常的;当然也可以绑在大核心上试试

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

meiqua commented 3 years ago

二三十毫秒的波动可能因素很多,不一定是程序的原因

HotCat commented 3 years ago

如果用的是工控板,进入BIOS,把这几个选项Disable了:Intel Speedstep : Disabled,CPU C States support : Disabled。如果是在Linux下运行,可以修改内核启动参数,加上intel_idle.max_cstate=0 processor.max_cstate=0 idle=poll pstate=disable,这些修改最终的作用就是让CPU以稳定的频率运行,而不是根据负载来回波动

wly2020-robot commented 3 years ago

你好,HotCat,我在工控机上的BLOS上的CPU没有相关的配置项。 附件如下: 1 2 3 4

wly2020-robot commented 3 years ago

将类似项“CPU C state” disable后,对耗时波动没有效果!

meiqua commented 3 years ago

可以先看看有没有一些方法监测CPU频率,再看是否对耗时有影响

---原始邮件--- 发件人: @.> 发送时间: 2021年4月19日(周一) 上午9:48 收件人: @.>; 抄送: @.**@.>; 主题: Re: [meiqua/shape_based_matching] ipc检测耗时波动异常 (#137)

将类似项“CPU C state” disable后,对耗时波动没有效果!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

wly2020-robot commented 3 years ago

好的,谢谢。

wly2020-robot commented 3 years ago

我用CPU-Z实时查看了核心速率,波动挺大的。看附件段视频:

https://user-images.githubusercontent.com/74177007/115174923-b7c0ca00-a0fc-11eb-8f5b-b1154c2b04c9.mp4

wly2020-robot commented 3 years ago

这样的波动给算法运行耗时波动是比较严重的,可否设置对CPU做相关的配置,达到优化的目的?谢谢 。

HotCat commented 3 years ago

wly2020-robot: 你还需要把EIST关闭掉,这个就是我提到的Enhanced Intel Speed Step变频技术,另外还有一个超频的也要关闭,超线程也要关闭。我传的图,把超线程标错了,去找到Intel HT(HyperThread) Technology这样的选项,关闭了试试。还有就是这种工控机是不是无风扇设计?要加强散热,不然温度上去了,操作系统也会开始降频 115170780-0cac1280-a0f4-11eb-8574-427a2e5f53d1

wly2020-robot commented 3 years ago

你好,HotCat! 我按照你说的进行优化,没有效果,算法运行耗时波动还更大。附件是blos设置和CPU-Z核心运行速率小视频: 2579e419010160d4b01604a9ea43c9b

https://user-images.githubusercontent.com/74177007/115191791-7dffbb80-a11c-11eb-97d9-a3012750cf64.mp4

HotCat commented 3 years ago

你好,HotCat! 我按照你说的进行优化,没有效果,算法运行耗时波动还更大。附件是blos设置和CPU-Z核心运行速率小视频: 2579e419010160d4b01604a9ea43c9b

5752f0830beaa69184c72e12bc93b141.mp4

可能还得用windows下的软件把这个EIST关闭,BIOS关闭可能没用,windows可能自动又打开了。我去年也用过这种淘宝工控机跑LinuxCNC,原先默认频率1.6G的,通过这么设置可以稳定到2.6G;原先默认频率1.9G的,最后都可以稳定到3.0G

wly2020-robot commented 3 years ago

在blos上设置了,重新启动后,看看blos配置也是设置的。你说的设置软件是啥软件?能否说一下,谢谢。