Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use engine in a process or a thread #102

Open
jet-c-21 opened this issue May 17, 2023 · 4 comments
Open

How to use engine in a process or a thread #102

jet-c-21 opened this issue May 17, 2023 · 4 comments

Comments

@jet-c-21
Copy link

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
Copy link
Owner

What is your operating environment? If it is a notebook, please restart the kernel.

@Linaom1214
Copy link
Owner

#88

@jet-c-21
Copy link
Author

not notebook i am trying to run it on Jetson Nano locally

@justincdavis
Copy link

justincdavis commented Aug 11, 2023

@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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants