themactep.com

A home of miscellaneous projects by Paul Philippov.

Notes

How to install Coral TPU PCIe card on Debian

# blacklist existing drivers
echo -e "blacklist gasket\nblacklist apex" | sudo tee -a /etc/modprobe.d/blacklist-apex.conf
sudo reboot

# install packages from google repository
sudo curl https://packages.cloud.google.com/apt/doc/apt-key.gpg -o /etc/apt/keyrings/coral.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/coral.asc] https://packages.cloud.google.com/apt coral-edgetpu-stable main" | \
  sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
sudo apt update
sudo apt install libedgetpu1-std

# compile driver from source, the one in the repository is broken
sudo apt install debuild config-package-dev dh-dkms
mkdir src
cd src
git clone https://github.com/google/gasket-driver/
cd gasket-driver
debuild -us -uc -tc -b
cd ..
sudo dpkg -i gasket-dkms*.deb

# add permissions
sudo sh -c "echo 'SUBSYSTEM==\"apex\", MODE=\"0660\", GROUP=\"apex\"' >> /etc/udev/rules.d/65-apex.rules"
sudo groupadd apex
sudo adduser $USER apex

# remove blacklist and reboot
sudo rm /etc/modprobe.d/blacklist-apex.conf
reboot