CAMERA NOT DETECTED in WSL2 Ubuntu 22.04

Hello everyone,

I am using ZED with docker in WSL2 (Ubuntu 22.04) but the camera is not detected.

Now I list all the steps I took:

  • I followed the official documentation (How to Install ZED SDK with Docker on Linux | Stereolabs)

  • I installed the CUDA Toolkit version 12.2 for WSL-Ubuntu.

  • I downloaded stereolabs/zed:4.0-devel-cuda12.1-ubuntu22.04 repository
    docker pull stereolabs/zed:4.0-devel-cuda12.1-ubuntu22.04

  • I attached the ZED 2i device to WSL with the command (from PowerShell):
    usbipd attach --busid <BUSID>

  • I ran the docker image with the command (from Linux terminal):
    docker run -it --gpus all --privileged stereolabs/zed:4.0-devel-cuda12.1-ubuntu22.04

  • once inside the container, I launch python and when I launch the commands:

import pyzed.sl as sl
zed = sl.Camera()
err = zed.open()
print(err)

I get the message
CAMERA NOT DETECTED

Here on the forum I found a similar topic but for Ubuntu 20.04 and it doesn’t have a solution to the problem (Zed 2i in WSL ubuntu20.04 - #3 by zed_for_sam).

I specify that in Windows the camera works correctly.

I hope someone can help me.
Thanks


Setup

  • Camera model: ZED 2i
  • OS: Windows 10 (WSL2: Ubuntu 22.04.3 LTS)
  • GPU: GeForce RTX 3060
  • CUDA version: 12.2
  • ZED SDK version: 4.0

Hi @icemanXVI
Welcome to the Stereolabs Community.

Please follow the thread on this topic:

I have tried out also to work with WSL2 and ZED camera.
I used the guide here and followed what has been mentioned in this link:

So the usb is identified in WSL2 but still does not even managed to turn on the camera (the blue LED lamp never turns on).

$ lsusb
Bus 002 Device 007: ID 2b03:f880 STEREOLABS ZED 2i
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

updating of udev access as mentioned in the above link also did not helped.
no success so far :frowning:

You still miss the device 2b03:f881 STEREOLABS ZED 2i HID that provides the sensors interface through USB2.
This is why you still cannot open the camera.

Hello Myzhar,

I am facing the same issue.
Everything well installed on WSL2 Ubuntu 20.04.

I managed also to attached ZED USB with usbipd and got it detected on Ubuntu, but Zed SDK is still not able to detect it

I got both 2b03:f880 ZED 2i and 2b03:f881 ZED 2i HID

Any idea ?
Thank you !

Here is below the report from ZED_Diagnostic:

{
    "AI Models": {
        "valid": [
            "MULTI CLASS DETECTION is optimized",
            "MULTI CLASS MEDIUM DETECTION is optimized",
            "MULTI CLASS ACCURATE DETECTION is optimized",
            "HUMAN BODY FAST DETECTION is optimized",
            "HUMAN BODY MEDIUM DETECTION is optimized",
            "HUMAN BODY ACCURATE DETECTION is optimized",
            "HUMAN BODY 38 FAST DETECTION is optimized",
            "HUMAN BODY 38 MEDIUM DETECTION is optimized",
            "HUMAN BODY 38 ACCURATE DETECTION is optimized",
            "PERSON HEAD DETECTION is optimized",
            "PERSON HEAD ACCURATE DETECTION is optimized",
            "REID ASSOCIATION is optimized",
            "NEURAL DEPTH is optimized"
        ]
    },
    "Camera Test": {
        "InternalDevicesCount": 2,
        "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,
        "MCUDetected": true,
        "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": 2,
                "USB_path": "/1",
                "bDescriptorType": 1,
                "bDeviceProtocol": 0,
                "bLength": 18,
                "bMaxPacketSize0": 64,
                "bNumConfigurations": 1,
                "bcdDevice": "3.9",
                "bcdUSB": "2.0",
                "bcdUSBClass": 0,
                "bcdUSBSubClass": 0,
                "busNumber": 1,
                "device": "ZED2i MCU",
                "iManufacturer": 1,
                "iProduct": 2,
                "iSerial": 3,
                "idProduct": "0xf881",
                "idVendor": "0x2b03"
            }
        ],
        "USBMode": 3,
        "ZED Camera Module Detected": 63616,
        "ZED MCU Module Detected": 63617,
        "ZEDDetected": true,
        "notTested": [
            "Please connect a camera to test the USB connection."
        ]
    },
    "Graphics Card": {
        "deviceCount": 1,
        "deviceDriverVersion": 12030,
        "devices": [
            {
                "arch": "Ada Lovelace",
                "computeCapability": "8.9",
                "cores": 7424,
                "name": "NVIDIA GeForce RTX 4080 Laptop GPU",
                "totalMemoryBytes": "12878086144",
                "totalMemoryMB": 12281.5
            }
        ],
        "glx_info": "OpenGL vendor string: Microsoft Corporation\nOpenGL renderer string: D3D12 (NVIDIA GeForce RTX 4080 Laptop GPU)\nOpenGL core profile version string: 3.3 (Core Profile) Mesa 21.2.6\nOpenGL core profile shading language version string: 3.30\nOpenGL core profile context flags: (none)\nOpenGL core profile profile mask: core profile\nOpenGL core profile extensions:\nOpenGL version string: 3.1 Mesa 21.2.6\nOpenGL shading language version string: 1.40\nOpenGL context flags: (none)\nOpenGL extensions:\nOpenGL ES profile version string: OpenGL ES 3.0 Mesa 21.2.6\nOpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00\nOpenGL ES profile extensions:\n",
        "initResult": 0,
        "valid": [
            "<b>Graphics card: </b> NVIDIA GeForce RTX 4080 Laptop GPU"
        ]
    },
    "Processor": {
        "OS": "Ubuntu 20.04.6 LTS ",
        "avxSupported": true,
        "coreCount": "32",
        "cpu": " 13th Gen Intel(R) Core(TM) i9-13950HX",
        "datetime": "2023-12-22 12:16:21",
        "hyperThreading": "1",
        "motherboard": ", ",
        "ramCapacity": "8.170373",
        "ramUsage": "",
        "ramUsed": "1.812324",
        "threadCount": "64",
        "valid": [
            "<b>Processor: </b>  13th Gen Intel(R) Core(TM) i9-13950HX"
        ]
    },
    "ZED SDK": {
        "CUDA Toolkit version": "V12.1.105 -->located in /usr/local/cuda-12.1/bin/nvcc",
        "CUDA loading": false,
        "GPU Driver Version": "Driver Version                            : 546.01",
        "GPU Performance": "    Performance State                     : P8",
        "ZED SDK Version (Diag)": "4.0.8",
        "ZED SDK Version (RT)": "4.0.8",
        "ai": {
            "checkAI": true,
            "cudaVersion": 12010,
            "cudnnCudartVersion": 12000,
            "cudnnVersion": 8801,
            "cudnnVersionExpected": 8801,
            "tensorVersion": 8600
        },
        "binFiles": [
            "libsl_ai.so",
            "libsl_zed.so",
            "libsl_zed_static.a"
        ],
        "resourcesFiles": [
            "neural_depth_2.0.model",
            "objects_accurate_3.2.model",
            "objects_medium_3.2.model",
            "objects_performance_3.2.model",
            "person_head_accurate_2.4.model",
            "person_head_performance_2.4.model",
            "person_reid_1.4.model",
            "skeleton_body18_3.2.model",
            "skeleton_body38_3.5.model"
        ],
        "resourcesFilesExpected": [
            "objects_performance_3.2"
        ],
        "valid": [
            "<b>ZED SDK version:</b> 4.0.8",
            "<b>CUDA version:</b> V12.1.105"
        ]
    }
}

