How to use engine in a process or a thread
jet-c-21 opened this issue · 4 comments
jet-c-21 commented
When I try to load the engine in a process, the engine predictor will not be loaded and the process will end directly.
And when I try to load the engine in a thread, I got following error:
pycuda._driver.LogicError: explicit_context_dependent failed: invalid device context - no currently active context?
Linaom1214 commented
What is your operating environment? If it is a notebook, please restart the kernel.
Linaom1214 commented
jet-c-21 commented
not notebook i am trying to run it on Jetson Nano locally
justincdavis commented
@jet-c-21
You need to create contexts for each engine you want to load. You can do this with:
cfx = cuda.Device(0).make_context()
and then wrap all your code which handles data and execution with:
cfx.push()
and cfx.pop()