-
Notifications
You must be signed in to change notification settings - Fork 94
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
Could I share my CUDA context with a PyZEDCamera? #35
Comments
Hi, |
Hi, |
Hi, |
@oha08 I'm new to this and trying to figure out how to do the same (I need to run a DNN and query the ZED In the same process). Any code you can share? How exactly does one switch cuda contexts? Thanks! |
I made a tiny cython module to do this and it works! Thanks for the tip guys! |
@frk2 Hi, Your module looks pretty nice and simple enough for working! In my case, I'm using PyCUDA to create and push/pop my context. Because PyCUDA doesn't provide any interface to get the current context, I've selected to keep the context made by ZED stacked and push my context on top of it:
Your module enables more flexible control than this :) Thanks a lot! |
I was thinking of doing the same - but the bummer is that you can't pass a created context to either ZED or Pytorch (they both create one) and hence pycuda was useless since it doesn't let me get the current context. Thanks for the tip though definitely guided me in the right direction! |
@frk2 By default the ZED SDK creates a new context, but with the C++ SDK you can pass your own context to the ZED with InitParameters::sdk_cuda_ctx. |
@adujardin yup totally am aware - since im trying to use pytorch in the same process the simplest approach was to juggle contexts using pop and push from within python. Temporary approach till you guys add context passing through pycuda or similar. Thanks! |
Any update whether context sharing is possible with ZED camera and the python API? I'm trying to work with the ZED camera an CuPy an have probably encountered an issue related to this. |
Just to update on my solution for this issue. The ZED runs its own context internally and therefore processing images using CuPy should be handled in a different thread. My best solution relied on the ZED-TensorFlow example which worked pretty good. |
你好。我用的是zed相机,cuda是11.7, 运行get_python_api.py文件时,提示PermissionError: [Errno 13] Permission denied: 'C:\Program Files (x86)\ZED SDK\pyzed-3.8-cp39-cp39-win_amd64.whl',但是安装whl文件之后,继续重复出现这个错误,是什么原因导致的呢 |
Hello. I use a zed camera, and the cuda is 11.7. When I run the get_python_api.py file, I am prompted with permission error: [errno13] Permission denied:' C: \ \ Program files (x86) \ \ ZED SDK \ \ PYZED-3.8-CP39-CP39-Win-amd64.whl', but after installing the whl file, what causes this error to appear repeatedly? |
Though the ZED SDK provides a way to share my CUDA context with a ZED camera,
it seems that the current version of its python wrapper lacks it:
Is there any way to share my context with a PyZEDCamera?
I'm grad if ZED cameras could be used in CUDA applications developed on python.
The text was updated successfully, but these errors were encountered: