Closed maara-fieldtrip closed 3 years ago
It seems to happen much more often when called from in a thread, too - more like 4/5 times.
I'm trying to understand what's going on here - what is actually being set to NULL here? It's the NvJpeg python object not the m_handle inside it? The pointer returned from NvJpegPython_startUpEnv never seems to be NULL so what is?
It seems to be some kind of race condition because if I put a printf inside NvJpeg_init I never get the error.
A modification of the test-with-multiprocessing.py which reliably produces the error
from nvjpeg import NvJpeg
nj = NvJpeg() <--- add this line in immediately after import in the main thread
In fact it doesn't even need to run the threads at all. This is the full test case:
from nvjpeg import NvJpeg
nj = NvJpeg()
Gives the error ~50% of the time
I am also using version 0.0.9 and am seeing the same issue. I am also running with multiprocessing.
Here is the error: line 138, in init self.nj = NvJpeg() SystemError: <class 'nvjpeg.NvJpeg'> returned NULL without setting an error
I ran tests/test-with-multiprocessing.py, and it passed.
See pull request I made a fix but it's just sitting there
Thanks saulzar!
Zeng, when do you expect the release with this fix be available?
Thanks saulzar!
Zeng, when do you expect the release with this fix be available?
Thanks chrischengis! I have merged and released this fix.
Unfortunately I'm still seeing this in 0.0.9 when using in a ROS process, sometimes it errors out with:
SystemError: <class 'nvjpeg.NvJpeg'> returned NULL without setting an error
Most of the time runs, approximately 1/5 times I get this error on startup when I call
nvjpeg.NvJpeg()