# ZED X (gmsl) Not working with python multiprocessing

**URL:** <https://community.stereolabs.com/t/zed-x-gmsl-not-working-with-python-multiprocessing/2883>\
**Category:** Python\
**Tags:** python\
**Created:** [June 23, 2023, 12:22pm UTC](https://community.stereolabs.com/t/zed-x-gmsl-not-working-with-python-multiprocessing/2883 "2023-06-23T12:22:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirkiepower](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@dirkiepower](https://community.stereolabs.com/u/dirkiepower)\
**Post date:** [June 23, 2023, 12:22pm UTC](https://community.stereolabs.com/t/zed-x-gmsl-not-working-with-python-multiprocessing/2883/1 "2023-06-23T12:22:28Z")

</div>

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

```auto
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')

```

---

<div class="post-metadata">

**Author:** ![alassagne](https://community.stereolabs.com/user_avatar/community.stereolabs.com/alassagne/32/2428_2.png) [@alassagne](https://community.stereolabs.com/u/alassagne)\
**Post date:** [June 26, 2023, 2:29pm UTC](https://community.stereolabs.com/t/zed-x-gmsl-not-working-with-python-multiprocessing/2883/2 "2023-06-26T14:29:20Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![dirkiepower](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@dirkiepower](https://community.stereolabs.com/u/dirkiepower)\
**Post date:** [June 26, 2023, 2:32pm UTC](https://community.stereolabs.com/t/zed-x-gmsl-not-working-with-python-multiprocessing/2883/3 "2023-06-26T14:32:56Z")

</div>

Okay, thanks for the update.

---

<div class="post-metadata">

**Author:** ![dirkiepower](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/d/3ab097/32.png) [@dirkiepower](https://community.stereolabs.com/u/dirkiepower)\
**Post date:** [August 24, 2023, 3:02pm UTC](https://community.stereolabs.com/t/zed-x-gmsl-not-working-with-python-multiprocessing/2883/4 "2023-08-24T15:02:41Z")

</div>

Any news about this?

---

<div class="post-metadata">

**Author:** ![alassagne](https://community.stereolabs.com/user_avatar/community.stereolabs.com/alassagne/32/2428_2.png) [@alassagne](https://community.stereolabs.com/u/alassagne)\
**Post date:** [August 28, 2023, 10:33am UTC](https://community.stereolabs.com/t/zed-x-gmsl-not-working-with-python-multiprocessing/2883/5 "2023-08-28T10:33:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Phyrokar](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@Phyrokar](https://community.stereolabs.com/u/Phyrokar)\
**Post date:** [January 9, 2024, 10:46am UTC](https://community.stereolabs.com/t/zed-x-gmsl-not-working-with-python-multiprocessing/2883/6 "2024-01-09T10:46:19Z")

</div>

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

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

```

results in

`NO GPU DETECTED`
