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.
1 Like
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!
Problem/Justification
Frigate focuses on the Coral Edge TPU and it would greatly help the app take advantage of this hardware without resorting to any hacky way of doing it as even developer mode fails to install the gasket-dkms drivers in EE Beta
Impact
Reading on this forum many people have requested it through the years and if you need one for testing I will gladly send the team a dual coral pcie TPU for testing.
User Story
Detection on CPU is stated in Frigate that its for testing only …
2 Likes
If anyone is having trouble installing the gasket drivers in >=24.10.1, this post is what worked for me after trying just about everything else:
Some people might need extra steps on 24.10.1 if they’re getting permission denied / read-only errors, this solved it for someone on Discord so figured it could help people here
systemd-sysext unmerge
install-dev-tools
apt install dkms devscripts debhelper dh-dkms -y
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
systemd-sysext merge
# if everything was successful
reboot
Specifically, the “systemd-sysext unmerge” command seemed to do the trick.
I also used the following docker image so avoid having to install all the dependencies to manually compile the.deb package.
Dockerfile to build the google coral gasket driver
2 Likes