Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

NCS2 on hotplug.d platform (openwrt)

skrywenko
Beginner
438 Views

hi there  i am wonder if any might have knowlege on why i can not get NCS2 to work on a hotplug platform( openwrt router - intel based ) I can get openvino to work with cpu and gna . just not MYRIAD.

i wrote a hotplug script to emulate udev but  does not seam to work - i know you have 3 entries in your myriad rules  but one entry never shows up so i can not determine the version number so I think it for a different  device .

```

#!/bin/sh

echo "${PRODUCT}" >> /tmp/usb_add
#fi
ncs2_PRODID="3e7/2485/1"

if [ "${PRODUCT}" = "${ncs2_PRODID}" ]; then
if [ "${ACTION}" = "add" ]; then
# echo "usb added highspeed" >> /tmp/usb_add


if [ -z ${DEVNAME} ]; then
echo "transistion" #>> /tmp/usb_add
else
echo "usb added highspeed" >> /tmp/usb_add
chmod 666 /dev/${DEVNAME}
echo "/dev/${DEVNAME}" >> /tmp/usb_add
# echo "setting prmission" >> /tmp/usb_add

fi

#
fi
fi

ncs2_PRODID="3e7/f63b/100"

if [ "${PRODUCT}" = "${ncs2_PRODID}" ]; then
if [ "${ACTION}" = "add" ]; then
# echo "usb added superspeed" >> /tmp/usb_add


if [ -z ${DEVNAME} ]; then
echo "transistion" #>> /tmp/usb_add
else
chmod 666 /dev/${DEVNAME}
echo "usb added superspeed" >> /tmp/usb_add
echo "/dev/${DEVNAME}" >> /tmp/usb_add
# echo "setting permission" >> /tmp/usb_add

fi
#
fi
fi

```

and it switching  permission on device when it switches from high speed  to super speed device. ( some part of the code is just debugging info)

and this is the output  i get from benchmark_app when running it

```

I: [ncAPI] [ 944074] [benchmark_app] ncDeviceOpen:926 ncDeviceOpen() XLinkBootRemote is running for 1.1.2-ma2480...

I: [ncAPI] [ 944305] [benchmark_app] ncDeviceOpen:944 ncDeviceOpen() XLinkBootRemote returned success X_LINK_SUCCESS for 1.1.2-ma2480
E: [ncAPI] [ 959305] [benchmark_app] ncDeviceOpen:1013 Failed to find booted device after boot
W: [ncAPI] [ 959305] [benchmark_app] ncDeviceOpen:1015 Device (1.1.2-ma2480) doesn't disappear after firmware loading
I: [ncAPI] [ 959305] [benchmark_app] destroyDeviceHandle:1651 Destroying device handler
I: [ncAPI] [ 959305] [benchmark_app] ncDeviceClose:1685 Handle already destroyed
[ ERROR ] Failed to allocate graph: MYRIAD device is not opened.

```

thank you for your time

0 Kudos
5 Replies
skrywenko
Beginner
401 Views

add info:

you can see it booting the device;  lsusb output:

```

Bus 001 Device 005: ID 214b:7000  USB2.0 HUB
Bus 002 Device 009: ID 03e7:f63b Intel Corporation VSC Loopback Device
Bus 002 Device 007: ID 05e3:0626 GenesysLogic USB3.1 Hub
```

and that the permissions are set

```

crw-rw----    1 root     root      189, 136 Jun 13 18:36 /dev/bus/usb/002/009
```

when I trace the device interactions on a  ubuntu loaded  computer . it appears identical.  from what i can tell

the dmesg output

```

[31815.429909] usb 1-1.2: new high-speed USB device number 23 using xhci_hcd
[31941.185788] usb 1-1.2: USB disconnect, device number 23
[31941.443153] usb 2-1.2: new SuperSpeed Gen 1 USB device number 9 using xhci_hcd
[31953.999446] usb 2-1.2: USB disconnect, device number 9
[31954.553395] usb 1-1.2: new high-speed USB device number 24 using xhci_hcd
```

plus i forgot to mention it running in a chroot enviroment  on openwrt. and other methods work such as cpu and gna . I have not tried  GPU as  it  has a gen 8  intel video processor (N3160).  I have an gen 9 N100 next week.  the project is an all in one low power (~5w)  in AI house controller.   router/firewall/vpn/IDS , zigbeehub(zigbee2mqtt)  automation(domoticz)  database NAS . voice controlled AI. zoneminder and currently I wanted to add in  video  facial recognition at entry points hence the myriad device

0 Kudos
Peh_Intel
Moderator
395 Views

