UsingNet / nvjpeg-python

nvjpeg for python
MIT License
93 stars 24 forks source link

load NvJpeg not stable #1

Closed Gotta-C closed 3 years ago

Gotta-C commented 3 years ago

nj = NvJpeg()

SystemError: <class 'nvjpeg.NvJpeg'> returned NULL without setting an error run above 5 times and succeed once

TurboJPEG encode 0.004872s per image as 1 cpu core NvJpeg encode 0.001235s per image as 1 gpu

test encode is normal and can the lib support ThreadPoolExecutor or how to modify in nvjpeg-python.c to support that.

ald2004 commented 3 years ago

the same problem when run with multiprocessing, i guess nvjpeg handler needs some resource which conflict with other processes.

zeng-qinghui commented 3 years ago

Thanks @Gotta-C @ald2004 . I have fixed this bug in version 0.0.8. You can try the test file tests/test-with-multiprocessing.py that tests for running with ThreadPoolExecutor.