Using Coral M.2 TPU in Wifi Slot

Hi there,

I am using a coral m.2 TPU in my wifi slot and it had worked previously during a proof of concept phase and it is no longer work in my released system.

-------How do I correct my configuration to enable the Croal M.2 EdgeTPU?--------

Here is my error in addon logs of HomeAssistant:
2024-03-03 23:28:28.212141230 [2024-03-03 17:28:28] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as /dev/apex/apex_0
2024-03-03 23:28:28.212164628 Process detector:coral_pci:
2024-03-03 23:28:28.212222809 [2024-03-03 17:28:28] frigate.detectors.plugins.edgetpu_tfl ERROR : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors.

Coral TPU info from HA Hardware Info:
DEVNAME: /dev/apex_0
DEVPATH: /devices/pci0000:00/0000:00:01.3/0000:02:00.0/apex/apex_0
MAJOR: ‘120’
MINOR: ‘0’
SUBSYSTEM: apex

Current and not working FRIGATE configuration:
detectors:
coral_pci:
type: edgetpu
device: /dev/apex/apex_0

Different iterations of Frigate detector section with no success:
detectors:
coral:
type: edgetpu
device: /devices/pci0000:00/0000:00:01.3/0000:02:00.0/apex/apex_0

detectors:
coral:
type: edgetpu
device: devices/pci0000:00/0000:00:01.3/0000:02:00.0/apex/apex_0

detectors:
coral1:
type: edgetpu
device: pci:0

detectors:
coral1:
type: edgetpu
device: /devices/pci0000:00/0000:00:01.3/0000:02:00.0/apex/apex_0

detectors:
coral1:
type: edgetpu
device: /dev/apex_0

detectors:
coral_pci:
type: edgetpu
device: /dev/apex_0

detectors:
coral_pci:
type: edgetpu
device: pci:0

detectors:
coral_pci:
type: edgetpu
device: /devices/pci0000:00/0000:00:01.3/0000:02:00.0/apex/apex_0

detectors:
coral_pci:
type: edgetpu
device: /dev/pci0000:00/0000:00:01.3/0000:02:00.0/apex/apex_0

detectors:
coral_pci:
type: edgetpu
device: /pci0000:00/0000:00:01.3/0000:02:00.0

detectors:
coral_pci:
type: edgetpu
device: /pci0000:00/0000:00:01.3/0000:02:00.0/apex/apex_0

detectors:
coral_pci:
type: edgetpu
device: /apex/apex_0

detectors:
coral_pci:
type: edgetpu
device: /dev/apex/apex_0

I’m not sure if this is related to your setup or not. I’ve got a ‘Rube Goldberg’ mashup of a Coral M.2 B+M PCIe card inserted one of these WLAN/BT PCI 3 cards via the 2nd adapter list below:

https://www.amazon.com/dp/B0779727FY?th=1

All running on a Proxmox intel machine.

What I found was that the Coral device does not ‘play well’ in the PCI world at times. Both with the PCI bus in general and perhaps with other PCI cards.

Take a close look at the message via ‘dmesg’ :

dmesg -T --color=always | less -R

I ended up with these kernel config option and it seems to work fine with my Debian 11 VM inside Proxmox, I think the ‘pcie_aspm=off’ was the most significant effect on Coral stability.

in : /etc/default/grub :
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on acpi_enforce_resources=no pcie_aspm=off"

Good hunting!

Hi @normalee1993

I’m afraid my post may not be that helpful. I’ve just had a quick look at my config to see if that would help you. But it looks like what is working on my system is one of the options you have already tried.

Device Details from HA System Hardware

DEVNAME: /dev/apex_0
DEVPATH: /devices/pci0000:00/0000:00:14.1/0000:02:00.0/apex/apex_0
MAJOR: '120'
MINOR: '0'
SUBSYSTEM: apex

Working Frigate Config

detectors:
  coral:
    type: edgetpu
    device: pci:0

image

Do you have any objects to track defined?

I’m struggling to recall but there was a small wrinkle in getting this working. I want to say the system page was recognising the detector but none of the cameras was reporting any detections. I recall working through the Frigate docs for detection and adding things to the config eventually got it to start detecting objects.

My config only has the detector details as above, a model statement defining a 320 x 320 analysis area and the objects to be tracked. Given the model size is just a restatement of the defaults and adding the objects to detect is the final piece of config, I want to say that was the missing piece for me.

The path probably changed
Probably no longer /dev/apex0

Verify path

Do you have a way to verify the path?

No objects tracked defined yet. Just moved into a new home and no longer in my test space. I do have roles set for all cameras to detect. But that is it for roles for now until i get this tpu working

spent all arvo searching for the fix to this, finally found it.

Before you start the addon, disable protection mode, fixed it for me instantly! and i used PCI:0

Hope it helps!

Thanks for the suggestion! Unfortunately protection mode is already disabled as I am running Home Assistant OS and using Frigate Full access. It is disabled by default in that scenario.