Coral EdgeTPU m.2 (for Frigate) not able to install on 24.10 (Electric Eel)

Hey there,

i was able to use this on 24.04 with following how-to:

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
reboot

but now i can not debuild it - getting this error:

# debuild -us -uc -tc -b

 dpkg-buildpackage -us -uc -ui -tc -b
dpkg-buildpackage: info: source package gasket-dkms
dpkg-buildpackage: info: source version 1.0-18
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Coral <coral-support@google.com>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
dh clean --with dkms
   dh_clean
 debian/rules build
dh build --with dkms
   dh_update_autotools_config
   dh_autoreconf
   create-stamp debian/debhelper-build-stamp
 debian/rules binary
dh binary --with dkms
   dh_testroot
   dh_prep
   debian/rules override_dh_install
make[1]: Entering directory '/mnt/Apps_SSD_128GB/homes/gasket-driver'
dh_install src/* usr/src/gasket-1.0/
make[1]: Leaving directory '/mnt/Apps_SSD_128GB/homes/gasket-driver'
   dh_installdocs
   dh_installchangelogs
   debian/rules override_dh_dkms
make[1]: Entering directory '/mnt/Apps_SSD_128GB/homes/gasket-driver'
dh_dkms -V 1.0
make[1]: Leaving directory '/mnt/Apps_SSD_128GB/homes/gasket-driver'
   dh_installudev
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   dh_missing
   dh_installdeb
   dh_gencontrol
   dh_md5sums
sudo: argv[0] mismatch, expected "/usr/bin/sh", got "/bin/sh"
dh_md5sums: error: cd debian/gasket-dkms >/dev/null && xargs -r0 md5sum | perl -pe 'if (s@^\\@@) { s/\\\\/\\/g; }' > DEBIAN/md5sums died with signal 9
dh_md5sums: error: Aborting due to earlier error
make: *** [debian/rules:6: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -tc -b failed

I checked /usr/bin/sh and /bin/sh - both referencing the same:

root@truenas:/mnt/Apps_SSD_128GB/homes/gasket-driver# l /usr/bin/sh
lrwxrwxrwx 1 root root 4 Jan  5  2023 /usr/bin/sh -> dash
root@truenas:/mnt/Apps_SSD_128GB/homes/gasket-driver# l /bin/sh
lrwxrwxrwx 1 root root 4 Jan  5  2023 /bin/sh -> dash

any ideas about that? anyone else figuring out same problems?

the device is for sure there:

# lspci |grep -i coral
02:00.0 System peripheral: Global Unichip Corp. Coral Edge TPU
1 Like

Yes, it’s a known issue that certain things no longer work with sudo.

Looks like it’s a wontfix because doing stuff in the shell isn’t supported.
https://ixsystems.atlassian.net/browse/NAS-131540

However, if you want to hack it, edit the file /etc/sudoers:

  • sudo visudo (EDIT: this is a safer way to edit the sudoers file)

Remove or comment out the line that says Defaults log_subcmd:

Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
# Defaults log_subcmds
Defaults log_format=json

Obviously this isn’t supported, may reset upon reboot or upgrade, etc. But since you’re installing third-party packages I don’t think that is an issue for you :slight_smile:

I was trying to do the same thing just recently and ran into the same error messages as the OP. In my case, it seems I was able to resolve it by SSH’ing into the machine to execute the commands, rather than using the shell in the GUI. A warning in the Developer Mode docs is what lead me to try that.

Do Not Use Web Shell
Do not make system changes using the TrueNAS UI web shell. Using package management tools in the web shell can result in middleware changes that render the system inaccessible.

Connect to the system using SSH or a physically connected monitor and keyboard before enabling or using developer mode.

actually I give it a try again with editing the sudoers - same error.
the error part is the same:

sudo: argv[0] mismatch, expected "/usr/bin/sh", got "/bin/sh"
dh_md5sums: error: cd debian/gasket-dkms >/dev/null && xargs -r0 md5sum | perl -pe 'if (s@^\\@@) { s/\\\\/\\/g; }' > DEBIAN/md5sums died with signal 9
dh_md5sums: error: Aborting due to earlier error
make: *** [debian/rules:6: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -tc -b -d failed

I am using the ssh shell, no webgui :wink:

I know that removing log_subcmds works for things like sudo tmux or sudo su -, but maybe it doesn’t work in your case. Can you try sudo su - to check if you have edited the sudoers correctly?

There is an alternative way which I’ve seen other people using:

Defaults !intercept_verify

I can confirm that change works for sudo su -.

Reference: https://www.sudo.ws/pipermail/sudo-users/2023-February/006538.html

EDIT: Please use sudo visudo instead of editing the sudoers file directly.

ok, I did now:

sudo visudo

→

#Defaults log_subcmds
Defaults !intercept_verify

trying sudo su - ends with:

# sudo su -
sudo: argv[0] mismatch, expected "/usr/bin/bash", got "-bash"
Killed

my user is using bash - is this expexting to be used from zsh?

EDIT:
Chatgpt had an answer :wink:

cat /etc/passwd | grep root

root:x:0:0:root:/root:/usr/bin/bash

but correctly this should be (to make the build work):

root:x:0:0:root:/root:/bin/bash

I changed this with:

sudo usermod -s /bin/bash root

Next steps:

  • logout root
  • start the build with sudo debuild -us -uc -tc -b -d
  • install the resulting . deb also with sudo dpkg -i gasket-dkms_1.0-18_all.deb
  • finish

thank for your help guys, really appreciating.

1 Like

What are the risks in doing this? I have an m.2 TPU as well.

I assume they are mainly that things can be reset after updates/upgrades?
Which is not that big of a problem…

1 Like

Has anyone gotten this working on 24.10.1?

After getting dev mode enabled (which was a pain, looks like it’s partially broken now) I’m getting an error on the debuild step:

# debuild -us -uc -tc -b -d
 dpkg-buildpackage -us -uc -ui -tc -b -d
dpkg-buildpackage: info: source package gasket-dkms
dpkg-buildpackage: info: source version 1.0-18
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Coral <coral-support@google.com>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
Can't exec "debian/rules": Permission denied at /usr/bin/dpkg-buildpackage line 834.
dpkg-buildpackage: error: debian/rules clean subprocess failed with unknown status code -1
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -tc -b -d failed

unhappily not working on 24.10.1 - honestly I also didn’t had enought time to spend on this.

I am following the topic and will for sure do another test…

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
4 Likes

tested now and can confirm as working.
thank you @StevenMcE

broken on 24.10.2 - just tested now.
getting error:

sudo: argv[0] mismatch, expected ā€œ/usr/bin/shā€, got ā€œ/bin/shā€
dh_md5sums: error: cd debian/gasket-dkms >/dev/null && xargs -r0 md5sum | perl -pe ā€˜if (s@^\@@) { s/\\/\/g; }’ > DEBIAN/md5sums died with signal 9

interesting to see - previous errors were hitting /usr/bin/bash & now /usr/bin/sh

I only got it working in 24.10.2 after ssh with root (not admin, not sudo, not sudo su), you have to enable login root ssh to install the drivers and then disable ssh root login again.

2 Likes

FYI I have a scale version 25.04.0-MASTER-20250312-234135 running my coral m2:
Using StevenMcE steps, but cloning a fork of the driver (heitbaum)

systemd-sysext unmerge
install-dev-tools
apt install dkms devscripts debhelper dh-dkms -y
git clone https://github.com/heitbaum/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

I use this with frigate running in dockge

4 Likes

this solution worked for me (disabling log_subcmds did not) and I have the m.2 coral working with frigate!

however, I think ix should really include the drivers in the base system as there is clearly a lot of demand and it does not appear to cause any issues

1 Like

You guys are using the m.2 dual tpu, the link on coral.ai ends with m2-accelerator-dual-edgetpu, correct?

I’ve executed the commands without error, but still no dice.

Out of confusion, I have the A+E key as well, and that is not working either.

I have it working on my server with a dual m.2 TPU in a PCIe adapter on EE 24.10.2. The dual Coral TPU setup is accessible with the standard Frigate app on my EE server. The TPUs are detected within that container and I have configured Frigate to use both TPUs.

I did have to read several of the threads regarding enabling the Coral drivers on EE. I think I ended up needing to temporarily enable SSH so that I could follow the steps for enabling developer mode and installing the drivers. One of the threads or earlier posts mentioned that.

I also agree that these drivers should be available for installation on the base system, similar to the way the Nvidia GPU drivers can be installed/used.

You say you’re using an adapter. Is this through the PCIe slot and with a riser? Or … what exactly?

I’m trying to use it throught the wifi slot. Anyone had any luck with this?

Oh, sorry, I’m using a Lenovo mini m920q.

Or anyone had any luck on the bottom end m.2 nvme slot with the maker fab adapter? (Dual Edge TPU Adapter - m.2 2280 B+M key)

I think this is the PCIe adapter I’m using. I don’t have any slots that would accept the dual Coral m.2 card on its own, so I have no experience with that.