NPU & Google Coral

I was wondering if anyone knows how compatible the khadas NPU is with Google Coral? They both use INT8 though Google’s unit is 4TOPS a little less than the 5TOPS of the vim3. Google are coming out with programs & a development toolset for Coral & you can get a Coral unit that will plug into a M2 socket. It would be nice if you could combine them to get 9TOPS. I’ve ordered one from mouser & shall be doing some experimenting myself. If anyone can help it’d be interesting to see how far it’ll go.

2 Likes

Interesting idea :smile:

@Ujaz99 @Gouwa I already tested the USB3 coral version and it’s detected ok and you get an avg 16ms per inference(54 FPS) with mobilenet ssd v2, for about 1.5W extra power consumption (I will need to double check this figure again) .
I also just received yesterday the M.2 version, careful here you need the M.2 Accelerator B+M key if you want to plug it directly into VIM3 (https://coral.withgoogle.com/products/m2-accelerator-bm/). I will try it over the weekend as I need to remove the VIM3 off the case and find a way to hold it in place while testing it.
However, talking about the M.2 coral cards, I already tried the M.2 A+E coral with jetson nano and I was impressed as I got 9ms per inference (100 FPS), faster then google’s coral dev board.

You can check a sample integration for coral (c++) at https://github.com/larrylart/codrive/tree/master/hw_sampling/google_coral. I will do a similar one for VIM3 NPU once we get to the bottom of it, to get it to work. Then we could perhaps build an abstraction layer to make it easier to use with both.

3 Likes

@larrylart
I’m trying to test the coral m.2 + vim3 as well.
Currently i cant get the driver to install due to Linux headers.
(I have successfully tested the coral m.2 on Hikey 960)
please inform us if you succeed

Oh, I see! Did you get this error when trying to install gasket?
apt-get install gasket-dkms

Error! Bad return status for module build on kernel: 4.9.190 (aarch64)
Consult /var/lib/dkms/gasket/1.0/build/make.log for more information.

And in the log was complaining about missing:
./arch/arm64/include/asm/irqflags.h:24:10: fatal error: …/drivers/amlogic/debug/irqflags_debug_arm64.h: No such file or directory

If that is the case you can fix, I found a reference on the same problem at https://forum.odroid.com/viewtopic.php?t=34659

I fixed it by first method copy the file over from their repo and then remove and install again the gasket:

wget https://raw.githubusercontent.com/hardkernel/linux/odroidn2-4.9.y/drivers/amlogic/debug/irqflags_debug_arm64.h
cp irqflags_debug_arm64.h /usr/src/linux-headers-4.9.190/drivers/amlogic/debug/
apt-get remove gasket-dkms
apt-get install gasket-dkms

2 Likes

I’m getting a different error:

./include/uapi/linux/types.h:4:10: fatal error: asm/types.h: No such file or directory
#include <asm/types.h>

Hmm, that is a bit odd. I didn’t got that. What kernel version do you have?

Hi guys, I’m Nam Vu from the google-coral team here. We had a couples of questions about this from our side so I decided to head over to investigate. It looks like the M.2 is not configured for pcie by default:

I’m not sure if the m.2 slot works with NMVe configuration by default or not but we has customer saying that their ssd with nmve interface is detectable. Would love some clarification from the khadas team!

Cheers for engineers :slight_smile:

3 Likes

Hello, Welcome to Khadas.
I am no engineer, so you may want to wait for them to weigh in.:slightly_smiling_face:

I used the KBI method to switch between PCIe and USB3. Default is USB3. My NVMe SSD works on the VIM3, both directly and using the M2X extension board.

It should be noted that the VIM3 M.2 socket is single-lane, this frees up the connector to offer other features(…2280 NVMe SSD Supported, USB 2.0, I2S, I2C, ADC, etc). See VIM3 Specs under M.2 section, for more details.

2 Likes

Thanks for that, to clarify, I’m no longer an engineer just debugging issues for a living :slight_smile:

For future references, we also have another thread open here: