Cannot install gasket-dkms on Xubuntu 24.04.1 LTS
Description
Following the instructions here: https://coral.ai/docs/m2/get-started/#2-install-the-pcie-driver-and-edge-tpu-runtime
The install of the PCIe driver is failing:
$ sudo apt-get install gasket-dkms libedgetpu1-std
Removing old gasket-1.0 DKMS files...
Deleting module gasket-1.0 completely from the DKMS tree.
Loading new gasket-1.0 DKMS files...
Deprecated feature: REMAKE_INITRD (/usr/src/gasket-1.0/dkms.conf)
Building for 6.8.0-44-generic
Building initial module for 6.8.0-44-generic
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Error! Bad return status for module build on kernel: 6.8.0-44-generic (x86_64)
Consult /var/lib/dkms/gasket/1.0/build/make.log for more information.
dpkg: error processing package gasket-dkms (--configure):
installed gasket-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
gasket-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
DKMS make.log for gasket-1.0 for kernel 6.8.0-44-generic (x86_64)
Thu Sep 12 09:24:06 AM BST 2024
make: Entering directory '/usr/src/linux-headers-6.8.0-44-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
You are using: gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
CC [M] /var/lib/dkms/gasket/1.0/build/gasket_core.o
CC [M] /var/lib/dkms/gasket/1.0/build/gasket_ioctl.o
CC [M] /var/lib/dkms/gasket/1.0/build/gasket_interrupt.o
CC [M] /var/lib/dkms/gasket/1.0/build/gasket_page_table.o
/var/lib/dkms/gasket/1.0/build/gasket_interrupt.c: In function ‘gasket_handle_interrupt’:
/var/lib/dkms/gasket/1.0/build/gasket_interrupt.c:161:17: error: too many arguments to function ‘eventfd_signal’
161 | eventfd_signal(ctx, 1);
| ^~~~~~~~~~~~~~
In file included from /var/lib/dkms/gasket/1.0/build/gasket_interrupt.h:11,
from /var/lib/dkms/gasket/1.0/build/gasket_interrupt.c:4:
./include/linux/eventfd.h:87:20: note: declared here
87 | static inline void eventfd_signal(struct eventfd_ctx *ctx)
| ^~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/gasket/1.0/build/gasket_interrupt.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/var/lib/dkms/gasket/1.0/build/gasket_core.c: In function ‘gasket_register_device’:
/var/lib/dkms/gasket/1.0/build/gasket_core.c:1841:41: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
1841 | class_create(driver_desc->module, driver_desc->name);
| ~~~~~~~~~~~^~~~~~~~
| |
| struct module *
In file included from ./include/linux/device.h:31,
from ./include/linux/cdev.h:8,
from /var/lib/dkms/gasket/1.0/build/gasket_core.h:11,
from /var/lib/dkms/gasket/1.0/build/gasket_core.c:12:
./include/linux/device/class.h:228:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
228 | struct class * __must_check class_create(const char *name);
| ~~~~~~~~~~~~^~~~
/var/lib/dkms/gasket/1.0/build/gasket_core.c:1841:17: error: too many arguments to function ‘class_create’
1841 | class_create(driver_desc->module, driver_desc->name);
| ^~~~~~~~~~~~
./include/linux/device/class.h:228:29: note: declared here
228 | struct class * __must_check class_create(const char *name);
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/gasket/1.0/build/gasket_core.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.8.0-44-generic/Makefile:1925: /var/lib/dkms/gasket/1.0/build] Error 2
make: *** [Makefile:240: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.8.0-44-generic'
I've tried building the driver myself but am still having issues:
$ git clone https://github.com/google/gasket-driver.git
$ cd gasket-driver
$ debuild -us -uc -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 <[email protected]>
dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
fakeroot 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
fakeroot debian/rules binary
dh binary --with dkms
dh_testroot
dh_prep
debian/rules override_dh_install
make[1]: Entering directory '/home/mark/Downloads/gasket-driver'
dh_install src/* usr/src/gasket-1.0/
make[1]: Leaving directory '/home/mark/Downloads/gasket-driver'
dh_installdocs
dh_installchangelogs
debian/rules override_dh_dkms
make[1]: Entering directory '/home/mark/Downloads/gasket-driver'
dh_dkms -V 1.0
make[1]: Leaving directory '/home/mark/Downloads/gasket-driver'
dh_installudev
dh_perl
dh_link
dh_strip_nondeterminism
dh_compress
dh_fixperms
dh_missing
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package 'gasket-dkms' in '../gasket-dkms_1.0-18_all.deb'.
dpkg-genbuildinfo --build=binary -O../gasket-dkms_1.0-18_amd64.buildinfo
dpkg-genchanges --build=binary -O../gasket-dkms_1.0-18_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
fakeroot debian/rules clean
dh clean --with dkms
dh_clean
dpkg-source --after-build .
dpkg-buildpackage: info: binary-only upload (no source included)
Now running lintian gasket-dkms_1.0-18_amd64.changes ...
E: gasket-dkms changes: bad-distribution-in-changes-file unstable
Finished running lintian.
Click to expand!
Issue Type
Bug, Build/Install
Operating System
Ubuntu
Coral Device
M.2 Accelerator B+M
Other Devices
No response
Programming Language
Python 3.9
Relevant Log Output
No response
I'm having the exact same problem when trying to install with Ubuntu 24.04.1 LTS
Did you ever get this problem solved?
Same issue... same question.
Thanks.
I finally got mine working following the below list of commands
uname -r
lsmod | grep apex
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
apt-get update
apt-get install gasket-dkms libedgetpu1-std -y
sh -c "echo 'SUBSYSTEM==\"apex\", MODE=\"0660\", GROUP=\"apex\"' >> /etc/udev/rules.d/65-apex.rules"
groupadd apex
adduser $USER apex
reboot
lspci -nn | grep 089a
apt install pve-headers-$(uname -r)
apt install proxmox-default-headers -y
apt install dh-dkms devscripts git -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
reboot
ls /dev/apex*
Same issue; Unable install via apt, unable to build from source.
Kernel: 6.8.0-45-generic OS: Ubuntu 24.04.1 LTS TPU Device: Coral M2
Same issue same problem. USB. Noble.
Got it working :) see below if that might help for your TPU Device:
LT;DR
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 update
sudo apt install dh-dkms gasket-dkms libedgetpu1-std devscripts git debhelper -y #prolly redundant packages
git clone https://github.com/google/gasket-driver; cd gasket-driver
debuild -us -uc -tc -b -d
sudo sh -c "echo 'SUBSYSTEM==\"apex\", MODE=\"0660\", GROUP=\"apex\"' >> /etc/udev/rules.d/65-apex.rules"
sudo groupadd apex
sudo adduser $USER apex
after a reboot or 'modprobe -a gasket':
ls /dev/apex_0
/dev/apex_0
lspci -nn | grep 089a: 05:00.0 System peripheral [0880]: Global Unichip Corp. Coral Edge TPU [1ac1:089a]
lsb_release -a: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04.1 LTS Release: 24.04 Codename: noble
uname -a: Linux node02 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
######## Longer version:
git clone https://github.com/google/gasket-driver; cd gasket-driver
/gasket/gasket-driver$ 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 <[email protected]>
dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
fakeroot debian/rules clean
**dh clean --with dkms**
make: dh: No such file or directory
make: *** [debian/rules:6: clean] Error 127
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
debuild: fatal error at line 1184:
dpkg-buildpackage -us -uc -ui -tc -b -d failed
debhelper was missing: sudo apt install debhelper it created the 'gasket-dkms_1.0-18_all.deb'
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 <[email protected]>
dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
fakeroot 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
fakeroot debian/rules binary
dh binary --with dkms
dh_testroot
dh_prep
debian/rules override_dh_install
make[1]: Entering directory '/home/ubuntu/gasket/gasket-driver'
dh_install src/* usr/src/gasket-1.0/
make[1]: Leaving directory '/home/ubuntu/gasket/gasket-driver'
dh_installdocs
dh_installchangelogs
debian/rules override_dh_dkms
make[1]: Entering directory '/home/ubuntu/gasket/gasket-driver'
dh_dkms -V 1.0
make[1]: Leaving directory '/home/ubuntu/gasket/gasket-driver'
dh_installudev
dh_perl
dh_link
dh_strip_nondeterminism
dh_compress
dh_fixperms
dh_missing
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package 'gasket-dkms' in '../gasket-dkms_1.0-18_all.deb'.
dpkg-genbuildinfo --build=binary -O../gasket-dkms_1.0-18_amd64.buildinfo
dpkg-genchanges --build=binary -O../gasket-dkms_1.0-18_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
fakeroot debian/rules clean
dh clean --with dkms
dh_clean
dpkg-source --after-build .
dpkg-buildpackage: info: binary-only upload (no source included)
Now running lintian gasket-dkms_1.0-18_amd64.changes ...
E: gasket-dkms changes: bad-distribution-in-changes-file unstable
Finished running lintian.
sudo dpkg -i ../gasket-dkms_1.0-18_all.deb
(Reading database ... 169151 files and directories currently installed.)
Preparing to unpack gasket-dkms_1.0-18_all.deb ...
Deleting module gasket-1.0 completely from the DKMS tree.
Unpacking gasket-dkms (1.0-18) over (1.0-18) ...
Setting up gasket-dkms (1.0-18) ...
Loading new gasket-1.0 DKMS files...
Deprecated feature: REMAKE_INITRD (/usr/src/gasket-1.0/dkms.conf)
Building for 6.8.0-45-generic 6.8.0-47-generic
Building initial module for 6.8.0-45-generic
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Done.
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
gasket.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-45-generic/updates/dkms/
apex.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-45-generic/updates/dkms/
depmod...
Building initial module for 6.8.0-47-generic
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Done.
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
gasket.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-47-generic/updates/dkms/
apex.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-47-generic/updates/dkms/
depmod...
sudo sh -c "echo 'SUBSYSTEM=="apex", MODE="0660", GROUP="apex"' >> /etc/udev/rules.d/65-apex.rules" sudo groupadd apex sudo adduser $USER apex
after a reboot or 'modprobe -a gasket':
ubuntu@node02:~$ id
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd),119(docker),1001(apex)
ubuntu@node02:~$ ls /dev/apex_0
/dev/apex_0
ubuntu@node02:~$ modinfo gasket
filename: /lib/modules/6.8.0-45-generic/updates/dkms/gasket.ko.zst
author: Rob Springer <[email protected]>
license: GPL v2
version: 1.1.4
description: Google Gasket driver framework
import_ns: DMA_BUF
srcversion: 584E4F871D5CD164F02B2D2
depends:
retpoline: Y
name: gasket
vermagic: 6.8.0-45-generic SMP preempt mod_unload modversions
sig_id: PKCS#7
signer: node02 Secure Boot Module Signature key
sig_key: 3C:0E:1B:C2:50:C6:0F:F5:FE:3F:FC:10:70:9F:AC:C5:8F:FA:B2:54
sig_hashalgo: sha512
signature: C1:43:D6:7A:4F:72:07:49:14:3C:F7:01:57:88:A6:4B:BB:62:B3:63:
32:7B:7B:FB:AC:A7:70:33:BA:18:63:30:74:B7:43:74:87:7E:59:11:
<snipped>
70:4F:AD:9F:89:1A:2C:28:59:A2:28:68:6E:0C:49:DE:33:D6:FD:81:
<snipped>
BD:F1:8A:BE:C4:B6:44:D7:85:43:25:AA:CF:1F:52:B7:B8:97:BF:37:
21:59:D3:92:7F:D0:BF:D9:0C:DD:D1:9B:A4:81:4A:03
parm: dma_bit_mask:int
TEST if it actually works!
cat > Dockerfile << EOF FROM debian:10
WORKDIR /home ENV HOME /home RUN cd ~ RUN apt-get update RUN apt-get install -y git nano python3-pip python-dev pkg-config wget usbutils curl
RUN echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main"
| tee /etc/apt/sources.list.d/coral-edgetpu.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get update
RUN apt-get install -y edgetpu-examples
EOF
docker build -t "coral" .
docker run -it --device /dev/apex_0:/dev/apex_0 coral /bin/bash
INYOURCONTAINER python3 /usr/share/edgetpu/examples/classify_image.py --model /usr/share/edgetpu/examples/models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --label /usr/share/edgetpu/examples/models/inat_bird_labels.txt --image /usr/share/edgetpu/examples/images/bird.bmp
---------------------------
Poecile atricapillus (Black-capped Chickadee)
Score : 0.44140625
---------------------------
Poecile carolinensis (Carolina Chickadee)
Score : 0.29296875
Same issue for me as well on Ubuntu 24.04.1 LTS. The instructions from @JagdSeelen / @djieno worked for me as well
i don´t have the apex directory i use the m2 key coral dual tpu i don´t get any errors with the solution provided by @djieno but it will not work for me :( i use a intel nuc, removed the wifi card an installed the coral tpu
EDIT an hour or four later: I finally managed to disable "secure boot" in my BIOS (HP Z1 G5 cannot use the numkey pad for the reboot PIN, you need the keys along the top of the keyboard) and now I see
ls /dev/apex*
/dev/apex_0
and $ sudo modprobe gives a null response, which I think is correct (because that's what I see on my Dell box which works correctly).
I'll leave all of this here in case it helps anyone else.
I can't get these very helpful instructions from @djieno and @JagdSeelen to work for me. Please can you see if there something I am doing wrong?
I've got a new machine (HP Z1 G5, CPU=i9-9900) with a new installation of linux mint 22 on it and I just can't get the OS to recognise my m.2 single TPU (bare metal, not via proxmox/VMs etc.).
The same OS on my old machine (Dell T7500) is fully working with this same TPU (I set it up back in June but the exact process, similar I recall to the ones described here, are now lost to me). Frigate runs fine on the Dell (Docker compose, 0.15 betas) and I was hoping to move to the new box.
In the Dell the m.2 TPU's installed in a pci card wifi adaptor; on the HP it plugs into the WiFi m.2 slot on the mobo.
Fore the new HP:
lsb_release -a
Distributor ID: Linuxmint
Description: Linux Mint 22
Release: 22
Codename: wilma```
and
```uname -a```
```Linux HPZ1G5 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux```
On either machine, ```$ lspci -nn | grep 089a``` shows me ```03:00.0 System peripheral [0880]: Global Unichip Corp. Coral Edge TPU [1ac1:089a]``` so I know the hardware is detected correctly.
Local git cloning/building of gasket completes in a .deb which then installs OK once the helper had been installed:
```~/gasket-driver$ debuild -us -uc -tc -b -d```
and I see
```gasket-dkms_1.0-18_all.deb
gasket-dkms_1.0-18_amd64.build
gasket-dkms_1.0-18_amd64.buildinfo
gasket-dkms_1.0-18_amd64.changes
and the deb install itself:
sudo dpkg -i gasket-dkms_1.0-18_all.deb
(Reading database ... 549729 files and directories currently installed.)
Preparing to unpack gasket-dkms_1.0-18_all.deb ...
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Module gasket-1.0 for kernel 6.8.0-51-generic (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.
gasket.ko.zst:
- Uninstallation
- Deleting from: /lib/modules/6.8.0-51-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
apex.ko.zst:
- Uninstallation
- Deleting from: /lib/modules/6.8.0-51-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
Deleting module gasket-1.0 completely from the DKMS tree.
Unpacking gasket-dkms (1.0-18) over (1.0-18) ...
Setting up gasket-dkms (1.0-18) ...
Loading new gasket-1.0 DKMS files...
Deprecated feature: REMAKE_INITRD (/usr/src/gasket-1.0/dkms.conf)
Building for 6.8.0-51-generic
Building initial module for 6.8.0-51-generic
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Done.
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/gasket/1.0/source/dkms.conf)
gasket.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-51-generic/updates/dkms/
apex.ko.zst:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.8.0-51-generic/updates/dkms/
depmod...
The apex groups and users have all set correctly but after rebooting I see
$ modprobe -a gasket
modprobe: ERROR: could not insert 'gasket': Operation not permitted
or
$ sudo modprobe -a gasket
modprobe: ERROR: could not insert 'gasket': Key was rejected by service
Other observations to help confirm some things are OK but others I am not sure about:
$ ls /dev/apex* on my old Dell works, but not on my new HP: ls: cannot access '/dev/apex*': No such file or directory
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - ; sudo apt update results in me being told
N: Skipping acquisition of configured file 'main/binary-i386/Packages', as repository 'https://packages.cloud.google.com/apt coral-edgetpu-stable InRelease' doesn't support architecture 'i386'
(which to me seems inconsequential seeing as my machine and OS is a 64 bit environment).
I've tried it twice, with a complete OS reinstall in-between. I think I have followed the instructions accurately each time. The first time was with a load of secure boot options enabled in Bios which I didn't understand, and the second time I disabled them (thinking that something to do with driver signing was messing things up) but I get the same sorts of errors each time.
Can anyone help please?