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!

[Error 7] Toolkit Error: USB Failure. Code: Error opening device

If I plug the NCS directly into one of the USB 3.0 ports on my Ubuntu 16.04 x86_64 machine (native) I get the USB Failure error when doing "make example01", and if I run "ncs-check -1" it fails with the error message "OpenDevice 11 failed, rc=-2"

In USBView it shows the Movidius MX2X5X device with the vendor ID of 03e7, and product ID of 2150. But, oddly it shows the USB version as 2.0 and the speed as 480Mb/s (high). Which I find odd because by appearance it's a USB 3.0 device. It's also only reporting needing 500ma. So is the NCS device a USB 2.0 device or USB 3.0 device?

What I find truly odd is if I use a USB 2.0 extension cable everything appears to work correctly. As far as I can tell all the information under USBView is the same.

There could be something about my machine that's messed up. Previously I was using it for Camera testing with the Aravis project, and that uses the libusb. But, I don't remember changing anything.

«1

Comments

  • 54 Comments sorted by Votes Date Added
  • Generally the NCS stick is a USB 3.0 device. There could be some incompatibility between NCS and your particular USB3.0 adapter (no matter it is onboard or card on slot). Please try to use another adapter or even different computer to see the behavior of NCS stick and sort the issue.

  • So I tried a different machine, and got nearly the same result.

    The machine I tried today is a Dell 7040 running Linux 16.04 x86/64.

    If I use the built in USB3 ports (that go to the Intel Controller) it gives me the USB error message. If I use a USB2 extension cable then it works.

    If I use a USB 3.0 PCI-Express adapter (with a Renesas USB 3.0 controller) it does work, BUT according to usbview it's only running at USB 2.0 speeds.

    I haven't been able to get the NCS to work on an Intel Controller based USB 3.0 port at USB 3.0 speeds.

    Note: It was a clean install of Ubuntu 16.04 with all the updates.

  • @S4WRXTTCS according to your statement
    "If I use a USB 3.0 PCI-Express adapter (with a Renesas USB 3.0 controller) it does work, BUT according to usbview it's only running at USB 2.0 speeds."

    When NCS plugged in USB port and idle it behaves as USB2.0 device but when blobs(graph) files are uploaded to stick during operation it must switch to USB3.0 for faster transfer since blob files are relatively big, hundreds of megabytes depending on the CNN used. After that switching again to USB2.0 is a normal behavior.

  • Thanks for the explanation that it switches to USB3. That's important information to have, and I hope it gets added to the getting started guide.

    Here is what dmesg reports when I try "make example01" with the NCS plugged directly into the Renesas based USB 3.0 adapter.

    [ 251.242864] usb 3-2: USB disconnect, device number 3
    [ 251.493819] usb 4-2: new SuperSpeed USB device number 3 using xhci_hcd
    [ 251.515078] usb 4-2: New USB device found, idVendor=040e, idProduct=f63b
    [ 251.515085] usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 251.515090] usb 4-2: Product: USBVSC
    [ 251.515093] usb 4-2: Manufacturer: Movidius
    [ 251.515096] usb 4-2: SerialNumber: DATAC
    [ 252.037138] usb 3-2: new high-speed USB device number 4 using xhci_hcd
    [ 252.171282] usb 3-2: New USB device found, idVendor=03e7, idProduct=2150
    [ 252.171290] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 252.171294] usb 3-2: Product: Movidius MA2X5X
    [ 252.171297] usb 3-2: Manufacturer: Movidius Ltd.
    [ 252.171300] usb 3-2: SerialNumber: 03e72150
    [ 252.541354] xhci_hcd 0000:02:00.0: Cannot set link state.
    [ 252.541361] usb usb4-port2: cannot disable (err = -32)
    [ 252.541365] usb 4-2: USB disconnect, device number 3

    The transfer time reported was 114.04ms

    If I try it with the NCS plugged directly into the built in USB 3.0 ports of the OptiPlex 7040 it reports the following.

    [ 504.922544] usb 1-3: USB disconnect, device number 5
    [ 505.243265] usb 2-6: new SuperSpeed USB device number 2 using xhci_hcd
    [ 505.260374] usb 2-6: New USB device found, idVendor=040e, idProduct=f63b
    [ 505.260381] usb 2-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 505.260385] usb 2-6: Product: USBVSC
    [ 505.260389] usb 2-6: Manufacturer: Movidius
    [ 505.260392] usb 2-6: SerialNumber: DATAC

    It never goes past this, and it fails with [Error 7] Toolkit Error: USB Failure. Code: Error opening device

    To compare USB3 versus USB2 speeds it's too close to call on the make example01.

  • I have exactly the same problem. I though it was related to my system, this is why I changed header to ask an other question:
    https://ncsforum.movidius.com/discussion/134/hello-first-question-how-can-we-get-the-detection
    but now it seems that there an issue with the STICK & USB3.

    So basically I switched o a USB2 port, but we need to have a resolution.

  • When the NCS is first plugged in, the only code running on it is a bootloader which operates in USB2.0 mode and waits for a download of firmware from the host. When the host connects to it and opens a connection, it downloads operating firmware into the NCS, which then does a virtual disconnect of the device and reconnects the NCS in USB3.0 mode. You can watch this using dmesg on the host machine and monitoring the system log. If it hangs in this transition, try using the NCS in a USB 2.0 hub. For whatever reason, it seems quite reliable this way.

  • @S4WRXTTCS Can you please provide more details regarding your host machine?

  • edited August 2017 Vote Up0Vote Down

    @Tome_at_Intel

    I tested it out on four different setups.

    Failed -> Internal USB 3.0 ports on a Dell OptiPlex 7040.
    Passed -> Renesas/NEC UPD72020 Adaper card inside OptiPlex 7040
    Failed -> Internal USB 3.0 ports on a Gigabyte Z270 based computer with an Intel i7-7700K 4.2GHz Processor
    Passed -> Internal USB 3.0 ports on a baseboard for a Congatec TCA3 COM-Express Module with an Intel ATOM E3845

    All the testing was done running Ubuntu 16.04 x86/64bit with the latest updates. Where I've verified that a USB 3.0 flash drive works at USB 3.0 speeds on the USB port. I'm also not using a powered HUB.

    The failure was the inability to switch to USB 3.0 speeds. Where if I used a USB 2.0 extension cable it would work.

    The Dell OptiPlex 7040 has the Q170 chipset, and has an Intel Core I7-6700 3.4GHz processor.

  • I have the same problem also saying : No devices found.

    I am running a Core i5 with a Dual Boot - Windows 10 and Ubuntu

  • @Tome_at_Intel My system is a Dell Latitude E5420 running Ubuntu 16.04

  • We appreciate your patience and I want you to know that we are working on a release candidate with consideration to this problem. Thanks.

  • I have the same problem, i am running on a joule directly or via a hub. No luck

  • @fpex Just to be clear, which version of the SDK are you currently using? What are you trying to run (mvNCCompile, mvNCProfile, mvNCCheck) and can you post the error message here? Please also include the version of the OS you are using. Thank you.

  • I am using UBUNTU 16.04 on joule latest version. I am still at the beginning. So after managing to install the latest SDK as from the start web page, i try make examples and get [Error 7] Toolkit Error: USB Failure. Code: Error opening device
    I tried with USB2 and USB3 hubs (since the joule has only one USB I need an hub)

  • edited November 2017 Vote Up0Vote Down

    I have the dongle working in an Ubuntu 16.04 VM running in VirtualBox on Windows 7 Ultimate.

    If I reboot that same machine into Debian unstable x86_64, without re-arranging its USB configuration, then I either:

    • Run a QEMU/KVM guest with Ubuntu 16.04 + NCS SDK, or
    • Run a Docker image with Ubuntu 16.04 + NCS SDK

    in both cases passing the USB devices (or the whole bus) into the VM/container as required, then run "make examples" in the container/VM, I get:

    [Error 7] Toolkit Error: USB Failure. Code: Error opening device

    dmesg on the host contains a succession of stanzas like this, where the device transitions to its USB 3 VID/PID, but then something evidently goes wrong:

    [ 4981.864126] usb 5-2: USB disconnect, device number 2
    [ 4982.113033] usb 6-2: new SuperSpeed USB device number 2 using xhci_hcd
    [ 4982.134428] usb 6-2: New USB device found, idVendor=040e, idProduct=f63b
    [ 4982.134429] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 4982.134430] usb 6-2: Product: USBVSC
    [ 4982.134431] usb 6-2: Manufacturer: Movidius
    [ 4982.134431] usb 6-2: SerialNumber: 9B3656CFE4A617
    [ 5002.522874] usb 5-2: new high-speed USB device number 3 using xhci_hcd
    [ 5002.668011] usb 5-2: New USB device found, idVendor=03e7, idProduct=2150
    [ 5002.668012] usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 5002.668013] usb 5-2: Product: Movidius MA2X5X
    [ 5002.668014] usb 5-2: Manufacturer: Movidius Ltd.
    [ 5002.668014] usb 5-2: SerialNumber: 03e72150
    [ 5003.019583] xhci_hcd 0000:07:00.0: Cannot set link state.
    [ 5003.019586] usb usb6-port2: cannot disable (err = -32)
    [ 5003.019588] usb 6-2: USB disconnect, device number 2
    [ 5009.191022] usb 5-2: USB disconnect, device number 3
    [ 5009.439699] usb 6-2: new SuperSpeed USB device number 3 using xhci_hcd
    [ 5009.461198] usb 6-2: New USB device found, idVendor=040e, idProduct=f63b
    [ 5009.461199] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 5009.461200] usb 6-2: Product: USBVSC
    [ 5009.461200] usb 6-2: Manufacturer: Movidius
    [ 5009.461201] usb 6-2: SerialNumber: 9B3656CFE4A617
    [ 5025.422851] usb 5-2: new high-speed USB device number 4 using xhci_hcd
    [ 5025.568085] usb 5-2: New USB device found, idVendor=03e7, idProduct=2150
    [ 5025.568087] usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 5025.568088] usb 5-2: Product: Movidius MA2X5X
    [ 5025.568089] usb 5-2: Manufacturer: Movidius Ltd.
    [ 5025.568089] usb 5-2: SerialNumber: 03e72150
    [ 5025.922887] xhci_hcd 0000:07:00.0: Cannot set link state.
    [ 5025.922890] usb usb6-port2: cannot disable (err = -32)
    [ 5025.922893] usb 6-2: USB disconnect, device number 3
    [ 5029.165706] usb 5-2: USB disconnect, device number 4
    

    Do you want me to capture USB traffic while this is happening using usbmon and send it to you?

    Next, I'll try to get the SDK examples working in a VirtualBox VM running under Linux. That would eliminate QEMU/KVM as the cause. I don't know where to go from there.

    In case it's relevant, in my configuration the NCS is plugged into a USB3 header attached to the motherboard, driven by a Renesas USB3 controller. But as I say it works just great under Windows.

  • @Tome_at_Intel so what can i do? I have two devices both unusable ... not very happy about it.

  • @fpex You could capture USB traffic, maybe. I don't know whether it would be useful though.

  • I am also using UBUNTU 16.04 with Jules latest version.
    -->Linux takejoule-570x-DVT2 4.4.0-1000-joule #0+joule21-Ubuntu SMP PREEMPT Thu Mar 16 14:46:45 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    -->BIOS GTPP1J2A.X64.0143.B30.1706270056
    Examples TEST.


    take-joule@takejoule-570x-DVT2:~/workspace/ncsdk/examples/caffe/GoogLeNet$ ./run.py
    Device 0 Address: 2.4 - VID/PID 03e7:2150
    Starting wait for connect with 2000ms timeout
    Found Address: 2.4 - VID/PID 03e7:2150
    Found EP 0x81 : max packet size is 512 bytes
    Found EP 0x01 : max packet size is 512 bytes
    Found and opened device
    Performing bulk write of 905640 bytes...
    Successfully sent 905640 bytes of data in 93.952265 ms (9.192813 MB/s)
    Boot successful, device address 2.4
    Found Address: 2.4 - VID/PID 040e:f63b
    done
    Booted 2.4 -> VSC

    ------- predictions --------
    prediction 0 (probability 0.99609) is n03272010 electric guitar label index is: 546
    prediction 1 (probability 0.0035095) is n02676566 acoustic guitar label index is: 402
    prediction 2 (probability 0.0) is n02396427 wild boar, boar, Sus scrofa label index is: 342
    prediction 3 (probability 0.0) is n02391049 zebra label index is: 340
    prediction 4 (probability 0.0) is n02389026 sorrel label index is: 339


    But the same phenomenon is happening.
    I also tried with USB2 and USB3 hub.
    There is a case that it operates normally without an error due to the way of inserting the stick.
    However, I have to try it many times.
    Apparently I think there is a problem with the connector of many Movidius stick.
    Is not it a kind of defect?

  • @fpex At the moment, we are trying to reproduce the issue on a Joule and as soon as we find the issue, I'll let you know.

  • edited November 2017 Vote Up0Vote Down

    I've got the same problem, or a variant of it. Setup:

    Arch Linux host, Ubuntu 16.04 guest using Virtual Machine Manager (kvm). The stick is plugged into a host USB 2 port. USBView in the guest sees the stick as

    Movidius MA2X5X
    Manufacturer: Movidius Ltd.
    Serial Number: 03e72150
    Speed: 12Mb/s (full)
    USB Version: 2.00
    Device Class: 00(>ifc )
    Device Subclass: 00
    Device Protocol: 00
    Maximum Default Endpoint Size: 64
    Number of Configurations: 1
    Vendor Id: 03e7
    Product Id: 2150
    Revision Number: 0.01

    Config Number: 1
    Number of Interfaces: 1
    Attributes: 80
    MaxPower Needed: 500mA

    lsusb sees it too.

    Now comes the fun part. I can cd to "examples/caffe/SqueezeNet" and run "make profile" and it works - once. But if I try to repeat it it errors with "[Error 7] Toolkit Error: USB Failure. Code: Error opening device". USBView and lsusb still see the device! And if I unplug the device and plug it back in again, it works again - once.

    Is there some kind of command I can issue in the guest to emulate the process of unplugging and replacing the device?

    guest dmesg after an unplug - replace cycle:
    [ 2171.029089] usb 1-4: USB disconnect, device number 22
    [ 2186.356167] usb 1-4: new high-speed USB device number 23 using ehci-pci
    [ 2186.672271] usb 1-4: New USB device found, idVendor=03e7, idProduct=2150
    [ 2186.672275] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 2186.672278] usb 1-4: Product: Movidius MA2X5X
    [ 2186.672281] usb 1-4: Manufacturer: Movidius Ltd.
    [ 2186.672283] usb 1-4: SerialNumber: 03e72150

    guest dmesg after the successful "make profile"
    [ 2263.161786] usb 1-4: USB disconnect, device number 23
    [ 2264.240155] usb 1-4: new high-speed USB device number 24 using ehci-pci
    [ 2264.564037] usb 1-4: New USB device found, idVendor=040e, idProduct=f63b
    [ 2264.564042] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 2264.564045] usb 1-4: Product: USBVSC
    [ 2264.564048] usb 1-4: Manufacturer: Movidius
    [ 2264.564050] usb 1-4: SerialNumber: 5CB83DCF146C0E
    [ 2264.861850] usb 1-4: USB disconnect, device number 24
    [ 2265.856171] usb 1-4: new high-speed USB device number 25 using ehci-pci
    [ 2266.195199] usb 1-4: New USB device found, idVendor=03e7, idProduct=2150
    [ 2266.195206] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 2266.195210] usb 1-4: Product: Movidius MA2X5X
    [ 2266.195213] usb 1-4: Manufacturer: Movidius Ltd.
    [ 2266.195216] usb 1-4: SerialNumber: 03e72150

    guest dmesg after the unsuccessful second attempt
    [ 2466.680984] usb 1-4: USB disconnect, device number 25
    [ 2468.496173] usb 1-4: new high-speed USB device number 26 using ehci-pci
    [ 2468.812400] usb 1-4: New USB device found, idVendor=03e7, idProduct=2150
    [ 2468.812404] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 2468.812408] usb 1-4: Product: Movidius MA2X5X
    [ 2468.812410] usb 1-4: Manufacturer: Movidius Ltd.
    [ 2468.812413] usb 1-4: SerialNumber: 03e72150

  • @znmeb You can emulate a USB device unplug/plug cycle using 'virsh detach-device' and virsh attach-device' with pre-written XML like this:

    $ sudo cat /etc/movidius-ncs-usb2.vmxml
        <hostdev mode='subsystem' type='usb' managed='yes'>
          <source>
            <vendor id='0x03e7'/>
            <product id='0x2150'/>
          </source>
        </hostdev>
    
    $ sudo cat /etc/movidius-ncs-usb3.vmxml
        <hostdev mode='subsystem' type='usb' managed='yes'>
          <source>
            <vendor id='0x040e'/>
            <product id='0xf63b'/>
          </source>
        </hostdev>
    
    $ 
    

    There's a GUI for it in virt-manager too.

    I tried to automate it using the following udev, but I'm yet to test it properly:

    $ sudo cat /etc/udev/rules.d/90-libvirt-usb.rules
    ACTION=="add", \
        SUBSYSTEM=="usb", \
        ENV{ID_VENDOR_ID}=="03e7", \
        ENV{ID_MODEL_ID}=="2150", \
        RUN+="/usr/bin/virsh attach-device ncs /etc/movidius-ncs-usb2.vmxml"
    ACTION=="remove", \
        SUBSYSTEM=="usb", \
        ENV{ID_VENDOR_ID}=="03e7", \
        ENV{ID_MODEL_ID}=="2150", \
        RUN+="/usr/bin/virsh detach-device ncs /etc/movidius-ncs-usb2.vmxml"
    ACTION=="add", \
        SUBSYSTEM=="usb", \
        ENV{ID_VENDOR_ID}=="040e", \
        ENV{ID_MODEL_ID}=="f63b", \
        RUN+="/usr/bin/virsh attach-device ncs /etc/movidius-ncs-usb3.vmxml"
    ACTION=="remove", \
        SUBSYSTEM=="usb", \
        ENV{ID_VENDOR_ID}=="040e", \
        ENV{ID_MODEL_ID}=="f63b", \
        RUN+="/usr/bin/virsh detach-device ncs /etc/movidius-ncs-usb3.vmxml"
    $ 
    
  • If it goes well it will not be a basic solution.
    Let's wait for manufacturer's response.

  • I have a little more data. The machine is now dual-booted Arch and Ubuntu 16.04 LTS.

    1. The device works every time on the machine when booted Ubuntu 16.04.
    2. For both KVM/Virtual Machine Manager and VirtualBox 5.1.30 Ubuntu guests running on the machine when booted in Arch, I can run an example once successfully. After that, some kind of disconnect happens and the error message is shown when I run the example.
    3. On the VirtualBox case, the GUI shows the device has been disconnected. I can re-connect it and I will get one more successful run, then it will disconnect again. With Virtual Machine Manager the device shows up still connected. Disconnecting it and reconnecting it doesn't help.

    Given that the VirtualBox USB 2.0 / 3.0 code is not open source, I'm not planning to do any more testing with VirtualBox. I would like to get KVM/Virtual Machine Manager to work because all of my other machine learning / data science workflow is built around Arch. But I will probably move to Ubuntu 16.04 LTS at the cost of a week of hacking my workflow; dual-booting is a pain.

    I doubt very seriously if this is a bug in the Movidius software. I think it's some kind of edge case in the Linux kernel USB code.

  • Is there a way to get the SDK on Arch? I am getting frustrated at the l;ack us use of my neural sticks and I honestly hate the ides of UBUNTU on any of my main machines

  • edited November 2017 Vote Up0Vote Down

    @fpex The SDK could be ported to Arch - I think it would take me a week. But I'm not sure it's worth the effort; Fedora is way more popular than Arch, for example. And parts of the SDK aren't open source - Intel would have to change the licenses.

    I hop around from distro to distro; right now I'm dual-booted Antergos (Arch with a nice installer layer) and Ubuntu. The Movidius stick runs on Ubuntu but I can't make my AMD GPU run OpenCL on it. The AMD GPU runs OpenCL on Antergos but the Movidius doesn't. Neither of them work on Fedora ;-)

    And, of course, I have plenty of virtual machines.

  • edited November 2017 Vote Up0Vote Down

    i hate hopping because i need stability (but modern stuff support) for development plus one mac and one winVM for cross coding. If things stay like this, for as much as i would love to use these kits and possible instead of my nvidia cuda stuff, i will just sell them and move on. i truly did hope they would work on my ubuntu joule, they do not.
    I hate the idea of setting an ubuntu vm on arch (like for my win pass through) .... i am really too simple minded :-)

  • Running Ubuntu 16.04 in Virtualbox on a Macbook pro. The Movidius stick is connected via a hub and viewable in USB viewer. Ive added the two usb filters as per this thread . However I get the error No devices found. Any advice for my configuration - perhaps due to use of hub?

    https://ibb.co/cUKJXw - USB config
    https://ibb.co/bVmhsw - USB viewer

    Note: apologies for posting image links, can't get this forum to post the images directly..

  • Some more diagnostics data: when running ubuntu 16.04 on virtual box 5.2.4, I get the same USB error regardless of whether the port is in USB 2.0 or 3.0 mode, or using an external USB 3.0 hub. The NCS seems to attach but then fails as soon as the make examples script hits attempts to attach.

    When running in VMware fusion 10.1.0 with the same version ubuntu, directly attached to laptop ports it fails with the same error message. When running with an external USB 3.0 hub under fusion with the same VM it works reproducibly.

  • I am facing the same problem on Virtual Box too. Hopefully someone can give an answer soon

  • I ended up putting Ubuntu onto an old MacBook, which is a move I am happy about with hindsight!

Sign In or Register to comment.