skip to Main Content

I have a new Coral/Google Edge TPU USB accelerator. For days, I did not have much luck in getting it going. I have tried it on

  • Ubuntu 18.04 on bare metal Intel, AMD and RaspberryPi3+
  • Ubuntu 18.04 as a KVM guest with a virtualized Global Unichip device
  • Ubuntu 18.04 as a Virtualbox guest with a virtualized Global Unichip device

In all cases, the bird detection sample app failed with various error messages, all coming down to the fact that the device is not recognized.
Note that according to what I am reading, the device should come up in lsusb as one of Google Inc., but in all of the above cases, all I got was this (in various variations, depending on the machine):

# lsusb
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 003: ID 046d:c05a Logitech, Inc. M90/M100 Optical Mouse
Bus 005 Device 002: ID 04f3:0103 Elan Microelectronics Corp. ActiveJet K-2024 Multimedia Keyboard
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 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 1a6e:089a Global Unichip Corp. <<<<<<<<<<<<<<<<<<<
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

I already suspected a DOA device, when I came across this article by Koji:
[https://dev.to/kojikanao/coral-edgetpu-usb-with-virtualbox-57e1][1]

It comes down do using Ubuntu on Virtualbox, and to create TWO device filters for the Global Unichip Corp. entry. Then, the second Global Unichip entry needs to be turned into a faked Google device by changing the USB Vendor ID to 18d1 and the product ID to 9302.
Once I did this, the device was recognized, and the sample app happily classified parakeets.
This leads to a few questions:

  1. Can the above fakeroo be achieved on a bare metal Ubuntu installation, and/or on one running as a KVM guest? And how?
  2. Is there a way to QUICKLY (as opposed to starting a python app and see it fail) ascertain that the USB Edge TPU device is working?

All my VMs run on KVM with a Centos 7 host using the 5.1 kernel. VirtualBox does not get along with KVM, and I’m not looking forward to migrating all my VMs to Virtualbox, and to perform a KVM lobotomy to the kernel to get Virtualbox going, just to get the usb Edge TPU to work.
Ideas?

P.S.: Please be easy on me, I’m an FNG on Stackoverflow.

https://dev.to/kojikanao/coral-edgetpu-usb-with-virtualbox-57e1

2

Answers


  1. Chosen as BEST ANSWER

    Domo!

    I also got it going without Virtualbox and faking it. Strangely enough, it is running on a Jetson Nano .... I was already starting to write a custom udev rule, when I found in /etc/udev/rules.d/99-edgetpu-accelerator.rules:

    SUBSYSTEM=="usb",ATTRS{idVendor}=="1a6e",GROUP="plugdev" SUBSYSTEM=="usb",ATTRS{idVendor}=="18d1",GROUP="plugdev"

    With that, lsusb that previously listed the device as

    Bus 002 Device 004: ID 125f:dd4a A-DATA Technology Co., Ltd. Bus 002 Device 003: ID 1a6e:089a Global Unichip Corp

    ... now lists it as

    Bus 002 Device 004: ID 125f:dd4a A-DATA Technology Co., Ltd. Bus 002 Device 005: ID 18d1:9302 Google Inc.

    However, it is listed as 18d1:9302 Google Inc. only AFTER classify_image.py has been successfully run. No idea why.

    Because the installer thought the Jetson was a Raspberry Pi , I had to create links as follows:

    /usr/local/lib/python3.6/dist-packages/edgetpu/swig/_edgetpu_cpp_wrapper.cpython-36m-aarch64-linux-gnu.so => /usr/local/lib/python3.5/dist-packages/edgetpu/swig_edgetpu_cpp_wrapper.cpython-36m-aarch64-linux-gnu.so

    ... and so forth for all 3 *.so files in that directory.


  2. I think I was wrong. Actually fake one isn’t necessary since I removed all of them to get edge tpu usb work again(after the first time, vendor id and product id were changed by something which I don’t know since this hasn’t happened on raspberry pi and another ubuntu machine.) and added only one. Then it worked again.

    I also updated my post.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search