edgetpu: /dev/apex_0 Not Found

Edit: This was being set up on an Intel NUC. This issue was resolved by disabling secure boot in the BIOS.

I’ve installed the M.2 TPU and followed the steps, but when running the last step I am hitting this error. I’ve followed some of the other issues and can’t find any similarity.

$ ls /dev/apex_0
ls: cannot access '/dev/apex_0': No such file or directory

Here is the information for the system.

$ uname -a
Linux overseer 4.19.0-17-amd64 #1 SMP Debian 4.19.194-1 (2021-06-10) x86_64 GNU/Linux

$ dpkg -l | grep gasket
ii  gasket-dkms  1.0-16  all  DKMS source for the gasket driver

$ dpkg -l | grep edgetpu
ii  libedgetpu1-std:amd64  15.0  amd64        Support library for Edge TPU

$ lspci -nnk
...
3b:00.0 System peripheral [0880]: Device [1ac1:089a]
   Subsystem: Device [1ac1:089a]
   Kernel modules: apex

$ sudo modinfo apex
filename:       /lib/modules/4.19.0-17-amd64/updates/dkms/apex.ko
author:         John Joseph <jnjoseph@google.com>
license:        GPL v2
version:        1.2
description:    Google Apex driver
srcversion:     37A768932BDAF006DA92150
alias:          pci:v00001AC1d0000089Asv*sd*bc*sc*i*
depends:        gasket
retpoline:      Y
name:           apex
vermagic:       4.19.0-17-amd64 SMP mod_unload modversions 
parm:           allow_power_save:int
parm:           allow_sw_clock_gating:int
parm:           allow_hw_clock_gating:int
parm:           bypass_top_level:int
parm:           trip_point0_temp:int
parm:           trip_point1_temp:int
parm:           trip_point2_temp:int
parm:           hw_temp_warn1:int
parm:           hw_temp_warn2:int
parm:           hw_temp_warn1_en:bool
parm:           hw_temp_warn2_en:bool
parm:           temp_poll_interval:int

$ sudo modinfo gasket
filename:       /lib/modules/4.19.0-17-amd64/updates/dkms/gasket.ko
author:         Rob Springer <rspringer@google.com>
license:        GPL v2
version:        1.1.4
description:    Google Gasket driver framework
srcversion:     A7A1F644810CD4FF575450E
depends:        
retpoline:      Y
name:           gasket
vermagic:       4.19.0-17-amd64 SMP mod_unload modversions 
parm:           dma_bit_mask:int

Build Log

$ cat /var/lib/dkms/gasket/1.0/4.19.0-17-amd64/x86_64/log/make.log     
DKMS make.log for gasket-1.0 for kernel 4.19.0-17-amd64 (x86_64)
Mon 28 Jun 2021 03:10:46 PM EDT
make: Entering directory '/usr/src/linux-headers-4.19.0-17-amd64'
  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
  LD [M]  /var/lib/dkms/gasket/1.0/build/apex.o
  LD [M]  /var/lib/dkms/gasket/1.0/build/gasket.o
  Building modules, stage 2.
  MODPOST 2 modules
  CC      /var/lib/dkms/gasket/1.0/build/apex.mod.o
  CC      /var/lib/dkms/gasket/1.0/build/gasket.mod.o
  LD [M]  /var/lib/dkms/gasket/1.0/build/gasket.ko
  LD [M]  /var/lib/dkms/gasket/1.0/build/apex.ko
make: Leaving directory '/usr/src/linux-headers-4.19.0-17-amd64'

recordmcount

$ file /usr/src/linux-headers-4.19.0-17-amd64/scripts/recordmcount
/usr/src/linux-headers-4.19.0-17-amd64/scripts/recordmcount: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=1bacfdbec27fa68c40e4dd69a78d208493e55556, stripped

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18

Most upvoted comments

@manoj7410 While digging into a separate issue I disabled secure boot and it’s now working. This may be an issue specific to the NUC since I was having failures running a wireguard docker image that cleared up once I disabled it. This might be worth including in the troubleshooting documents specific to the NUC platform.

$ ls /dev/apex_0 
/dev/apex_0

Classification test

$ python3 examples/classify_image.py \
> --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
> --labels test_data/inat_bird_labels.txt \
> --input test_data/parrot.jpg
----INFERENCE TIME----
Note: The first inference on Edge TPU is slow because it includes loading the model into Edge TPU memory.
11.6ms
2.6ms
2.5ms
2.6ms
2.5ms
-------RESULTS--------
Ara macao (Scarlet Macaw): 0.75781

@TaylorBurnham I’ll join the chorus here, Thank you for posting a solution. Everything seemed to be working OK except for the creation of /dev/apex_0 on a Dell 7060 micro desktop. Turning off secure boot solved the last part of the puzzle.

@TaylorBurnham Thank you for posting your resolution. I couldn’t figure what was up, and this has solved the problem for me.

@TaylorBurnham I owe you a cold one sir!! After 6 hours of messing around with this thing, disabling secure boot fixed it. Thanks!!

@TaylorBurnham I saw that option somewhere on the internet but was hesitant to share here without testing. Anyways, good to know that it works. Thanks for letting us know.