- Currently Google coral dev runs on Mendel OS which supports Linux kernel v4.14
linux-imx
already support v5.4 for i.MX8- I've tried to build v5.10 from vanilla kernel source
- Able to use the imx8mq-phanbell.dts dts
- But, TPU PCI not recognized
- More support required here?
- When will Mendel OS (or Google Coral Dev) support Linux v5.x (Eg. v5.10, v5.4)?
Asked
Active
Viewed 787 times
2

ChethanSuresh
- 123
- 1
- 6
-
Mendel development has been frozen. We may not expect any updates in the near future. – Coral So Support Apr 25 '22 at 21:04
-
To detect the TPU PCI please try to build https://github.com/google/gasket-driver for that kernel. Many users run it on 5.x kernels: https://github.com/google-coral/edgetpu/issues/544 – Coral So Support Apr 25 '22 at 21:55
-
Thank you @CoralSoSupport, I understand current status of Mendel OS. I'll try above links to verify Edge TPU support. – ChethanSuresh Apr 27 '22 at 03:11
1 Answers
1
Google Coral Dev Edge TPU with linux-5.15.y
Background
- Currently Mendel OS does not support v5.x kernel version
- Able to boot Coral dev with linux-5.15.y.
Goal
- Support Coral dev Edge TPU with linux-5.15.y kernel version
Build linux-5.15.y for Google Coral Dev
- Clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
- Checkout linux-5.15.y
$ git log --oneline -1
81d8d30c35ed (HEAD -> linux-5.15.y, tag: v5.15.35, origin/linux-5.15.y) Linux 5.15.35
$ export ARCH=arm64; export CROSS_COMPILE=aarch64-linux-gnu-
$ make O=build defconfig
$ make O=build menuconfig
$ make O=build -j8 Image dtbs
$ cp build/arch/arm64/boot/Image build/arch/arm64/boot/dts/freescale/imx8mq-phanbell.dtb /tftpboot/coral/
// u-boot commands
tftpboot ${fdt_addr} 192.168.0.xx:coral/imx8mq-phanbell.dtb
tftpboot ${loadaddr} 192.168.0.xx:coral/Image
setenv bootargs console=ttymxc0,115200 console=tty0 earlycon=ec_imx6q,0x30860000,115200 root=/dev/mmcblk1p2 rootfstype=ext4 rw rootwait init=/sbin/init net.ifnames=0 pci=pcie_bus_perf
booti ${loadaddr} - ${fdt_addr}
- Able to boot 5.15.y, but Edge TPU pci is not found
$ uname -a
Linux coral-sdcard 5.15.35 #1 SMP PREEMPT Thu Apr 28 11:47:54 IST 2022 aarch64 GNU/Linux
$ lspci
Build and load Coral Gasket Driver
- Clone https://github.com/google/gasket-driver
- Cross compile on x86_64
$ git clone https://github.com/google/gasket-driver
$ export ARCH=arm64; export CROSS_COMPILE=aarch64-linux-gnu-
$ cd gasket-driver
$ cd src
// In Makefile update linux src path
// -C /path/to/linux/build
$ make
$ file apex.ko gasket.ko
apex.ko: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=b49b35e0e0747682a5d0e7a085dc424991c3327e, with debug_info, not stripped
gasket.ko: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=cdb25b4ecf240c3b3ff8cacbcc5c533da377aa36, with debug_info, not stripped
- Copy the .ko files to Coral dev and load kernel modules
# uname -a
Linux coral-sdcard 5.15.35 #1 SMP PREEMPT Thu Apr 28 11:47:54 IST 2022 aarch64 GNU/Linux
# insmod gasket.ko
# insmod apex.ko
# lsmod
Module Size Used by
apex 20480 0
gasket 98304 1 apex
# lspci -nn
<empty>
- Running sample model
# python3 examples/classify_image.py --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels test_data/inat_bird_labels.txt --input test_data/parrot.jpg
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
delegate = Delegate(library, options)
File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 119, in __init__
raise ValueError(capture.message)
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "examples/classify_image.py", line 121, in <module>
main()
File "examples/classify_image.py", line 71, in main
interpreter = make_interpreter(*args.model.split('@'))
File "/usr/lib/python3/dist-packages/pycoral/utils/edgetpu.py", line 87, in make_interpreter
delegates = [load_edgetpu_delegate({'device': device} if device else {})]
File "/usr/lib/python3/dist-packages/pycoral/utils/edgetpu.py", line 52, in load_edgetpu_delegate
return tflite.load_delegate(_EDGETPU_SHARED_LIB, options or {})
File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 163, in load_delegate
library, str(e)))
ValueError: Failed to load delegate from libedgetpu.so.1
- Still unable to detect the Edge TPU

ChethanSuresh
- 123
- 1
- 6