Google Coral TPU dev board power up

I decided that the new machine learning fad is worth exploring. So far I’ve learned very little about it, but I acquired some cool dev kits I wanted to show off.

I got the cool Google TPU dev kit – it is branded Coral. You can read the specs here. The really cool part is that it has the new TPU ML accelerator chip. Not the first such thing to hit the market. But being from Google one would expect some very good integration with TensorFlow.

Here is how my attempt to get it to work went down: You need not one, not two, but THREE USB cables to get the beast to work.

That was rather annoying. You need a micro USB cable for serial console – fair enough and nice of them to include the USB <–> serial adapter on the board. Then you need USB-C adapter for power. Hmm maybe power the thing from the serial console cable – just a though. Ok, I understand that one may need separate cable just for power. These boards suck 2-3 amps on full load. Still could have been nice option. Then you need a third USB-C cable to flash the OS image to the board and for general data communication.

Well I was out of cables :-(. A quick search on revealed this item – 5 pack USB to USB-C cables. Not the most economical solution, but can’t beat the one day shipping.

Here I was today all cable connected following trough the “Get Started” guide step by step.  The setup is mostly uneventful. I won’t bore you with repeating the steps in details – they are well documented:

      • boot in the serial console and enter fastboot mode
      • download the OS image – there are two: the mendel-chef seems to be newer version
      • flash the image using the provided shell script
      • “connect to the internet” part was not needed if you have Ethernet cable. The provided steps are to enable the onboard wifi.
      • the “install Mendel Dev Tool” step was confusing – this is something you have to do on your PC/Mac not on the dev kit itself. It was not obvious to me. Then you’ll have to add the pip local folder to the path or you won’t be able to find the mystery mdt command. The path is in the little blue note in the instructions. Ultimately I skipped that step and enabled SSH instead.
      • run the ML example

I won’t lie, the example is very impressive. You run a command on the dev kit then connect to the dev kit with a browser and it simulates image recognition on a running video stream. You can type “n” in the dev kit terminal to switch between CPU and TPU and marvel at the 10x speed improvement.

A few observations: The board has a 30mm fan which is vary loud, when it runs. The fan runs when you flash the board, then when the OS boots the fan stops. There appears to be some sort of thermal management running.

To me the heatsink gets really hot. According to it’s own temperature report it gets to 60C at idle. To read the temperature from the sensor run:

cat /sys/devices/virtual/thermal/thermal_zone0/temp

It would report a number, divide by 1000 to get the temperature in Celsius. The default threshold for the fan to turn on is 65C. If you want to change it run:

echo 57000 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp

You’ll need to run the above command as root. This example would turn the fan on when the sensor temperature reached 57C. There is a hysteresis of 10C by default, so the fan would turn off, when the temperature reaches 47C.

The OS itself is some offspring of Debian, called Mendel Linux. Not many details are available on it.

I would recommend changing the default password. Then enabling SSH login by editing the /etc/ssh/sshd_config file. Change PubkeyAuthentication to “yes”; uncomment the AuthorizedKeysFile line and switch PasswordAuthentication to ‘yes’. Do the PasswordAuthentication change only after you have changed the default password or you risk strangers logging in your dev kit and compromising it. You can follow this guide how to enable logging in the dev kit without requiring a password. After that you can revert the PasswordAuthentication back to ‘no’ to improve security.

You can now reduce the cable clutter, by first disconnecting the serial console and then the USB-data cable. In my case I use USB-C for power and Ethernet cable. If you want really minimalistic setup, use the onboard WiFi.

The USB-data cable is used to enable Ethernet emulation over USB. You can use it in an environment where you don’t have Ethernet or wireless network.

Google has a mystery tool called Mendel Development Tool – seems it is some sort of wrapper over ssh to allow you to log in the dev kit and copy files. I personally prefer ssh, because I’m familiar with it. The MDT tool works only over the USB-data connection.

Here is a size comparison between the Coral TPU dev board an the small NVIDIA Jetson Nano:

I don’t know much about ML to give you a reasonable comparison which is better. I would suspect both have some strengths and it really depends on the particular use case.

One small observation is that NVIDIA has established community for the Jetson products line and one can easily find answers to all sorts of questions online. By contrast the community for the Coral dev kit is not there yet.