Python Multiprocessing Bug fix?

Hello,

I would like to run two cameras in two different processes. Unfortunately, the ZED SDK throws in the program part

if status != sl.ERROR_CODE.SUCCESS:
    log(LogLevel.ERROR, repr(status))
    print(repr(status))
    exit()

the following error

NO GPU DETECTED

It looks like the problem has been going on for a while:

Are there any ideas on how to solve the problem or when a bug fix will come?

Edit:
I work on pyzed 4.0 and two ZED2i

Hi @Phyrokar
can you provide more details regarding your configuration and an example of code to replicate this behavior?

Hi @Phyrokar
can you provide more details regarding your configuration and an example of code to replicate this behavior?

[Discourse post]

Walter

Walter Lucetti
Senior Computer Engineer
SDK / Robotics / HW
Stereolabs Support

The pyzed SDK does not work with the python multiprocess.Process class. This has been recorded before, but never solved.

The Team has not yet found a working solution to this problem that only seems to affect ZED X cameras.
We are working hard to fix it and a solution will be provided as soon as possible.

Hello, I found a workaround for me.

Thank you

@PhyrokarIf the information is suitable for public sharing, please do so as it may benefit others in the community.

I changed the start method from multiprocessing in the main method to spawn:

mp.set_start_method('spawn', force=True)

Since ZED objects are not pickleable, I created two processes for the respective cameras that communicate via c_variables. With torch.multiprocessing you can also exchange images as tensors across processes.

Note: I work on two ZED2i cameras. So the problem regarding ZEDX is not solved.

1 Like

@Phyrokar Thank you for the helpful information.

1 Like