# Zed 2i in WSL ubuntu20.04

**URL:** <https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852>\
**Category:** Software\
**Tags:** windows\
**Created:** [June 19, 2023, 8:55am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852 "2023-06-19T08:55:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zed\_for\_sam](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/z/a698b9/32.png) [@zed\_for\_sam](https://community.stereolabs.com/u/zed_for_sam)\
**Post date:** [June 19, 2023, 8:55am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/1 "2023-06-19T08:55:39Z")

</div>

I want to use ZED 2i in wsl2.0 ubuntu20.04 system, but after install the sdk in wsl and connect the camera, the world viewer app can not work.  
could you plz help me.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [June 19, 2023, 9:26am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/2 "2023-06-19T09:26:42Z")

</div>

Hi @zed_for_sam  
Welcome to the Stereolabs community.

Did you install CUDA on WSL? (see [here](https://docs.nvidia.com/cuda/wsl-user-guide/index.html))  
Can you please run ZED\_Diagnostic and send me the report file that it generates?

---

<div class="post-metadata">

**Author:** ![zed\_for\_sam](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/z/a698b9/32.png) [@zed\_for\_sam](https://community.stereolabs.com/u/zed_for_sam)\
**Post date:** [June 20, 2023, 7:33am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/3 "2023-06-20T07:33:42Z")

</div>

I read the report file, it says the camera is not connected to computer.  
I follow the tips provide by microsoft that how can connect the usb device from window to WSL ubuntu(the link is [连接 USB 设备 | Microsoft Learn](https://learn.microsoft.com/zh-cn/windows/wsl/connect-usb)), but it seems not work.  
This is the report file:

```auto
{
    "AI Models": {
        "info": [
            "MULTI CLASS DETECTION is not optimized",
            "MULTI CLASS MEDIUM DETECTION is not optimized",
            "MULTI CLASS ACCURATE DETECTION is not optimized",
            "HUMAN BODY FAST DETECTION is not optimized",
            "HUMAN BODY MEDIUM DETECTION is not optimized",
            "HUMAN BODY ACCURATE DETECTION is not optimized",
            "HUMAN BODY 38 FAST DETECTION is not optimized",
            "HUMAN BODY 38 MEDIUM DETECTION is not optimized",
            "HUMAN BODY 38 ACCURATE DETECTION is not optimized",
            "HUMAN BODY 70 FAST DETECTION is not optimized",
            "HUMAN BODY 70 MEDIUM DETECTION is not optimized",
            "HUMAN BODY 70 ACCURATE DETECTION is not optimized",
            "PERSON HEAD DETECTION is not optimized",
            "PERSON HEAD ACCURATE DETECTION is not optimized",
            "REID ASSOCIATION is not optimized",
            "NEURAL DEPTH is not optimized"
        ]
    },
    "Camera Test": {
        "InternalDevicesCount": 1,
        "ZEDCount": 0,
        "error": [
            "<b>Camera not detected</b> <br/> Make sure the camera is plugged in or try another USB 3.0 port."
        ]
    },
    "Devices": {
        "CorruptedFirmware": false,
        "USBList": [
            {
                "USBMode": 3,
                "USB_path": "/1",
                "bDescriptorType": 1,
                "bDeviceProtocol": 1,
                "bLength": 18,
                "bMaxPacketSize0": 9,
                "bNumConfigurations": 1,
                "bcdDevice": "1.0",
                "bcdUSB": "3.0",
                "bcdUSBClass": 239,
                "bcdUSBSubClass": 2,
                "busNumber": 2,
                "device": "ZED2i",
                "iManufacturer": 1,
                "iProduct": 2,
                "iSerial": 4,
                "idProduct": "0xf880",
                "idVendor": "0x2b03"
            }
        ],
        "USBMode": 3,
        "ZED Camera Module Detected": 63616,
        "ZEDDetected": true,
        "notTested": [
            "Please connect a camera to test the USB connection."
        ]
    },
    "Graphics Card": {
        "deviceCount": 1,
        "deviceDriverVersion": 11080,
        "devices": [
            {
                "arch": "Ampere",
                "computeCapability": "8.6",
                "cores": 6144,
                "name": "NVIDIA GeForce RTX 3080 Laptop GPU",
                "totalMemoryBytes": "17179344896",
                "totalMemoryMB": 16383.5
            }
        ],
        "initResult": 0,
        "valid": [
            "<b>Graphics card: </b> NVIDIA GeForce RTX 3080 Laptop GPU"
        ]
    },
    "Processor": {
        "OS": "Ubuntu 20.04.6 LTS ",
        "avxSupported": true,
        "coreCount": "16",
        "cpu": " AMD Ryzen 9 5900HX with Radeon Graphics",
        "datetime": "2023-06-20 03:26:38 PM",
        "hyperThreading": "1",
        "motherboard": ", ",
        "ramCapacity": "16.695714",
        "ramUsage": "",
        "ramUsed": "3.714306",
        "threadCount": "32",
        "valid": [
            "<b>Processor: </b> AMD Ryzen 9 5900HX with Radeon Graphics"
        ]
    },
    "ZED SDK": {
        "CUDA Toolkit version": "V11.8.89 -->located in /usr/local/cuda-11.8/bin/nvcc",
        "CUDA loading": false,
        "GPU Driver Version": "Driver Version : 522.25",
        "GPU Performance": " Performance State : P8",
        "ZED SDK Version (Diag)": "4.0.3",
        "ZED SDK Version (RT)": "4.0.3",
        "ai": {
            "checkAI": true,
            "cudaVersion": 11080,
            "cudnnCudartVersion": 11080,
            "cudnnVersion": 8600,
            "cudnnVersionExpected": 8600,
            "tensorVersion": 8501
        },
        "binFiles": [
            "libsl_ai.so",
            "libsl_zed.so",
            "libsl_zed_static.a"
        ],
        "resourcesFiles": [
        ],
        "resourcesFilesExpected": [
            "objects_performance_3.0"
        ],
        "valid": [
            "<b>ZED SDK version:</b> 4.0.3",
            "<b>CUDA version:</b> V11.8.89"
        ]
    }
}

```

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [June 20, 2023, 8:58am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/4 "2023-06-20T08:58:54Z")

</div>

It seems that it can detect the UVC module (video) correctly, but not the HID module (sensors).  
This can be a permissions problem normally handles by udev on Ubuntu.  
Can you try to run the Diagnostic with `sudo` too see if it solves?

---

<div class="post-metadata">

**Author:** ![zed\_for\_sam](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/z/a698b9/32.png) [@zed\_for\_sam](https://community.stereolabs.com/u/zed_for_sam)\
**Post date:** [June 21, 2023, 12:58am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/5 "2023-06-21T00:58:16Z")

</div>

Thank you Myzhar, I run the Diagnostic with sudo, but the problem seems still there.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [June 21, 2023, 8:37am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/6 "2023-06-21T08:37:33Z")

</div>

Can you copy and paste the output of the commands:  
`$ lsusb -d 2b03:`  
`$ lsusb -d 2b03: -t`  
`$ lsusb -d 2b03: -t -v`

Thank you

---

<div class="post-metadata">

**Author:** ![zed\_for\_sam](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/z/a698b9/32.png) [@zed\_for\_sam](https://community.stereolabs.com/u/zed_for_sam)\
**Post date:** [June 21, 2023, 9:38am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/7 "2023-06-21T09:38:14Z")

</div>

hi, the output of the commands is :

```auto
sam@DESKTOP-OT529I6:~$ lsusb -d 2b03:
Bus 002 Device 005: ID 2b03:f880 Technologies, Inc. ZED 2i

```

```auto
sam@DESKTOP-OT529I6:~$ lsusb -d 2b03: -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 5000M
    |__ Port 1: Dev 5, If 0, Class=Video, Driver=, 5000M
    |__ Port 1: Dev 5, If 1, Class=Video, Driver=, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 480M

```

```auto
sam@DESKTOP-OT529I6:~$ lsusb -d 2b03: -t -v
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 1: Dev 5, If 0, Class=Video, Driver=, 5000M
        ID 2b03:f880  
    |__ Port 1: Dev 5, If 1, Class=Video, Driver=, 5000M
        ID 2b03:f880  
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=vhci_hcd/8p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub

```

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [June 21, 2023, 9:46am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/8 "2023-06-21T09:46:02Z")

</div>

Good, this confirms that the HID module is not initialized.  
You should get something like this:

```auto
$ lsusb -d 2b03:
Bus 002 Device 004: ID 2b03:f880 STEREOLABS ZED 2i
Bus 001 Device 013: ID 2b03:f881 STEREOLABS ZED-2i HID INTERFACE

```

Can you please confirm that the camera is correctly working by using it with Windows (no WSL) or Ubuntu?  
If it works correctly than you must understand why the HID module (that is over USB2) is not correctly enumerated under WSL.

---

<div class="post-metadata">

**Author:** ![zed\_for\_sam](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/z/a698b9/32.png) [@zed\_for\_sam](https://community.stereolabs.com/u/zed_for_sam)\
**Post date:** [June 21, 2023, 9:50am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/9 "2023-06-21T09:50:02Z")

</div>

the camera works very well in windows, thank you for your help, I will try to check the reason.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [June 21, 2023, 9:51am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/10 "2023-06-21T09:51:46Z")

</div>

That’s a good starting point. Please keep this thread updated so other WSL users can contribute.

---

<div class="post-metadata">

**Author:** ![nyrjan](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/n/6de8d8/32.png) [@nyrjan](https://community.stereolabs.com/u/nyrjan)\
**Post date:** [September 12, 2023, 1:00pm UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/11 "2023-09-12T13:00:16Z")

</div>

Hi there, its been a while, but I have the same issue,  
@zed_for_sam did you managed this issue, if so, how exactly?

I added it in Power shell

 ![изображение](https://community.stereolabs.com/uploads/default/original/2X/a/aa4332860e66a38f47a939ebfd4b00f508e52891.png)

and this I got on ubuntu20.04

 ![изображение](https://community.stereolabs.com/uploads/default/original/2X/b/b049432eb7c67a6e6c966d00fd44336136754be6.png)

But, no camera conected in any ZED app, here is diagnostic log file  
[ZED\_Diagnostic\_Results.json](https://community.stereolabs.com/uploads/short-url/2PC7DgCxQXC2TUHTuxm0QFRnB0Y.json) (5.4 KB)  
Here is log from nvidia-smi from WSL ubuntu 20.04

 ![изображение](https://community.stereolabs.com/uploads/default/original/2X/e/e67d0b09c416dd270b705a06723a8b903a26ce7e.png)

@Myzhar would you please look at it, might be you have a fix solution

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [September 12, 2023, 3:34pm UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/12 "2023-09-12T15:34:04Z")

</div>

Can you check the udev configuration?  
Have you tried to run the apps with “sudo”?  
If that works it means that there is a permission problem

---

<div class="post-metadata">

**Author:** ![nyrjan](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/n/6de8d8/32.png) [@nyrjan](https://community.stereolabs.com/u/nyrjan)\
**Post date:** [September 12, 2023, 4:34pm UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/13 "2023-09-12T16:34:18Z")

</div>

I can’t find it in /dev,  
At least I am not sure which from the list was assigned to the zed usb camera.  
How do I know what is the path for the device so I can check with udevadm?

 ![изображение](https://community.stereolabs.com/uploads/default/original/2X/3/3818725670d05ad67827a16e839a8a54ef8082bf.png)

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [September 13, 2023, 1:00pm UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/14 "2023-09-13T13:00:15Z")

</div>

The ZED cameras create two devices:

- UVC → Camera frame streaming over USB3
- HID → Sensors data streaming over USB2

If the `udev` permissions are not correctly set the access to HID data is blocked.  
That’s why the ZED SDK normally installs the file `/etc/udev/rules.d/99-slabs.rules` to get the right permissions (and other features).  
You should understand how `udev` works in WSL and how to get the correct access permissions.

---

<div class="post-metadata">

**Author:** ![bblumberg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/bblumberg/32/93_2.png) [@bblumberg](https://community.stereolabs.com/u/bblumberg)\
**Post date:** [October 12, 2023, 8:38pm UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/15 "2023-10-12T20:38:13Z")

</div>

Has anyone reported being able to get the zed cameras to work in wsl? cameras in wsl do seem problematic.

bb

---

<div class="post-metadata">

**Author:** ![bblumberg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/bblumberg/32/93_2.png) [@bblumberg](https://community.stereolabs.com/u/bblumberg)\
**Post date:** [October 13, 2023, 2:05am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/16 "2023-10-13T02:05:54Z")

</div>

So, I am not having any luck using a zed in wsl. In my case I am using the zed docker image stereolabs/zed:4.0-devel-cuda12.1-ubuntu20.04, and have the same issue of not seeing the HID, if I follow the comments above.

But, in my case, usbipd wsl attach is failing to attach the HID device (so not surprising that it doesn’t show up in wsl either.)

Any help would be appreciated since the alternative is dual boot.

usbipd wsl list  
1-5 2b03:f681 USB Input Device Not attached  
1-9 0db0:62a4 Realtek USB Audio, USB Input Device Not attached  
1-13 1462:7e03 USB Input Device Not attached  
1-14 8087:0033 Intel(R) Wireless Bluetooth(R) Not attached  
1-21 2b03:f682 ZED-M Not attached  
3-4 046d:c534 USB Input Device Not attached

PS C:\Windows\System32\> usbipd wsl attach --busid 1-5  
usbipd: info: Using default WSL distribution ‘Ubuntu-22.04’; specify the ‘–distribution’ option to select a different one.  
usbip: error: Attach Request for 1-5 failed - Device busy (exported)

usbipd: error: Failed to attach device with busid ‘1-5’.

Nosing around on the web it seems that something on the windows side is “using” the device but no clue which one, and I don’t have zed installed on the windows side.

---

<div class="post-metadata">

**Author:** ![bblumberg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/bblumberg/32/93_2.png) [@bblumberg](https://community.stereolabs.com/u/bblumberg)\
**Post date:** [October 16, 2023, 4:13pm UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/17 "2023-10-16T16:13:47Z")

</div>

Another issue as part of getting the zed to work on WSL. Because of warnings about updating CUDA on wsl, unless you are using a special version for wsl, I downloaded CUDA 12. 2 for wsl from nvidia. The zed installer finds it, and continues with the install without installing 12.1. BUT, when I bring up the ZED\_Diagnostic, it complains about CUDA 12.1 not being present.

---

<div class="post-metadata">

**Author:** ![thandal](https://community.stereolabs.com/user_avatar/community.stereolabs.com/thandal/32/2078_2.png) [@thandal](https://community.stereolabs.com/u/thandal)\
**Post date:** [November 3, 2023, 4:54pm UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/18 "2023-11-03T16:54:36Z")

</div>

It looks like part of the problem is that the WSL2 kernels don’t have usb camera support compiled in – which means that /dev/video\* isn’t available. This video shows pretty good instructions, but I haven’t tried it yet: [https://www.youtube.com/watch?v=t\_YnACEPmrM](https://www.youtube.com/watch?v=t_YnACEPmrM)

---

<div class="post-metadata">

**Author:** ![thandal](https://community.stereolabs.com/user_avatar/community.stereolabs.com/thandal/32/2078_2.png) [@thandal](https://community.stereolabs.com/u/thandal)\
**Post date:** [November 3, 2023, 7:29pm UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/19 "2023-11-03T19:29:12Z")

</div>

So I did build the WSL2 kernel with usb camera support (following the instructions above), and now after attaching the two usb devices using usbipd I see /dev/video0 and video1 and can get guvcview to work… but not ZED\_Sensors or ZED\_Depth\_Viewer (though in the gui they both seem to detect the ZED camera’s serial number). For example:

```auto
$ lsusb
Bus 002 Device 004: ID 2b03:f880 STEREOLABS ZED 2i
Bus 001 Device 004: ID 2b03:f881 STEREOLABS ZED-2i HID INTERFACE

$ ls /dev/video*
/dev/video0 /dev/video1

$ ZED_Depth_Viewer
[ZED Depth Viewer] Failed to create directory to save images: /home/than/Documents/ZED
in bool ImageHandler::initialize(sl::Mat&) : Err [999]: unknown error.
in bool ImageHandler::initialize(sl::Mat&) : Err [400]: invalid resource handle.
in bool ImageHandler::initialize(sl::Mat&) : Err [400]: invalid resource handle.
in bool ImageHandler::initialize(sl::Mat&) : Err [400]: invalid resource handle.
in bool ImageHandler::initialize(sl::Mat&) : Err [999]: unknown error.
in bool ImageHandler::initialize(sl::Mat&) : Err [400]: invalid resource handle.
in bool ImageHandler::initialize(sl::Mat&) : Err [400]: invalid resource handle.
in bool ImageHandler::initialize(sl::Mat&) : Err [400]: invalid resource handle.

$ ZED_Sensor_Viewer
can't claim interface 0: -6
can't claim interface 0: -6
can't claim interface 0: -6

```

---

<div class="post-metadata">

**Author:** ![Dheeraj](https://community.stereolabs.com/user_avatar/community.stereolabs.com/dheeraj/32/3671_2.png) [@Dheeraj](https://community.stereolabs.com/u/Dheeraj)\
**Post date:** [November 18, 2024, 8:17am UTC](https://community.stereolabs.com/t/zed-2i-in-wsl-ubuntu20-04/2852/20 "2024-11-18T08:17:42Z")

</div>

![image](https://community.stereolabs.com/uploads/default/original/2X/9/9453ced46ba0287051d6d3146ae6a42b4b59c285.png)

I am working in wsl2 on ubuntu 20, using usbipd, on an alienware.
