ZedX Missing Udev Rules

KERNEL=="i2c-13", GROUP="i2c", MODE="0666"

and potentially other udev rules are missing from the 5.0.1 SDK installer.

While building jetson docker images to run the ZedX cameras, I continuously ran into issues opening the cameras when the container was run as a non-root user. The behavior was inconsistent across computers and cameras which made it even harder to debug - I believe this is because different ports on the capture card use different i2c channels. I eventually narrowed it down to the missing udev rule

Problematic setup

> ll /dev/i2c-13
crw-rw---- 1 root 116 89, 13 Jun 10 10:24 /dev/i2c-13

Good setup

> ll /dev/i2c-9
crw-rw-rw- 1 root 116 89, 9 Jun 10 11:00 /dev/i2c-9

The installer only sets

# 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-11", GROUP="i2c", MODE="0666"
KERNEL=="i2c-12", 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"

after adding the i2c-13 rule and applying the rules the camera opened fine. If you could please test that all ports on the quad link card work with the jetson agx orin I’d appreciate it.

Hi @robots , what errors were you getting before the fix?

I have a similar issue and I want to understand if the two are actually the same:
using the ZED cameras (ZED X One GS) from inside a docker container is possible only as root, regardless using zedsdk or the nvarguscamerasrc gstreamer plugin.

The error manifested in a few different ways. Typically the camera was detected in the container, but when I went to open it, it would fail and print some error. Unfortunately I did a clean reset once I fixed the error so I no longer have the logs. ZedDiagnostic would also fail at this step if the i2c rule didn’t exist

- Running Camera Test Diagnostic : OK  
    Camera: ZED-X
    Firmware: 2001

If you upload the ZED_Diagnostic from inside the container I can likely diagnose the issue. You want to look at “Devices.GMSLLIST.path” ~= "path": "/dev/i2c-13". Then in “Log Kernel Trace.dmesg.I2C Trace list”, see If there is a trace for the channel from the path field. If that is missing you likely have this issue

It would be very useful if StereoLabs could provide an example of a dockerfile that runs the camera as non-root user. https://www.stereolabs.com/docs/get-started-with-zed-x-one/zed-x-one-and-docker is a good starting point, but I imagine a lot of people don’t want to run as root.

Additionally I’d be helpful to provide more specific volume mounts than just -v /dev/:/dev/ as it is not good practice to map that entire volume.

@robots, what ZED X Driver version are you using?
What Jetpack/L4T version?

stereolabs-zedlink-quad_1.3.0-SL-MAX96712-all-L4T36.4.0_arm64.deb.

My driver install script

#!/bin/bash
DRIVER_HOST="https://stereolabs.sfo2.cdn.digitaloceanspaces.com/utils/drivers/ZEDX/1.3.0/R36.4/"
DRIVER_FILE="stereolabs-zedlink-quad_1.3.0-SL-MAX96712-all-L4T36.4.0_arm64.deb"
wget "${DRIVER_HOST}${DRIVER_FILE}"
sudo dpkg -i "${DRIVER_FILE}"
rm "$DRIVER_FILE"

Diagnostic after applying new rule.
ZED_Diagnostic_Results (copy).json (18.3 KB)

To be more precise here’s a list of missing udev rules:

KERNEL=="i2c-13", GROUP="i2c", MODE="0666"
KERNEL=="i2c-14", GROUP="i2c", MODE="0666"
KERNEL=="i2c-15", GROUP="i2c", MODE="0666"
KERNEL=="i2c-16", GROUP="i2c", MODE="0666"

In any case, the HW team is verifying this odd behavior because there’s something not working as expected.
A fix will be released with the next patch version of the ZED SDK and ZED X Driver

1 Like

For reference I extracted the udev rules with

./ZED_SDK_Linux_Ubuntu.run --tar -x './99-slabs.rules'  > /dev/null 2>&1

I do this since the udev rules must be installed on the host, but we only install the SDK in the docker container.

Yes, this is correct.