frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

stream_ty_gn.py fails using ncsdk-2.05.00.02

Hi,
I have encountered the following problem.
When I try to run the stream_ty_gn.py (or the stream_ty_gn_threaded.py) example I get the following error:

[root@BC-30-17 stream_ty_gn]# python3 stream_ty_gn.py 
Running stream_ty_gn
Keys:
  'Q'/'q' to Quit
  'B'/'b' to inc/dec the Tiny Yolo box probability threshold
  'I'/'i' to inc/dec the Tiny Yolo box intersection-over-union threshold
  'G'/'g' to inc/dec the GoogLeNet probability threshold

E: [         0] resetAll:237    Failed to connect to stalled device

Traceback (most recent call last):
  File "stream_ty_gn.py", line 605, in <module>
    sys.exit(main())
  File "stream_ty_gn.py", line 469, in main
    gn_device.OpenDevice()
  File "../../ncapi2_shim/mvnc_simple_api.py", line 115, in OpenDevice
    self._api2_device.open()
  File "/usr/lib64/python3.6/site-packages/mvnc/mvncapi.py", line 448, in open
    raise Exception(Status(status))
Exception: Status.ERROR

To diagnose the problem further I opened python and tried the following:

[root@BC-30-17 stream_ty_gn_threaded]# python3
Python 3.6.5 (default, Apr 10 2018, 17:08:37) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mvnc import mvncapi
>>> device_list = mvncapi.enumerate_devices()
E: [         0] resetAll:237    Failed to connect to stalled device

>>> print(device_list)
[c_void_p(22608480), c_void_p(25160944)]
>>> device2 = mvncapi.Device(device_list[1])
>>> device2.open()
W: [         0] ncDeviceOpen:505    ncDeviceOpen() XLinkBootRemote returned error 3

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/site-packages/mvnc/mvncapi.py", line 448, in open
    raise Exception(Status(status))
Exception: Status.ERROR

I tried the same example on the ncsdk-1.12.00.01 and it works flawlessly.
Any help is appreciated.

EDIT

The same happens with the multistick_cpp example:

[root@BC-30-17 cpp]# ./multistick_cpp 
E: [         0] resetAll:237    Failed to connect to stalled device

Successfully opened NCS device at index 0!
W: [         0] ncDeviceOpen:505    ncDeviceOpen() XLinkBootRemote returned error 3

Error - ncDeviceOpen failed could not open the device at index 1, error: -2.

