google / gasket-driver

GNU General Public License v2.0
47 stars 29 forks source link

Error installing gasket-dkms driver on Ubuntu 24.04 LTS #27

Closed captainkev76 closed 3 months ago

captainkev76 commented 3 months ago

Hi,

I've built a new VM today using Ubuntu 24.04 LTS which was released yesterday.

I've passed through my two Coral TPUs and am trying to install the PCIe drivers and TPU runtime as per the tutorial at https://www.derekseaman.com/2023/06/home-assistant-frigate-vm-on-proxmox-with-pcie-coral-tpu.html.

When I do so, I get this error:

Error! Bad return status for module build on kernel: 6.8.0-31-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

The full output of "more /var/lib/dkms/gasket/1.0/build/make.log" is:

DKMS make.log for gasket-1.0 for kernel 6.8.0-31-generic (x86_64)
Fri 26 Apr 15:47:23 UTC 2024
make: Entering directory '/usr/src/linux-headers-6.8.0-31-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
  CC [M]  /var/lib/dkms/gasket/1.0/build/gasket_sysfs.o
  CC [M]  /var/lib/dkms/gasket/1.0/build/apex_driver.o
/var/lib/dkms/gasket/1.0/build/gasket_interrupt.c: In function ‘gasket_handle_in
terrupt’:
/var/lib/dkms/gasket/1.0/build/gasket_interrupt.c:161:17: error: too many argume
nts 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=inc
ompatible-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-31-generic/Makefile:1926: /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-31-generic'

I should add that I previously had this working perfectly on 22.04 LTS on the same Proxmox host. Like many others, I found that the drivers stopped working once Proxmox and Ubuntu were updated recently. Despite many attempts, I've been unable to get the drivers to load correctly and consistently in 22.04, hence me trying out 24.04.

robertzaage commented 3 months ago

The package in the Google repository is outdated and missing some important fixes, which were already merged here almost a year ago.

That means, you need to build and install the package yourself.

captainkev76 commented 3 months ago

I believe this is what I did, but I freely admit to being out of my depth here. Here are the steps I took:

git clone https://github.com/google/gasket-driver.git
cd gasket-driver/
cd src/
nano gasket_interrupt.c

[Checked that the changes you made to the interupts this week are included in the version I cloned]

cd ..
debuild -us -uc -tc -b
cd ..
dpkg -i gasket-dkms_1.0-18_all.deb

Thank you for the work you do here!

robertzaage commented 3 months ago

Your build log indicates your missing the latest commit.

Please try uninstalling the gasket-dkms package, then remove gasket-driver directory and the source folder /var/lib/dkms/gasket if still existent. After that, clone the repo again, then repeat the build steps and install the new package.

captainkev76 commented 3 months ago

Hi Robert - this seems to have done the trick! Thanks for your help