edgetpu icon indicating copy to clipboard operation
edgetpu copied to clipboard

Install gasket-dkms not supported on Linux kernel 6.0

Open lamosty opened this issue 2 years ago • 11 comments

Description

Hi. Recently, I've built a PC with the newest Intel 13th gen CPU and Ubuntu 22.04. I had to switch to Linux kernel 6 for proper CPU and iGPU support.

Following the Get started m.2 guide, I was unable to install or build gasket-dkms. I tried to follow the steps from this issue but the result is that it's unsupported:

sudo dpkg -i *.deb
Selecting previously unselected package gasket-dkms.
(Reading database ... 266328 files and directories currently installed.)
Preparing to unpack gasket-dkms_1.0-18_all.deb ...
Unpacking gasket-dkms (1.0-18) ...
Setting up gasket-dkms (1.0-18) ...
Loading new gasket-1.0 DKMS files...
Building for 6.0.9-060009-generic
Building initial module for 6.0.9-060009-generic
ERROR (dkms apport): kernel package linux-headers-6.0.9-060009-generic is not supported
Error! Bad return status for module build on kernel: 6.0.9-060009-generic (x86_64)
Consult /var/lib/dkms/gasket/1.0/build/make.log for more information.
dpkg: error processing package gasket-dkms (--install):
 installed gasket-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 gasket-dkms

Could you please update the gasket-driver to support Linux kernel 6?

Click to expand!

Issue Type

Build/Install

Operating System

Ubuntu

Coral Device

No response

Other Devices

No response

Programming Language

No response

Relevant Log Output

No response

lamosty avatar Dec 26 '22 18:12 lamosty

Hi @lamosty can you please share the gasker-driver build logs with Linux Kernel 6.

hjonnala avatar Jan 09 '23 22:01 hjonnala

Wed Jul 26 01:37:04 PM EEST 2023
make: Entering directory '/usr/src/linux-headers-6.4.5-x64v4-xanmod1'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc-12 (Debian 12.3.0-5~bpo12+1) 12.3.0
  You are using:           gcc (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.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_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:230:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
  230 | 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:230:29: note: declared here
  230 | struct class * __must_check class_create(const char *name);
      |                             ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:252: /var/lib/dkms/gasket/1.0/build/gasket_core.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:2187: /var/lib/dkms/gasket/1.0/build] Error 2
make: Leaving directory '/usr/src/linux-headers-6.4.5-x64v4-xanmod1'

sigxcpu76 avatar Jul 26 '23 10:07 sigxcpu76

According to sources around the internet, it's kernel 6.4 specifically that causes this issue. From the ArchLinux AUR, someone had success simply changing this class_create function call to use one param as specified, so I guess the fix has to determine which kernel version gasket-dkms is being compiled on?

bawachhe avatar Sep 08 '23 14:09 bawachhe

I've simply changed the call to only use the second param and things are working fine. That unblocks me, I'm happy.

pgenera avatar Sep 09 '23 19:09 pgenera

I thinks it's the same bug I had to pin the linux kernel 6.1.0-11-amd64 in Debian 12 stable because the current linux-image-amd64 6.1.0-13-amd64 is broken with gasket

grigio avatar Oct 09 '23 22:10 grigio

Same issue with kernel 6.5, and couldn't get the apex driver to work. Disappointed with the lack of support for the edge tpu with newer kernels

arigit avatar Oct 18 '23 21:10 arigit

This was fixed a few months ago in https://github.com/google/gasket-driver/ already; for my use case I just built the .deb from that repo directly and deployed across my Coral-bearing machines.

dewet22 avatar Nov 10 '23 01:11 dewet22

Glad to see that a fix exists! Is there an update schedule or policy for when we might see this new version added to the https://packages.cloud.google.com/apt coral-edgetpu-stable repository?

felixc avatar Nov 25 '23 19:11 felixc

for me this bug is fixed

Debian 12 / Linux 6.1.55-1 (2023-09-29) x86_64 GNU/Linux

Check to have all the repo enabled

cat /etc/apt/sources.list
deb http://deb.debian.org/debian stable  main contrib non-free-firmware non-free
deb http://deb.debian.org/debian stable-updates main contrib non-free-firmware non-free 
deb http://security.debian.org/debian-security/ stable-security main non-free-firmware non-free contrib

grigio avatar Nov 25 '23 19:11 grigio

For anyone coming here this is broken again in Kernel >=6.8, Proxmox is shipping with kernel 6.8.2 since today.

Working patch is available in https://github.com/google/gasket-driver/pull/26 but not merged yet.

kub3let avatar Apr 24 '24 16:04 kub3let

For anyone coming here this is broken again in Kernel >=6.8, Proxmox is shipping with kernel 6.8.2 since today.

Working patch is available in google/gasket-driver#26 but not merged yet.

[deleted self-deprecating comment about not being smart enough for linux... it still might be true but see Edit-2]

Edit-1: also, to add to the confusion: it looks like the fix in pull 26 was merged. But only on git source? So official repo "https://packages.cloud.google.com/apt" is not the same team/code as "https://github.com/google/gasket-driver" ?

Edit-2: kept following the links above, led me to this : Build Driver; and it appears to have worked. No errors following the entire link, and final grep check shows the apex device.

CraigeryTheKid avatar May 21 '24 21:05 CraigeryTheKid