Hi skrywenko,


According to Configurations for Intel® Neural Compute Stick 2, there are 3 rules in 97-myriad-sbboot.rules as follow.


SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0660", ENV{ID_MM_DEVICE_IGNORE}="1"

SUBSYSTEM=="usb", ATTRS{idProduct}=="2485", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0660", ENV{ID_MM_DEVICE_IGNORE}="1"

SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0660", ENV{ID_MM_DEVICE_IGNORE}="1"

 

Please try to include product ID,2150 as well.

 


Regards,

Peh


0 Kudos
skrywenko
Beginner
361 Views

thank you for the reply Peh

would you know the bcdDevice  # for  ID 2150 it never pops up in dmesg  whether running under openwrt  or in ubuntu20.04 or 22.04

 

as I can not get hotplug to work with out knowing it

```

[81686.170988] usb 6-1: New USB device found, idVendor=03e7, idProduct=2485, bcdDevice= 0.01
[81686.171002] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[81686.171011] usb 6-1: Product: Movidius MyriadX
[81686.171018] usb 6-1: Manufacturer: Movidius Ltd.
[81686.171023] usb 6-1: SerialNumber: 03e72485
[81762.135355] usb 6-1: USB disconnect, device number 30
[81762.468095] usb 7-1: new SuperSpeed USB device number 28 using xhci_hcd
[81762.493283] usb 7-1: New USB device found, idVendor=03e7, idProduct=f63b, bcdDevice= 1.00
[81762.493303] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[81762.493328] usb 7-1: Product: VSC Loopback Device
[81762.493335] usb 7-1: Manufacturer: Intel Corporation
[81762.493341] usb 7-1: SerialNumber: 3044F81051C6C2B900
[82082.321718] usb 1-3: USB disconnect, device number 19

```

also this line in my hotplug.d  script "echo "${PRODUCT}" >> /tmp/usb_add"  prints  every   dev/bus/usb  events .  to a log file called usb_add.

example out put to usb_add

```

5e3/610/6205     
5e3/610/6205     
5e3/610/6205     
5e3/610/6205     
5e3/610/6205     
3e7/2485/1     
usb added highspeed-0     
usb added highspeed-1     
/dev/bus/usb/001/022     
3e7/2485/1     
usb added highspeed-0     
3e7/2485/1     
3e7/2485/1     
3e7/2485/1     
3e7/2485/1     
3e7/f63b/100     
usb added superspeed-0     
usb added superspeed-1     
/dev/bus/usb/002/008     
3e7/f63b/100     
usb added superspeed-0     
3e7/f63b/100     
3e7/f63b/100     
3e7/f63b/100     
3e7/f63b/100     
3e7/2485/1     
usb added highspeed-0     
usb added highspeed-1     
/dev/bus/usb/001/023     
3e7/2485/1     
usb added highspeed-0     
3e7/2485/1

```

5e3/610/6205 is a usb device that was plugged in before the  myriad device was plugged in

once the myriad is plugged in ->3e7/2485/1  

3e7/2485/1      -> connected /detected
usb added highspeed-0       -> transition stage  when no dev/bus/usb has being allocated
usb added highspeed-1      ->  stage when /dev/bus/usb is allocated
/dev/bus/usb/001/022        ->  the  the setting of the permissions for MYRAID device (highspeed)

3e7/2485/1     
usb added highspeed-0       -transition to prepare for super speed  device
3e7/2485/1    ...

when MYRIAD device  switches over  to VCS loop back  -> 3e7/f63b/100

3e7/f63b/100     -> connected/detected
usb added superspeed-0      -> transition stage  when no dev/bus/usb has being allocated
usb added superspeed-1       ->  stage when /dev/bus/usb is allocated
/dev/bus/usb/002/008         ->    the setting of the permissions for VCS loopback  device (superspeed)
3e7/f63b/100     
usb added superspeed-0    ->  detransitioning stage back to highspeed

 

at no point does ID,2150  on the USB bus  display itself

0 Kudos
Peh_Intel
Moderator
298 Views

Hi skrywenko,


Thanks for the clarification. Yes, product ID:2150 is not required. 


To use MYRIAD plugin, please ensure that you download OpenVINO™ Runtime 2022.3 from the archive file and update the environment variables by running the setupvars.sh script before running Benchmark_app with NCS2.



Regards,

Peh


0 Kudos
Peh_Intel
Moderator
195 Views

Hi skrywenko,


This thread will no longer be monitored since we have provided answers. If you need any additional information from Intel, please submit a new question. 



Regards,

Peh


0 Kudos
Reply