BabitMF / bmf

Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.
https://babitmf.github.io/
Apache License 2.0
730 stars 60 forks source link

PyCUDA ERROR: The context stack was not empty upon module cleanup #107

Open zhangsong1234 opened 3 months ago

zhangsong1234 commented 3 months ago

graph.decode 输入的input_path为直播流时,当直播流突然断开,bmf 会coredump:

[2024-03-23 04:12:10.668] [info] node:c_ffmpeg_encoder 2 scheduler 1 [2024-03-23 04:14:31.322] [info] node id:0 decode flushing [2024-03-23 04:14:31.322] [info] node id:0 Process node end [2024-03-23 04:14:31.364] [info] node id:0 close node [2024-03-23 04:14:31.364] [info] node 0 close report, closed count: 1 [2024-03-23 04:14:31.364] [info] node id:1 eof received [2024-03-23 04:14:31.364] [info] node id:1 eof processed, remove node from scheduler [2024-03-23 04:14:31.365] [info] node id:1 process eof, add node to scheduler [2024-03-23 04:14:31.373] [info] node id:1 Process node end [2024-03-23 04:14:31.373] [info] node id:1 close node [2024-03-23 04:14:31.373] [info] node 1 close report, closed count: 2 [2024-03-23 04:14:31.373] [info] node id:2 eof received [2024-03-23 04:14:31.373] [info] node id:2 eof processed, remove node from scheduler [2024-03-23 04:14:31.374] [info] node id:2 process eof, add node to scheduler [2024-03-23 04:14:31.374] [info] node id:2 Process node end [2024-03-23 04:14:31.374] [info] node id:2 close node [2024-03-23 04:14:31.374] [info] node 2 close report, closed count:3 [2024-03-23 04:14:31.374] [info] schedule queue 0 start to join thread [2024-03-23 04:14:31.374] [info] schedule queue 0 thread quit [2024-03-23 04:14:31.375] [info] schedule queue 0 closed [2024-03-23 04:14:31.375] [info] schedule queue 1 start to join thread [2024-03-23 04:14:31.375] [info] schedule queue 1 thread quit [2024-03-23 04:14:31.375] [info] schedule queue 1 closed [2024-03-23 04:14:31.375] [info] all scheduling threads were joint

PyCUDA ERROR: The context stack was not empty upon module cleanup.

A context was still active when the context stack was being cleaned up. At this point in our execution, CUDA may already have been deinitialized, so there is no way we can finish cleanly. The program will be aborted now. Use Context.pop() to avoid this problem.

HuHeng commented 3 months ago

Could you please provide a minimal reproducible example?