Hi @RayanReply
Welcome to the Stereolabs community.

Have you checked the udev settings as explained in this post?

Hi @Myzhar,

Thanks for Welcoming me and for your feedback :slight_smile:

Yes I did, I grantted all persmission also as found in this tutorial:

I did not really get the explenation from the other post, as it is mentionning udev settings + also building wsl2 kernel to make it compatible with usb service

Below the slabs.rules file:

# HIDAPI/libusb
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f681", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f781", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f881", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0666"

# HIDAPI/hidraw
KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f681", MODE="0666"
KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f781", MODE="0666"
KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f881", MODE="0666"
KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0666"

# Kernel I2C //For ZED-GMSL
KERNEL=="i2c-0", GROUP="i2c", MODE="0666"
KERNEL=="i2c-1", GROUP="i2c", MODE="0666"
KERNEL=="i2c-2", GROUP="i2c", MODE="0666"
KERNEL=="i2c-3", GROUP="i2c", MODE="0666"
KERNEL=="i2c-4", GROUP="i2c", MODE="0666"
KERNEL=="i2c-5", GROUP="i2c", MODE="0666"
KERNEL=="i2c-6", GROUP="i2c", MODE="0666"
KERNEL=="i2c-7", GROUP="i2c", MODE="0666"
KERNEL=="i2c-8", GROUP="i2c", MODE="0666"
KERNEL=="i2c-9", GROUP="i2c", MODE="0666"
KERNEL=="i2c-10", GROUP="i2c", MODE="0666"
KERNEL=="i2c-30", GROUP="i2c", MODE="0666"
KERNEL=="i2c-31", GROUP="i2c", MODE="0666"
KERNEL=="i2c-32", GROUP="i2c", MODE="0666"
KERNEL=="i2c-33", GROUP="i2c", MODE="0666"
KERNEL=="i2c-34", GROUP="i2c", MODE="0666"
KERNEL=="i2c-35", GROUP="i2c", MODE="0666"
KERNEL=="i2c-36", GROUP="i2c", MODE="0666"
KERNEL=="i2c-37", GROUP="i2c", MODE="0666"

