surya icon indicating copy to clipboard operation
surya copied to clipboard

Surya stalls - deadlock in batch_text_detection

Open FireMasterK opened this issue 1 year ago • 1 comments

For some reason, when you use process more than one image, surya/marker stalls permanently with 0% CPU and GPU utilization. This happens randomly, and I've got this stack trace when stopping the process with Ctrl + C:

File "/home/kavin/redacted/.venv/lib/python3.12/site-packages/surya/detection.py", line 136, in batch_text_detection
with ProcessPoolExecutor(max_workers=max_workers) as executor:
File "/home/kavin/.rye/py/[email protected]/lib/python3.12/concurrent/futures/_base.py", line 647, in exit
self.shutdown(wait=True)
File "/home/kavin/.rye/py/[email protected]/lib/python3.12/concurrent/futures/process.py", line 873, in shutdown
self._executor_manager_thread.join()
File "/home/kavin/.rye/py/[email protected]/lib/python3.12/threading.py", line 1147, in join
self._wait_for_tstate_lock()
File "/home/kavin/.rye/py/[email protected]/lib/python3.12/threading.py", line 1167, in _wait_for_tstate_lock
if lock.acquire(block, timeout):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

FireMasterK avatar Aug 04 '24 16:08 FireMasterK

Interesting, I haven't seen this before. Definitely sounds like some kind of deadlock situation. I'll see if I can reproduce.

VikParuchuri avatar Aug 06 '24 14:08 VikParuchuri