Closed sanderlv closed 1 year ago
Your log errors have nothing to do with the coral. Your config also does not match up with the logs given that you are using vaapi in the logs but that is not included in your config.
vaapi is in config.
What does it have to do with then?
I think it has to do with the other topic and my NUC12 CPU is not "supported" atm. Correct?
Your device is supported without issue, you're trying to use vaapi but your GPU hasn't been passed through to frigate, that's the issue in the logs.
So removing
Would solve my issue?
it would solve the error in the logs, but you definitely want hwaccel enabled so most likely you'll want to fix your docker or whatever config is used to run frigate
Not sure what to fix then... config is above
your compose config is not included in this post
True, sorry thought is was.
version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "256mb" # update for your cameras based on calculation above
devices:
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
# - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
volumes:
- /etc/localtime:/etc/localtime:ro
- /frigate/config/config.yml:/config/config.yml
- /frigate/media:/media/frigate
- /frigate/db:/db
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "password"
Okay, what happens if you run ls /dev/dri
on your host?
ubuntu@frigate-02:~$ ls /dev/dri
by-path card0 renderD128
Think i'm hitting this: https://github.com/blakeblackshear/frigate/issues/4138
Now getting:
frigate | 2023-05-14 18:21:15.353612002 [2023-05-14 18:21:15] ffmpeg.voordeur.detect ERROR : Device creation failed: -5.
frigate | 2023-05-14 18:21:15.353613016 [2023-05-14 18:21:15] ffmpeg.voordeur.detect ERROR : [h264 @ 0x56041ae1a480] No device available for decoder: device type vaapi needed for codec h264.
frigate | 2023-05-14 18:21:15.353613942 [2023-05-14 18:21:15] ffmpeg.voordeur.detect ERROR : Device setup failed for decoder on input stream #0:0 : Input/output error
frigate | 2023-05-14 18:21:19.133177848 [2023-05-14 18:21:19] frigate.video ERROR : voordeur: Unable to read frames from ffmpeg process.
frigate | 2023-05-14 18:21:19.133522376 [2023-05-14 18:21:19] frigate.video ERROR : voordeur: ffmpeg process is not running. exiting capture thread...
frigate | 2023-05-14 18:21:25.356230032 [2023-05-14 18:21:25] watchdog.voordeur ERROR : Ffmpeg process crashed unexpectedly for voordeur.
frigate | 2023-05-14 18:21:25.356289592 [2023-05-14 18:21:25] watchdog.voordeur ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
frigate | 2023-05-14 18:21:25.356317689 [2023-05-14 18:21:25] ffmpeg.voordeur.detect ERROR : [AVHWDeviceContext @ 0x561bbba4c7c0] Failed to initialise VAAPI connection: -1 (unknown libva error).
frigate | 2023-05-14 18:21:25.356353206 [2023-05-14 18:21:25] ffmpeg.voordeur.detect ERROR : Device creation failed: -5.
frigate | 2023-05-14 18:21:25.356395411 [2023-05-14 18:21:25] ffmpeg.voordeur.detect ERROR : [h264 @ 0x561bbb67a5c0] No device available for decoder: device type vaapi needed for codec h264.
frigate | 2023-05-14 18:21:25.356398535 [2023-05-14 18:21:25] ffmpeg.voordeur.detect ERROR : Device setup failed for decoder on input stream #0:0 : Input/output error
frigate | 2023-05-14 18:21:29.142009254 [2023-05-14 18:21:29] frigate.video ERROR : voordeur: Unable to read frames from ffmpeg process.
frigate | 2023-05-14 18:21:29.142424858 [2023-05-14 18:21:29] frigate.video ERROR : voordeur: ffmpeg process is not running. exiting capture thread...
frigate | 2023-05-14 18:21:35.360648497 [2023-05-14 18:21:35] watchdog.voordeur ERROR : Ffmpeg process crashed unexpectedly for voordeur.
frigate | 2023-05-14 18:21:35.362663731 [2023-05-14 18:21:35] watchdog.voordeur ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
frigate | 2023-05-14 18:21:35.362666557 [2023-05-14 18:21:35] ffmpeg.voordeur.detect ERROR : [AVHWDeviceContext @ 0x560eda556c00] Failed to initialise VAAPI connection: -1 (unknown libva error).
compose:
version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "256mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
# - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
volumes:
- /etc/localtime:/etc/localtime:ro
- /frigate/config/config.yml:/config/config.yml
- /frigate/media:/media/frigate
- /frigate/db:/db
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "password"
if that is the case then it is an issue with your host driver version and you should update it
Followed this: https://coral.ai/docs/accelerator/get-started/#1-install-the-edge-tpu-runtime
And all is fine...
2023-05-15 06:37:00.831856030 06:37:00.831 INF [rtsp] listen addr=:8554
2023-05-15 06:37:00.832426146 06:37:00.832 INF [srtp] listen addr=:8443
2023-05-15 06:37:00.832575269 06:37:00.832 INF [webrtc] listen addr=:8555
2023-05-15 06:37:01.304711695 [2023-05-15 06:37:01] frigate.app INFO : Starting Frigate (0.12.0-da3e197)
2023-05-15 06:37:01.324397201 [2023-05-15 06:37:01] peewee_migrate INFO : Starting migrations
2023-05-15 06:37:01.330122519 [2023-05-15 06:37:01] peewee_migrate INFO : There is nothing to migrate
2023-05-15 06:37:01.339761875 [2023-05-15 06:37:01] frigate.app INFO : Output process started: 217
2023-05-15 06:37:01.342564892 [2023-05-15 06:37:01] frigate.app INFO : Camera processor started for voordeur: 220
2023-05-15 06:37:01.344888643 [2023-05-15 06:37:01] frigate.app INFO : Capture process started for voordeur: 221
2023-05-15 06:37:03.510589901 [2023-05-15 06:37:01] detector.coral INFO : Starting detection process: 216
2023-05-15 06:37:03.510723726 [2023-05-15 06:37:01] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2023-05-15 06:37:03.516354627 [2023-05-15 06:37:03] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
2023-05-15 06:37:05.337008675 [2023-05-15 06:37:05] frigate.video ERROR : voordeur: Unable to read frames from ffmpeg process.
2023-05-15 06:37:05.337204593 [2023-05-15 06:37:05] frigate.video ERROR : voordeur: ffmpeg process is not running. exiting capture thread...
2023-05-15 06:37:10.479257289 [INFO] Starting go2rtc healthcheck service...
2023-05-15 06:37:21.362421443 [2023-05-15 06:37:21] watchdog.voordeur ERROR : Ffmpeg process crashed unexpectedly for voordeur.
2023-05-15 06:37:21.362514290 [2023-05-15 06:37:21] watchdog.voordeur ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-15 06:37:21.362517908 [2023-05-15 06:37:21] ffmpeg.voordeur.detect ERROR : [AVHWDeviceContext @ 0x5571edcf28c0] Failed to initialise VAAPI connection: -1 (unknown libva error).
2023-05-15 06:37:21.362540490 [2023-05-15 06:37:21] ffmpeg.voordeur.detect ERROR : Device creation failed: -5.
2023-05-15 06:37:21.362569943 [2023-05-15 06:37:21] ffmpeg.voordeur.detect ERROR : [h264 @ 0x5571edcfab40] No device available for decoder: device type vaapi needed for codec h264.
2023-05-15 06:37:21.362592930 [2023-05-15 06:37:21] ffmpeg.voordeur.detect ERROR : Device setup failed for decoder on input stream #0:0 : Input/output error
2023-05-15 06:37:25.644677305 [2023-05-15 06:37:25] frigate.video ERROR : voordeur: Unable to read frames from ffmpeg process.
2023-05-15 06:37:25.645040513 [2023-05-15 06:37:25] frigate.video ERROR : voordeur: Unable to read frames from ffmpeg process.
2023-05-15 06:37:25.645163750 [2023-05-15 06:37:25] frigate.video ERROR : voordeur: ffmpeg process is not running. exiting capture thread...
2023-05-15 06:37:31.366346215 [2023-05-15 06:37:31] watchdog.voordeur ERROR : Ffmpeg process crashed unexpectedly for voordeur.
2023-05-15 06:37:31.366446676 [2023-05-15 06:37:31] watchdog.voordeur ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-15 06:37:31.366448097 [2023-05-15 06:37:31] ffmpeg.voordeur.detect ERROR : [AVHWDeviceContext @ 0x55d2452e3e40] Failed to initialise VAAPI connection: -1 (unknown libva error).
2023-05-15 06:37:31.366463303 [2023-05-15 06:37:31] ffmpeg.voordeur.detect ERROR : Device creation failed: -5.
2023-05-15 06:37:31.366492985 [2023-05-15 06:37:31] ffmpeg.voordeur.detect ERROR : [h264 @ 0x55d2451d3200] No device available for decoder: device type vaapi needed for codec h264.
2023-05-15 06:37:31.366515978 [2023-05-15 06:37:31] ffmpeg.voordeur.detect ERROR : Device setup failed for decoder on input stream #0:0 : Input/output error
2023-05-15 06:37:35.145701360 [2023-05-15 06:37:35] frigate.video ERROR : voordeur: Unable to read frames from ffmpeg process.
2023-05-15 06:37:35.146091614 [2023-05-15 06:37:35] frigate.video ERROR : voordeur: Unable to read frames from ffmpeg process.
2023-05-15 06:37:35.146129615 [2023-05-15 06:37:35] frigate.video ERROR : voordeur: ffmpeg process is not running. exiting capture thread...
2023-05-15 06:37:41.370470976 [2023-05-15 06:37:41] watchdog.voordeur ERROR : Ffmpeg process crashed unexpectedly for voordeur.
2023-05-15 06:37:41.370573437 [2023-05-15 06:37:41] watchdog.voordeur ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-15 06:37:41.370574791 [2023-05-15 06:37:41] ffmpeg.voordeur.detect ERROR : [AVHWDeviceContext @ 0x55ead0aeca40] Failed to initialise VAAPI connection: -1 (unknown libva error).
2023-05-15 06:37:41.370579227 [2023-05-15 06:37:41] ffmpeg.voordeur.detect ERROR : Device creation failed: -5.
2023-05-15 06:37:41.370602853 [2023-05-15 06:37:41] ffmpeg.voordeur.detect ERROR : [h264 @ 0x55ead0aee200] No device available for decoder: device type vaapi needed for codec h264.
Looks like the driver on the host for the GPU hasn't been updated yet
Again, I think I did... what else should be done than?
Can you run vainfo on the host and in frigate, paste both here please
Like this?
Host:
ubuntu@frigate-02:~$ vainfo
Command 'vainfo' not found, but can be installed with:
sudo apt install vainfo
ubuntu@frigate-02:~$
ubuntu@frigate-02:~$ vainfo
error: can't connect to X server!
error: failed to initialize display
ubuntu@frigate-02:~$
frigate:
2023-05-15 12:20:09.823170393 [2023-05-15 12:20:09] watchdog.voordeur ERROR : Ffmpeg process crashed unexpectedly for voordeur.
2023-05-15 12:20:09.823173320 [2023-05-15 12:20:09] watchdog.voordeur ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-15 12:20:09.823174349 [2023-05-15 12:20:09] ffmpeg.voordeur.detect ERROR : [AVHWDeviceContext @ 0x56354f8c9d80] Failed to initialise VAAPI connection: -1 (unknown libva error).
2023-05-15 12:20:09.823175331 [2023-05-15 12:20:09] ffmpeg.voordeur.detect ERROR : Device creation failed: -5.
2023-05-15 12:20:09.823176244 [2023-05-15 12:20:09] ffmpeg.voordeur.detect ERROR : [h264 @ 0x56354f8c7f00] No device available for decoder: device type vaapi needed for codec h264.
2023-05-15 12:20:09.823177005 [2023-05-15 12:20:09] ffmpeg.voordeur.detect ERROR : Device setup failed for decoder on input stream #0:0 : Input/output error
vainfo
2023-05-15 12:20:13.628202271 [2023-05-15 12:20:13] frigate.video ERROR : voordeur: Unable to read frames from ffmpeg process.
2023-05-15 12:20:13.628789110 [2023-05-15 12:20:13] frigate.video ERROR : voordeur: ffmpeg process is not running. exiting capture thread...
2023-05-15 12:20:19.827466221 [2023-05-15 12:20:19] watchdog.voordeur ERROR : Ffmpeg process crashed unexpectedly for voordeur.
2023-05-15 12:20:19.829360054 [2023-05-15 12:20:19] watchdog.voordeur ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-15 12:20:19.829362659 [2023-05-15 12:20:19] ffmpeg.voordeur.detect ERROR : [AVHWDeviceContext @ 0x55623de484c0] Failed to initialise VAAPI connection: -1 (unknown libva error).
2023-05-15 12:20:19.829363752 [2023-05-15 12:20:19] ffmpeg.voordeur.detect ERROR : Device creation failed: -5.
2023-05-15 12:20:19.829364738 [2023-05-15 12:20:19]
You'll need to install it on your host then, frigate webUI has a vainfo button you can use for that
Frigate
{"return_code":3,"stderr":"error:XDG_RUNTIME_DIRisinvalidornotsetintheenvironment.nerror:can'tconnecttoXserver!nlibvainfo:VA-APIversion1.17.0nlibvainfo:Tryingtoopen/usr/lib/x86_64-linux-gnu/dri/vmwgfx_drv_video.sonlibvainfo:va_openDriver()returns-1nvaInitializefailedwitherrorcode-1(unknownlibvaerror),exit","stdout":""}
Host
ubuntu@frigate-02:~$ vainfo
error: can't connect to X server!
error: failed to initialize display
ubuntu@frigate-02:~$
Doesn't look like any GPU drivers are installed
How would I do that? I never did that in proxmox....
I passed through the usb coral and selected these settings now for video:
I'm not 100% sure, you'll likely need to ask elsewhere or wait for someone who uses proxmox to explain. But the lack of vainfo makes it clear that the driver is the problem
I meant to say, in proxmox all worked "out of the box". Now in ESXi not yet.
In proxmox I never had to install any "drivers", not on the host as well on the guest. Just run Frigate in Docker (with complexity at that level) works fine. (Even in LXC - Thus Proxmox, LXC, Docker).
Where would a "driver" need to be installed when using esxi and ubuntu. I followed the coral installation manual and installed it in the ubuntu guast on esxi with which the coral usb is passed through.
The GPU would need to be passed through as a PCIe device to the Ubuntu VM and the driver needs to be installed in Ubuntu VM.
The thing is, it's an Intel NUC12. There's no GPU in there. And that same is also the case with another NUC(8) which has no gpu.
Both have a usb coral attached. The proxmox one (nuc8) works fine (as described above). But not the esxi one.
What do you mean with a gpu here? Cpu? Or coral?
You are incorrect, the nuc supports display output so of course it has a GPU which is integrated in the CPU.
Got you now, will dig into that.
So my problem with esxi is that the "gpu" (in the cpu) is not passed through to the guest.
If it is not then that is definitely the problem
So my problem with esxi is that the "gpu" (in the cpu) is not passed through to the guest.
I don't know the Frigate software ... but if it requires a GPU, then it sounds like you're missing a requirement to properly run and this has nothing to do w/Coral device?
The Intel NUC can passthrough the iGPU to VM, see https://williamlam.com/2022/11/updated-findings-for-passthrough-of-intel-nuc-integrated-graphics-igpu.html
It'll add a new render and you can successfully access it as shown below (BTW this is using Intel NUC w/Ubuntu 20.04)
# vainfo --display drm --device /dev/dri/renderD129
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.14.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.4.3 (74f40ee)
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
....
I assume you'll need to then pass this render + Coral device into Frigate Docker/Docker Compose configuration .... but the Coral TPU is detected afaict:
frigate | 2023-05-16 22:47:52.650948875 [2023-05-16 22:47:50] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
frigate | 2023-05-16 22:47:52.650986331 [2023-05-16 22:47:52] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the problem you are having
See logs, it is not working.
I have succesfully passed though usb via vmware esxi:
Version
0.12.0-da3e197
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
Other
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
hikvision
Any other information that may be helpful
I have this camera also on another frigate instance via proxmox that works fine.