How to run OpenVINO™ Toolkit with Neural Compute Stick 2 on Linux

Use a device with exceptional performance per watt per dollar to accelerate your neural networks.

Adrian Boguszewski
OpenVINO-toolkit
3 min readJan 20, 2022

--

Author: Adrian Boguszewski — AI Software Evangelist, Intel

Note: This article was created with OpenVINO 2022.1. If you want to know how to use the newer OpenVINO API please check this notebook.

Introduction

You’ve bought an Intel® Neural Compute Stick 2 (NCS2) and you’re very excited. Finally, you can accelerate your OpenVINO™ code on this device. You’ve already installed the OpenVINO™ toolkit via pip. And now you’re trying to run your model with NCS2, but every time you get:

Does that sound familiar? Well, perhaps you were overexcited and forgot to do some prerequisite steps. Which ones? See below.

Off-topic: What on earth is Neural Compute Stick 2?

Neural Compute Stick 2 or NCS2 in short, is an external AI accelerator you can plug into your USB port to run inference of OpenVINO™ models. It contains Intel® Movidius™ Myriad™ X VPU (Vision Processing Unit), which is dedicated hardware to infer deep learning models. It’s very good for prototyping with low-cost edge devices such as Raspberry Pi and other ARM host devices and has exceptional performance per watt per dollar. To learn more go here.

Run NCS2 on Linux

Firstly, plug your NCS2 into a USB port. Then, in the terminal, run:

You should see something like this:

where 03e7 is a vendor ID and 2485 is a product ID (you can see also different product IDs). It means your device is properly detected by your operating system. If you run the following python code:

You should see this output:

Although your device (MYRIAD) is visible for the Inference Engine it won’t run. You still need to do some things. The next step is to create udev rules. Go to /etc/udev/rules.d and create file 97-myriad-usbboot.rules with following content:

If your product ID is different from 2150, 2485, or f63b you should add a new line containing your product ID. After that, run in your terminal:

There is one additional step you should do now. Add your user to ‘users’ group and reboot the computer (sometimes log out is enough).

After restarting, verify that your user is in the ‘users’ group. Finally, you can load your network into NCS2!

And it works!

Object Detection with OpenVINO™ and Neural Compute Stick 2

You can try it yourself with this demo. Even if you don’t have a Neural Compute Stick, you can run the demo with Intel’s CPU or integrated GPU you probably have already.

--

--