Comments

  • 11 Comments sorted by Votes Date Added
  • @mattdibi Hi. I tried running the samples you mentioned, but I was not able to duplicate the issue.

    It seems like the issue is occurring when you run examples with multiple NCS devices with NCSDK 2.05 (I'm assuming you have at least two devices). The issue seems to be the application is having issues opening the second device because it's stalled. Running other applications which use two devices will end with errors when trying to enumerate the devices. I recommend physically unplugging both NCS devices, inserting them into the system again, and trying to run the application once more.

  • @mattdibi Thank you for reporting this. I'm still investigating the issue. It seems that in your case anything with NCSDK 2.05.00.02 and using a second device is not working for you.

    I noticed that your hello_ncs executable was named differently vs the original. Did you modify the application to use two devices?
    Can you give more information about the system (hardware/OS/VM?) you are running the NCSDK on? Are you using a USB hub? Thanks.

  • @mattdibi Also after you run hello_ncs successfully, can you run the lsusb and dmesg command? I want to see if both devices are visible after running hello_ncs. Thanks.

  • @mattdibi Interesting. I didn't realize you were using multiple PCI-E NCS. The current version of the NCSDK only works with 1 PCI-E NCS device at the moment, although I'm not sure how you got it to work with NCSDK 1.12.

  • @Tome_at_Intel Hi, thank you for your prompt reply.

    I tried what you suggested. Nothing changed.
    I also tried to switch the modules (I happen to have three of them laying around) in case one of them was bad, without any change.
    I also tried different ports without luck.

    Considering that everything works using the NCSDK 1.12 I would take the hardware issue out of the equation.

    Any idea? Is there anything I can do to help diagnose the problem?

  • Upon further inspection it seems that the device stalling is a symptom rather than the cause of the problem.

    I ran the multistick example and obtained the usual error. Then I ran the hello_ncs_cpp a few times and obtained the follwing:

    [root@BC-30-17 intel_workspace]# ./hello_ncs2_cpp 
    E: [         0] resetAll:237    Failed to connect to stalled device
    
    Hello NCS! Device opened normally.
    Goodbye NCS!  Device Closed normally.
    NCS device working.
    [root@BC-30-17 intel_workspace]# ./hello_ncs2_cpp 
    Hello NCS! Device opened normally.
    Goodbye NCS!  Device Closed normally.
    NCS device working.
    

    It looks like that running the single module examples successfully resets the device.
    Then I ran the multistick example and obtained:

    [root@BC-30-17 intel_workspace]# ./ncappzoo-ncsdk2/apps/multistick_cpp/cpp/multistick_cpp 
    Successfully opened NCS device at index 0!
    W: [         0] ncDeviceOpen:533    failed to find device
    
    Error - ncDeviceOpen failed could not open the device at index 1, error: -2.
    
    

    Here the application hangs. I kill it and upon a following attempt I obtain:

    [root@BC-30-17 intel_workspace]# ./ncappzoo-ncsdk2/apps/multistick_cpp/cpp/multistick_cpp 
    E: [         0] resetAll:237    Failed to connect to stalled device
    
    Successfully opened NCS device at index 0!
    W: [         0] ncDeviceOpen:505    ncDeviceOpen() XLinkBootRemote returned error 3
    
    Error - ncDeviceOpen failed could not open the device at index 1, error: -2.
    

    Therefore I think the real problem occurs on the first run of the example, i.e. when I obtain the failed to find device error. In that instance the second module stalls.

  • @Tome_at_Intel after some playing around in the code following the error messages I uncommented the printf inside common/components/XLink/pc/UsbLinkPlatform.c:

    #else
        *fd = usblink_open(devPathWrite);
        if (*fd == 0)
        {
           /* could fail due to port name change */
           printf("fail\n");
           return -1;
        }
    //    dev = new fastmemDevice("usb");
    //    int usbInit = dev->fastmemInit();
        if(*fd)
            return 0;
        else
            return -1;
    #endif  /*USE_USB_VSC*/
    }
    

    and obtained the following:

    [root@BC-30-17 intel_workspace]# ./ncappzoo-ncsdk2/apps/multistick_cpp/cpp/multistick_cpp 
    Successfully opened NCS device at index 0!
    fail
    fail
    fail
    W: [         0] ncDeviceOpen:533    failed to find device
    
    Error - ncDeviceOpen failed could not open the device at index 1, error: -2.
    
    
    
  • @Tome_at_Intel
    I simply renamed the executable to make it more obvious it was for the NCSDK2 since I was testing both versions. I didn't modify the executable.

    System informations:

    [root@BC-30-17 ~]# cat /etc/os-release
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"
    
    [root@BC-30-17 ~]# lscpu
    Architecture:          x86_64
    CPU op-mode(s):        32-bit, 64-bit
    Byte Order:            Little Endian
    CPU(s):                8
    On-line CPU(s) list:   0-7
    Thread(s) per core:    2
    Core(s) per socket:    4
    Socket(s):             1
    NUMA node(s):          1
    Vendor ID:             GenuineIntel
    CPU family:            6
    Model:                 94
    Model name:            Intel(R) Core(TM) i7-6822EQ CPU @ 2.00GHz
    Stepping:              3
    CPU MHz:               900.024
    CPU max MHz:           2800,0000
    CPU min MHz:           800,0000
    BogoMIPS:              3984.00
    Virtualization:        VT-x
    L1d cache:             32K
    L1i cache:             32K
    L2 cache:              256K
    L3 cache:              8192K
    NUMA node0 CPU(s):     0-7
    Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 ibpb ibrs stibp dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp spec_ctrl intel_stibp
    

    No USB hub. I'm using the mPCI-E modules.

    As requested: lsusb output after successful hello_ncs_cpp

    [root@BC-30-17 cpp]# ./hello_ncs_cpp 
    Hello NCS! Device opened normally.
    Goodbye NCS!  Device Closed normally.
    NCS device working.
    [root@BC-30-17 cpp]# lsusb
    Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 005 Device 003: ID 03e7:2150 Intel Myriad VPU [Movidius Neural Compute Stick]
    Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 002: ID 03e7:2150 Intel Myriad VPU [Movidius Neural Compute Stick]
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 010: ID 0cf3:3004 Qualcomm Atheros Communications AR3012 Bluetooth 4.0
    Bus 001 Device 003: ID 04e2:1410 Exar Corp. XR21V1410 USB-UART IC
    Bus 001 Device 009: ID 046d:c062 Logitech, Inc. M-UAS144 [LS1 Laser Mouse]
    Bus 001 Device 008: ID 046a:0001 Cherry GmbH Keyboard
    Bus 001 Device 007: ID 0458:7089 KYE Systems Corp. (Mouse Systems) Genius FaceCam 320
    Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. Hub
    Bus 001 Device 004: ID 0424:4050 Standard Microsystems Corp. 
    Bus 001 Device 002: ID 0424:2640 Standard Microsystems Corp. USB 2.0 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

    dmesg output:

    [root@BC-30-17 cpp]# ./hello_ncs_cpp 
    Hello NCS! Device opened normally.
    Goodbye NCS!  Device Closed normally.
    NCS device working.
    [root@BC-30-17 cpp]# dmesg
    [  189.827752] usb 5-1: USB disconnect, device number 3
    [  190.057628] usb 6-1: new SuperSpeed USB device number 3 using xhci_hcd
    [  190.069562] usb 6-1: New USB device found, idVendor=03e7, idProduct=f63b
    [  190.069572] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  190.069578] usb 6-1: Product: VSC Loopback Device
    [  190.069583] usb 6-1: Manufacturer: Intel Corporation
    [  190.069588] usb 6-1: SerialNumber: DBB85DD574E608
    [  191.345638] usb 5-1: new high-speed USB device number 4 using xhci_hcd
    [  191.510429] usb 5-1: New USB device found, idVendor=03e7, idProduct=2150
    [  191.510439] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  191.510445] usb 5-1: Product: Movidius MA2X5X
    [  191.510450] usb 5-1: Manufacturer: Movidius Ltd.
    [  191.510456] usb 5-1: SerialNumber: 03e72150
    [  191.803573] xhci_hcd 0000:03:00.0: Cannot set link state.
    [  191.803592] usb usb6-port1: cannot disable (err = -32)
    [  191.803601] usb 6-1: USB disconnect, device number 3
    
  • @Tome_at_Intel Ok, this explains everything.

    Regarding the two PCI-E modules working with NCSDK 1.12: they worked out-of-the-box. I simply ran the stream_ty_gn example and achived ~4 FPS.
    If you some more information about it I can send it to you.

    Thanks for your help!

  • @Tome_at_Intel Is there an ETA for when the NCSDK will support 2 PCI-E NCS?

Sign In or Register to comment.