How to install Coral M2 drivers for TrueNAS

Copied from [How To]: PCI Coral M2 in Truenas Scale with jlmkr · blakeblackshear/frigate · Discussion #13926 · GitHub

Install Coral drivers in Truenas scale

Enable dev mode

You require to enable apt in Truenas Scale to install the packages.

install-dev-tools

To install the Coral driver, follow the steps here:

apt install gnupg
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install gasket-dkms libedgetpu1-std

This seems to fail with gasket error. I found more info here to repair.
google-coral/edgetpu#808

apt install dh-dkms devscripts git
git clone  https://github.com/google/gasket-driver
cd gasket-driver
debuild -us -uc -tc -b -d
cd ..
dpkg -i gasket-dkms_1.0-18_all.deb

Then check for the device

lspci -nn | grep 089a

You should see something like this:

01:00.0 System peripheral [0880]: Global Unichip Corp. Coral Edge TPU [1ac1:089a]

Reboot Truenas scale, and check /dev for apex_0.

ls -alh /dev/apex_0 
crw-rw---- 1 root root 120, 0 Mar 20 14:51 /dev/apex_0

Hope this helps others too.

this will not survive upgrades when the kernel is changed, you will have to rerun the process

Thanks for the posting @mercenaryza - readers should bear in mind the risks of enabling Dev Mode and the non-persistent nature of the installation as noted.

There is an open Feature Request for the Coral driver to be included - if this is something you’d like to see, please head over there to vote for it!

1 Like