question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Support]: PCI-e Coral TPU not recognized in Frigate. bare metal, HA supervised docker qemux86-64 install

See original GitHub issue

Describe the problem you are having

Hello,

I have an M.2 dual TPU card in a pci-e adapter that worked when I test ran the coral demo bird library in command line before installing Frigate on a bare metal workstation, HA supervised docker qemux86-64 install. However, the TPU is not detected in the Frigate logs (at bottom). Now after the Frigate install the coral bird demo no longer works. What is causing this issue and how might I correct it? Thank you blakeblackshear for all of your knowledgeable help, and work on this project.

John

`

Version

Home Assistant 2021.10.6 Frontend version: 20211007.1 - latest

Frigate config file

mqtt:
  host: 192.168.XXX.XXX
  user: XXX
  password: XXX

cameras:
  driveway_cam:
    ffmpeg:
      inputs:
        - path: rtsp://XXX:XXX@192.168.XXX.XXX:554/11
          roles: 
            - detect
            - rtmp

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

Relevant log output

~$ lspci -nn | grep 089a
07:00.0 System peripheral [0880]: Global Unichip Corp. Coral Edge TPU [1ac1:089a]



[2021-10-24 02:17:16] frigate.app                    INFO    : Starting Frigate (0.9.1-800f33e)
[2021-10-24 02:17:16] frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
[2021-10-24 02:17:16] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2021-10-24 02:17:16] peewee_migrate                 INFO    : There is nothing to migrate
[2021-10-24 02:17:16] frigate.mqtt                   INFO    : MQTT connected
[2021-10-24 02:17:16] detector.coral1                INFO    : Starting detection process: 217
[2021-10-24 02:17:16] frigate.app                    INFO    : Output process started: 220
Process detector:coral1:
Process detector:coral2:
[2021-10-24 02:17:16] ws4py                          INFO    : Using epoll
[2021-10-24 02:17:16] frigate.app                    INFO    : Camera processor started for driveway_cam: 236
[2021-10-24 02:17:16] detector.coral2                INFO    : Starting detection process: 219
[2021-10-24 02:17:16] frigate.app                    INFO    : Capture process started for driveway_cam: 237
[2021-10-24 02:17:16] ws4py                          INFO    : Using epoll
[2021-10-24 02:17:16] frigate.edgetpu                INFO    : Attempting to load TPU as pci:1
[2021-10-24 02:17:16] frigate.edgetpu                ERROR   : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors.
[2021-10-24 02:17:16] frigate.edgetpu                INFO    : Attempting to load TPU as pci:0
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
    delegate = Delegate(library, options)
  File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 119, in __init__
    raise ValueError(capture.message)
[2021-10-24 02:17:28] frigate.edgetpu                ERROR   : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors.
app                    INFO    : Stopping...

FFprobe output from your camera

ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[rtsp @ 0x5556048cff00] UDP timeout, retrying with TCP
[rtsp @ 0x5556048cff00] Could not find codec parameters for stream 0 (Video: h264, none, 1280x720): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://xxx:xxx@192.168.xxx.xxx:554/11':
  Metadata:
    title           : 10
  Duration: N/A, bitrate: 64 kb/s
    Stream #0:0: Video: h264, none, 1280x720, 90k tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

Frigate stats

No response

Operating system

Debian

Install method

Docker CLI

Coral version

M.2

Network connection

Wired

Camera make and model

Generic RTSP

Any other information that may be helpful

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jb2590commented, Oct 26, 2021

I think it was a flakey PCIE adapter card. I bought a m.2 ekey to mpcie adapter, chmod 777 /dev/apex_0, and tried it in a notebook pc and the coral is detected in frigate now.

Thanks for the help, John

0reactions
scytocommented, Oct 26, 2021

@jb2590 isnt supervised in a container - as such how are you expecting PCI devices to be passed through into the container? you will need to make sure the container gives you full host privileges, by default IIRC home assistant docker implementation doesn’t do that… hopefully the 777 fix suggested above is enough, else make sure the container if full privileged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coral TPU not detected by HA blue for Frigate - Configuration
Hi, I added a Coral TPU (USB) to my HA blue, but it's not detected by HA and Frigate will not start, if...
Read more >
Coral Pcie not detected in docker : r/unRAID - Reddit
I just got a mini cpie coral and installed it in unraid. Downloaded the driver and the unraid system page shows the device:...
Read more >
Remote Frigate in Docker with Home Assistant Integration
Install Frigate in Docker on Bare Metal or VM and Integrate it with Home Assistant. Support this channel by becoming a ...
Read more >
Coral TPU, how to install? - ServeTheHome Forums
I put both of them in a PCI-E mini pcie adapter ,and run Frigate (docker) inside an ubuntu VM under proxmox - which...
Read more >
[SUPPORT] blakeblackshear - Frigate - Page 13
Yes I saw this post and unchecked the TPU in Dveice and rebooted . I also tried to unbind by echo "0000:01:00.0" >...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found