i.MX8MP NPU crash after some delay

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.MX8MP NPU crash after some delay

ソリューションへジャンプ
765件の閲覧回数
Christophe_Couturier
Contributor I

Hello,

I use an nnstreamer pipeline to run a detection model on video streams on an i.MX8MP (scarthgap 6.6.23).

It works fine. But after a random delay (~ some 10 seconds to some minutes), the rate of the inferences' output suddenly dramatically drops (typically from 15 to 0.3 FPS on our proprietary model).
At the same time, I observe that the load of the 2nd GPU (GC8000) raises at 100% and sticks to 100% until the pipeline stops.
I also notice weird display bugs on the weston's desktop screen that also disappear when the pipeline stops.

 


For IP reasons, I can't share my model but I managed to reproduce the bug with a Yolov5 tflite model publicly available in Kaggle at https://www.kaggle.com/models/kaggle/yolo-v5?select=1.tflite.

Way to reproduce the problem:

# Download the model from the Kagle website (https://www.kaggle.com/models/kaggle/yolo-v5?select=1.tflite)
# this provides with the 1.tflite file
# Sorry, I did not find any way to get a direct download url on kaggle's website. You'll have to download it manually from you browser (no need to register on kaggle's website)

# Optionally: Enable VX Caching
export VIV_VX_CACHE_BINARY_GRAPH_DIR=/root/.cache/vxdelegate/
export VIV_VX_ENABLE_CACHE_GRAPH_BINARY=1

# Optionally: Enable nnshark
export GST_DEBUG="GST_TRACER:7"
export GST_TRACERS="live"

# Run the pipeline
gst-launch-1.0 videotestsrc \
! video/x-raw, format=YUY2, width=320, height=320, framerate=20/1 \
! queue max-size-buffers=1 max-size-bytes=0 max-size-time=0 leaky=downstream \
! videoconvert n-threads=4 \
! video/x-raw, format=RGB \
! tensor_converter set-timestamp=false \
! tensor_transform mode=dimchg option=0:2 \
! tensor_transform mode=arithmetic option=typecast:float32,div:255 \
! tensor_filter framework=tensorflow-lite model=1.tflite custom=Delegate:External,ExtDelegateLib:libvx_delegate.so \
! fakesink

 

