ZED X (gmsl) Not working with python multiprocessing

Below code does not open the camera, is there a solution for this?

import cv2,time
import pyzed.sl as sl
from multiprocessing import Process



def main():

    init = sl.InitParameters()
    init.camera_resolution = sl.RESOLUTION.HD1200
    init.camera_fps = 30
    cam = sl.Camera()
    if not cam.is_opened():
        print("Opening ZED Camera...") 
    status = cam.open(init)
    if status != sl.ERROR_CODE.SUCCESS:
        print(repr(status))
        exit()
    runtime = sl.RuntimeParameters()
    mat = sl.Mat()
    cam.set_camera_settings(sl.VIDEO_SETTINGS.EXPOSURE, 200)
    key = ''
    while key != 113:  # for 'q' key
        err = cam.grab(runtime)
        #print(err)
        if err == sl.ERROR_CODE.SUCCESS:
            cam.retrieve_image(mat, sl.VIEW.LEFT)
            frame = mat.get_data()
            render  = cv2.resize(frame,(1280,720))
            cv2.imshow("ZED", render)
            key = cv2.waitKey(5)
        else:
            key = cv2.waitKey(5)
    cv2.destroyAllWindows()

    cam.close()
    print("\nFINISH")
if __name__ == "__main__":

    # Below does not work
    p =Process(target=main)  
    p.start()
    p.join()
    
    # Below works
    #main()

    print('exit main')

Hi,

We indeed have a bug with the Process python module. We are investigating why our ZED X seems not to work with such code.

Sorry for the inconvenience,

Okay, thanks for the update.

Any news about this?

Unfortunately, our ZED X still do not work with Python’s Process module. Sorry.

Does the ZED2i also not work? Because I have the same problem. Torch seems to be working fine but

if status != sl.ERROR_CODE.SUCCESS:
    print(repr(status))
    exit()

results in

NO GPU DETECTED