# blacklist for usb autosuspend
# http://kernel.org/doc/Documentation/usb/power-management.txt
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f780", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f781", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f881", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0424", ATTRS{idProduct}=="2512", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f880", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f582", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f682", TEST=="power/control", ATTR{power/control}="on"

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f780", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f781", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f881", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0424", ATTRS{idProduct}=="2512", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f880", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f582", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f682", TEST=="power/autosuspend", ATTR{power/autosuspend}="-1"

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f780", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f781", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f881", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0424", ATTRS{idProduct}=="2512", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f880", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f582", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f682", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="-1"

I have followed this video: https://www.youtube.com/watch?v=t_YnACEPmrM

Managed to move on but here is below diagnostic status:

Still I manage to get some visual of the point cloud on rviz display:

Can you share the diagnostic report?
This kind of error normally means that there is a hardware connection problem, not a software problem.

ZED_Diagnostic_Results_20240110_usb.json (5.6 KB)

Hello Myzhar,

Here is the diagnostic report attached.

I ran RTB_Map example in // of the diagnostic. Even with the camera running, the ZED Diagnostic app is not able to detect it.
In my testing, everything looks ok but I experienced some lack of stability, the camera is randomly dettaching, and maybe this is the issue.
Maybe it is coming from the USB, does the ZED needs a specific USB port ?
The unstability may come from USB power supply ?..

I am also attaching a screenshot to show:



Thank you for your support !

@RayanReply I need the JSON diagnostic report file generated by the ZED Diagnostic tool.
It contains useful information to check camera and OS behaviors.
You must click on “SAVE” to generate the report file after the test.

Hello Myzhar,

The json file was attached at the very beginning of my previous post.
Please find it below:

ZED_Diagnostic_Results_20240110_usb.json (5.6 KB)

Thanks

The USB controller correctly enumerates the camera, but the UVC driver cannot identify it.
This normally happens when the udev rules are not correctly set.
Are you sure that the OS can correctly use the udev rules?
Can you try to run the ZED Diagnostic tool with sudo to see if the camera is correctly identify in this way?

Hi Myzhar,

I have tried with Sudo ZED_Diagnostic and got attached report:
ZED_Diagnostic_Results_SUDO.json (8.7 KB)

In the meantime I just checked USB caracteristics provided with usbipd connection from windows to wsl 2 and apparently 1 of the 2 interface is in USB 2.0 whereas ZED camera needs both USB interfaces in USB 3.0. This is a bit matching with the diagnostic results.
So maybe not related to udev rules

usb_check.txt (27.5 KB)

I think we are on the good track :slight_smile:

This is not correct. The UVC module (video stream) runs over USB3, while the HID module (sensor stream) runs over USB2. So your configuration is correct.

Both USB descriptors are good.

1 Like

The ZED Diagnostic report executed with sudo confirms that there is a permission issue. Indeed the camera can be correctly opened and data can be retrieved when using root permissions.

There are a few resolution/framerate configurations that are not available: HD1080@30, HD2K@15, and HD720@60. They are the configurations that require the more bandwidth, so I guess you have also a connectivity problem that can be generated by different causes:

  • different devices connected to the same USB3 channel that limit the available bandwidth
  • bad cable
  • cable extender
  • USB3 hub
1 Like

Thanks for the feedback!

Regarding the cable, it is directly plugged on the laptop using official ZED USB cable.
No hub neither extender is being used, so I would point out below cause:

  • different devices connected to the same USB3 channel that limit the available bandwidth

I will maybe go again within the udev rules configuration and give it a try.
If you have any link for a tutorial I should follow it would be great !

Unfortunately, we have no working guides for WSL2 because it’s not yet officially supported.
We have forum users who are working with ZED devices under WSL2, maybe they can help you with details.

1 Like

Ok, I will look through WSL2 udev rules.
It needs to be solves as due to this, some app of the SDK cannot run.
I can display camera, pointcloud and so on. But video record does not work, Depth Viewer also…

If I find a fix I will come back here and document.
Thanks again for the quick answers !