With this setup, at the beginning, the pipeline infers at a rate of ~0.85 FPS (inference time of 1.195s reported in nnshark) and the GC8000 load is between 10 and 40%.
After few minutes (~2'30 on my setup), the bug happens. The FPS drops to ~0.05FPS (inference time of 19.181s) and the GC8000 load is stucked at 100%.

This can be observed:

  • either with nnshark
  • or directly from the command line:
    • man can see the gstreamer timestamp progress is much slower
    •  and GPU load can be followed in another terminal with: watch -n0.1 cat /sys/kernel/debug/gc/load

Thank you by advance for any help!

 

タグ(2)
0 件の賞賛
返信
1 解決策
720件の閲覧回数
Christophe_Couturier
Contributor I

Self reply to my own question:

The processor is heating quite a lot when the NPU is under intensive load.

For some reason, my development board was not equipped with a heat-sink.

Installing a heat-sink on the processor seems to have solved by problem. Adding a fan may also be necessary for production use. To be checked

So, for the moment, I consider my problem is solved.
Hopefully, this post can help someone with the same problem.

元の投稿で解決策を見る

タグ(2)
0 件の賞賛
返信
1 返信
721件の閲覧回数
Christophe_Couturier
Contributor I

Self reply to my own question:

The processor is heating quite a lot when the NPU is under intensive load.

For some reason, my development board was not equipped with a heat-sink.

Installing a heat-sink on the processor seems to have solved by problem. Adding a fan may also be necessary for production use. To be checked

So, for the moment, I consider my problem is solved.
Hopefully, this post can help someone with the same problem.

タグ(2)
0 件の賞賛
返信
%3CLINGO-SUB%20id%3D%22lingo-sub-2164328%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ei.MX8MP%20NPU%20%E3%81%8C%E9%81%85%E5%BB%B6%E5%BE%8C%E3%81%AB%E3%82%AF%E3%83%A9%E3%83%83%E3%82%B7%E3%83%A5%E3%81%99%E3%82%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164328%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%3C%2FP%3E%3CP%3E%E7%A7%81%E3%81%AF%20nnstreamer%20%E3%83%91%E3%82%A4%E3%83%97%E3%83%A9%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%80%81i.MX8MP%20(scarthgap%206.6.23)%20%E4%B8%8A%E3%81%AE%E3%83%93%E3%83%87%E3%82%AA%20%E3%82%B9%E3%83%88%E3%83%AA%E3%83%BC%E3%83%A0%E3%81%A7%E6%A4%9C%E5%87%BA%E3%83%A2%E3%83%87%E3%83%AB%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E5%95%8F%E9%A1%8C%E3%81%AA%E3%81%8F%E5%8B%95%E4%BD%9C%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%97%E3%81%8B%E3%81%97%E3%80%81%E3%83%A9%E3%83%B3%E3%83%80%E3%83%A0%E3%81%AA%E9%81%85%E5%BB%B6%EF%BC%88%E7%B4%84%2010%20%E7%A7%92%E3%81%8B%E3%82%89%E6%95%B0%E5%88%86%EF%BC%89%E3%81%AE%E5%BE%8C%E3%80%81%E6%8E%A8%E8%AB%96%E3%81%AE%E5%87%BA%E5%8A%9B%E9%80%9F%E5%BA%A6%E3%81%8C%E7%AA%81%E7%84%B6%E5%A4%A7%E5%B9%85%E3%81%AB%E4%BD%8E%E4%B8%8B%E3%81%97%E3%81%BE%E3%81%99%EF%BC%88%E9%80%9A%E5%B8%B8%E3%80%81%E5%BD%93%E7%A4%BE%E7%8B%AC%E8%87%AA%E3%81%AE%E3%83%A2%E3%83%87%E3%83%AB%E3%81%A7%E3%81%AF%2015%20FPS%20%E3%81%8B%E3%82%89%200.3%20FPS%20%E3%81%AB%E4%BD%8E%E4%B8%8B%E3%81%97%E3%81%BE%E3%81%99%EF%BC%89%E3%80%82%3CBR%20%2F%3E%E5%90%8C%E6%99%82%E3%81%AB%E3%80%812%20%E7%95%AA%E7%9B%AE%E3%81%AE%20GPU%20(GC8000)%20%E3%81%AE%E8%B2%A0%E8%8D%B7%E3%81%8C%20100%25%20%E3%81%AB%E4%B8%8A%E6%98%87%E3%81%97%E3%80%81%E3%83%91%E3%82%A4%E3%83%97%E3%83%A9%E3%82%A4%E3%83%B3%E3%81%8C%E5%81%9C%E6%AD%A2%E3%81%99%E3%82%8B%E3%81%BE%E3%81%A7%20100%25%20%E3%81%AE%E3%81%BE%E3%81%BE%E3%81%AB%E3%81%AA%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%82%8F%E3%81%8B%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%E3%81%BE%E3%81%9F%E3%80%81%E3%82%A6%E3%82%A7%E3%82%B9%E3%83%88%E3%83%B3%E3%81%AE%E3%83%87%E3%82%B9%E3%82%AF%E3%83%88%E3%83%83%E3%83%97%E7%94%BB%E9%9D%A2%E3%81%AB%E5%A5%87%E5%A6%99%E3%81%AA%E8%A1%A8%E7%A4%BA%E3%83%90%E3%82%B0%E3%81%8C%E3%81%82%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AB%E3%82%82%E6%B0%97%E4%BB%98%E3%81%8D%E3%81%BE%E3%81%97%E3%81%9F%E3%81%8C%E3%80%81%E3%83%91%E3%82%A4%E3%83%97%E3%83%A9%E3%82%A4%E3%83%B3%E3%81%8C%E5%81%9C%E6%AD%A2%E3%81%99%E3%82%8B%E3%81%A8%E3%81%93%E3%82%8C%E3%82%82%E6%B6%88%E3%81%88%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3EIP%20%E4%B8%8A%E3%81%AE%E7%90%86%E7%94%B1%E3%81%8B%E3%82%89%E3%83%A2%E3%83%87%E3%83%AB%E3%82%92%E5%85%B1%E6%9C%89%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AF%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93%E3%81%8C%E3%80%81Kaggle%20%E3%81%AE%3CA%20href%3D%22https%3A%2F%2Fwww.kaggle.com%2Fmodels%2Fkaggle%2Fyolo-v5%3Fselect%3D1.tflite%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.kaggle.com%2Fmodels%2Fkaggle%2Fyolo-v5%3Fselect%3D1.tflite%3C%2FA%3E%E3%81%A7%E5%85%AC%E9%96%8B%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%20Yolov5%20tflite%20%E3%83%A2%E3%83%87%E3%83%AB%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%83%90%E3%82%B0%E3%82%92%E5%86%8D%E7%8F%BE%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3E%E5%95%8F%E9%A1%8C%E3%82%92%E5%86%8D%E7%8F%BE%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%3E%23%20Download%20the%20model%20from%20the%20Kagle%20website%20(https%3A%2F%2Fwww.kaggle.com%2Fmodels%2Fkaggle%2Fyolo-v5%3Fselect%3D1.tflite)%0A%23%20this%20provides%20with%20the%201.tflite%20file%0A%23%20Sorry%2C%20I%20did%20not%20find%20any%20way%20to%20get%20a%20direct%20download%20url%20on%20kaggle's%20website.%20You'll%20have%20to%20download%20it%20manually%20from%20you%20browser%20(no%20need%20to%20register%20on%20kaggle's%20website)%0A%0A%23%20Optionally%3A%20Enable%20VX%20Caching%0Aexport%20VIV_VX_CACHE_BINARY_GRAPH_DIR%3D%2Froot%2F.cache%2Fvxdelegate%2F%0Aexport%20VIV_VX_ENABLE_CACHE_GRAPH_BINARY%3D1%0A%0A%23%20Optionally%3A%20Enable%20nnshark%0Aexport%20GST_DEBUG%3D%22GST_TRACER%3A7%22%0Aexport%20GST_TRACERS%3D%22live%22%0A%0A%23%20Run%20the%20pipeline%0Agst-launch-1.0%20videotestsrc%20%5C%0A!%20video%2Fx-raw%2C%20format%3DYUY2%2C%20width%3D320%2C%20height%3D320%2C%20framerate%3D20%2F1%20%5C%0A!%20queue%20max-size-buffers%3D1%20max-size-bytes%3D0%20max-size-time%3D0%20leaky%3Ddownstream%20%5C%0A!%20videoconvert%20n-threads%3D4%20%5C%0A!%20video%2Fx-raw%2C%20format%3DRGB%20%5C%0A!%20tensor_converter%20set-timestamp%3Dfalse%20%5C%0A!%20tensor_transform%20mode%3Ddimchg%20option%3D0%3A2%20%5C%0A!%20tensor_transform%20mode%3Darithmetic%20option%3Dtypecast%3Afloat32%2Cdiv%3A255%20%5C%0A!%20tensor_filter%20framework%3Dtensorflow-lite%20model%3D1.tflite%20custom%3DDelegate%3AExternal%2CExtDelegateLib%3Alibvx_delegate.so%20%5C%0A!%20fakesink%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3E%E3%81%93%E3%81%AE%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%81%AF%E3%80%81%E6%9C%80%E5%88%9D%E3%81%AF%E3%83%91%E3%82%A4%E3%83%97%E3%83%A9%E3%82%A4%E3%83%B3%E3%81%8C%E7%B4%84%200.85%20FPS%20%E3%81%AE%E9%80%9F%E5%BA%A6%E3%81%A7%E6%8E%A8%E8%AB%96%E3%81%97%20(nnshark%20%E3%81%A7%E5%A0%B1%E5%91%8A%E3%81%95%E3%82%8C%E3%81%9F%E6%8E%A8%E8%AB%96%E6%99%82%E9%96%93%E3%81%AF%201.195%20%E7%A7%92)%E3%80%81GC8000%20%E3%81%AE%E8%B2%A0%E8%8D%B7%E3%81%AF%2010%20%EF%BD%9E%2040%25%20%E3%81%AB%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%E6%95%B0%E5%88%86%E5%BE%8C%20(%E7%A7%81%E3%81%AE%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%81%AF%E7%B4%84%202%20%E5%88%86%2030%20%E7%A7%92%E5%BE%8C)%E3%80%81%E3%83%90%E3%82%B0%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%97%E3%81%BE%E3%81%99%E3%80%82FPS%20%E3%81%8C%E7%B4%84%200.05FPS%20(%E6%8E%A8%E8%AB%96%E6%99%82%E9%96%93%2019.181%20%E7%A7%92)%20%E3%81%AB%E4%BD%8E%E4%B8%8B%E3%81%97%E3%80%81GC8000%20%E3%81%AE%E8%B2%A0%E8%8D%B7%E3%81%8C%20100%25%20%E3%81%A7%E5%81%9C%E6%AD%A2%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E3%81%93%E3%82%8C%E3%81%AF%E6%AC%A1%E3%81%AE%E3%82%88%E3%81%86%E3%81%ABCAN%E8%A6%B3%E5%AF%9F%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CUL%3E%3CLI%3Ennshark%E3%81%AE%E3%81%84%E3%81%9A%E3%82%8C%E3%81%8B%3C%2FLI%3E%3CLI%3E%E3%81%BE%E3%81%9F%E3%81%AF%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%83%A9%E3%82%A4%E3%83%B3%E3%81%8B%E3%82%89%E7%9B%B4%E6%8E%A5%3A%3CUL%3E%3CLI%3Egstreamer%E3%81%AE%E3%82%BF%E3%82%A4%E3%83%A0%E3%82%B9%E3%82%BF%E3%83%B3%E3%83%97%E3%81%AE%E9%80%B2%E8%A1%8C%E3%81%8C%E3%81%8B%E3%81%AA%E3%82%8A%E9%81%85%E3%81%84%E3%81%93%E3%81%A8%E3%81%8CCAN%3C%2FLI%3E%3CLI%3EGPU%E3%81%AE%E8%B2%A0%E8%8D%B7%E3%81%AF%E5%88%A5%E3%81%AE%E3%82%BF%E3%83%BC%E3%83%9F%E3%83%8A%E3%83%AB%E3%81%A7%E6%AC%A1%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%A7%E8%BF%BD%E8%B7%A1%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%3A%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Ewatch%20-n0.1%20cat%20%2Fsys%2Fkernel%2Fdebug%2Fgc%2Fload%3C%2FFONT%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%E3%81%94%E5%8D%94%E5%8A%9B%E3%81%84%E3%81%9F%E3%81%A0%E3%81%91%E3%82%8C%E3%81%B0%E5%B9%B8%E3%81%84%E3%81%A7%E3%81%99%E3%80%82%E3%82%88%E3%82%8D%E3%81%97%E3%81%8F%E3%81%8A%E9%A1%98%E3%81%84%E3%81%97%E3%81%BE%E3%81%99!%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2164658%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20i.MX8MP%20NPU%20crash%20after%20some%20delay%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164658%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E7%A7%81%E8%87%AA%E8%BA%AB%E3%81%AE%E8%B3%AA%E5%95%8F%E3%81%AB%E5%AF%BE%E3%81%99%E3%82%8B%E8%87%AA%E5%B7%B1%E5%9B%9E%E7%AD%94%3A%3C%2FP%3E%3CP%3ENPU%20%E3%81%AB%E8%B2%A0%E8%8D%B7%E3%81%8C%E9%9B%86%E4%B8%AD%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E3%83%97%E3%83%AD%E3%82%BB%E3%83%83%E3%82%B5%E3%81%8C%E3%81%8B%E3%81%AA%E3%82%8A%E7%86%B1%E3%81%8F%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E4%BD%95%E3%82%89%E3%81%8B%E3%81%AE%E7%90%86%E7%94%B1%E3%81%A7%E3%80%81%E7%A7%81%E3%81%AE%E9%96%8B%E7%99%BA%E3%83%9C%E3%83%BC%E3%83%89%E3%81%AB%E3%81%AF%E3%83%92%E3%83%BC%E3%83%88%E3%82%B7%E3%83%B3%E3%82%AF%E3%81%8C%E8%A3%85%E5%82%99%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%81%BE%E3%81%9B%E3%82%93%E3%81%A7%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3E%E3%83%97%E3%83%AD%E3%82%BB%E3%83%83%E3%82%B5%E3%81%AB%E3%83%92%E3%83%BC%E3%83%88%E3%82%B7%E3%83%B3%E3%82%AF%E3%82%92%E5%8F%96%E3%82%8A%E4%BB%98%E3%81%91%E3%82%8B%E3%81%A8%E3%80%81%E5%95%8F%E9%A1%8C%E3%81%AF%E8%A7%A3%E6%B1%BA%E3%81%97%E3%81%9F%E3%82%88%E3%81%86%E3%81%A7%E3%81%99%E3%80%82%E5%AE%9F%E7%A8%BC%E5%83%8D%E7%92%B0%E5%A2%83%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AF%E3%83%95%E3%82%A1%E3%83%B3%E3%81%AE%E8%BF%BD%E5%8A%A0%E3%82%82%E5%BF%85%E8%A6%81%E3%81%AB%E3%81%AA%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%E7%A2%BA%E8%AA%8D%E3%81%8C%E5%BF%85%E8%A6%81%3C%2FP%3E%3CP%3ESO%E3%80%81%E7%8F%BE%E6%99%82%E7%82%B9%E3%81%A7%E3%81%AF%E3%80%81%E7%A7%81%E3%81%AE%E5%95%8F%E9%A1%8C%E3%81%AF%E8%A7%A3%E6%B1%BA%E3%81%97%E3%81%9F%E3%81%A8%E8%80%83%E3%81%88%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%E9%A1%98%E3%82%8F%E3%81%8F%E3%81%B0%E3%80%81%E3%81%93%E3%81%AE%E6%8A%95%E7%A8%BF%E3%81%8C%E5%90%8C%E3%81%98%E5%95%8F%E9%A1%8C%E3%82%92%E6%8A%B1%E3%81%88%E3%81%A6%E3%81%84%E3%82%8B%E8%AA%B0%E3%81%8B%E3%81%AE%E5%8A%A9%E3%81%91%E3%81%ABCAN%E5%B9%B8%E3%81%84%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E