[HW Accel Support]: Adding radeontop for arm64? #13878
-
Describe the problem you are havingI've got an AMD GPU used for video decoding under arm64, and I get some very minor breakage (no GPU stats) and nuisance error messages due to not having radeontop available. I can temporarily get things running happily by installing radeontop in the container: I believe the right place to change this permanently would be to add radeontop to the list in install_deps.sh , but I'm not familiar with all the ramifications of and testing for adding it there. Is this a trivial change that would be possible for the very few users running AMD cards on arm64? Or would this take some deeper consideration and testing? (and yes, it's a weird setup, but a low-end, low-profile AMD card works great to get video decoding acceleration where I otherwise would have to use CPU decoding.) Note: running 0.14.0 instead of 0.14.1 due to an unrelated issue. Version0.14.0-da913d8 In which browser(s) are you experiencing the issue with?No response Frigate config filemqtt:
host: ####redacted####
#port: 1883
#ui:
#use_experimental: true
# Optional: Set the default live mode for cameras in the UI (default: shown below)
#live_mode: mse
#live_mode: webrtc
model:
path: ####redacted####
ffmpeg:
hwaccel_args: preset-vaapi
output_args:
record: preset-record-generic-audio-copy
go2rtc:
streams:
#subtype 0 is high resolution
#subtype 1 is low resolution
drivewayhigh:
- rtsp://####redacted####:554/cam/realmonitor?channel=1&subtype=0
- ffmpeg:rtsp_cam#audio=aac#audio=opus # <- copy of the stream which transcodes audio to opus
drivewayhigh_sub:
- rtsp://####redacted####:554/cam/realmonitor?channel=1&subtype=1
- ffmpeg:rtsp_cam#audio=aac#audio=opus # <- copy of the stream which transcodes audio to opus
doorbell:
- rtsp://####redacted####:554/h264Preview_01_main
- ffmpeg:doorbell#audio=aac
porchzoom:
- rtsp://####redacted####/Streaming/Channels/1
porchzoom_sub:
- rtsp://####redacted####/Streaming/Channels/2
attic:
- rtsp://####redacted####/Streaming/Channels/1
attic_sub:
- rtsp://####redacted####/Streaming/Channels/2
backporchsouth:
- rtsp://####redacted####/Streaming/Channels/1
backporchsouth_sub:
- rtsp://####redacted####/Streaming/Channels/2
sideyard:
- rtsp://####redacted####/Streaming/Channels/1
sideyard_sub:
- rtsp://####redacted####/Streaming/Channels/2
webrtc:
candidates:
- 10.3.0.6:8555
- stun:8555
cameras:
drivewayhigh:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/drivewayhigh?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- record
- detect
- audio
#- rtmp
#- detect
output_args:
record: preset-record-generic-audio-copy
#detect:
#width: 704
#height: 480
#width: 1296
#height: 972
record:
enabled: true
retain:
days: 7
mode: all
events:
retain:
default: 14
mode: motion
audio:
enabled: true # <- enable audio events
snapshots:
enabled: true
review:
alerts:
required_zones:
- yard
- driveway
- neighboryard
#motion:
#threshold: 15
zones:
yard:
coordinates: 500,230,665,207,935,306,301,432,409,602,205,711,110,335
driveway:
coordinates: 2688,1520,539,1520,302,1352,49,783,379,629,274,443,763,327,2688,783
filters:
car:
threshold: 0.89
min_area: 25000
person:
threshold: 0.87
min_area: 16000
cat:
threshold: 0.85
dog:
threshold: 0.85
deer:
threshold: 0.85
neighboryard:
coordinates: 2688,453,2688,671,791,287,742,194,814,125,995,137
sideyard:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/sideyard_sub?video=copy
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/sideyard?video=copy
input_args: preset-rtsp-restream
roles:
- record
output_args:
record: preset-record-generic-audio-copy
audio:
enabled: false # <- enable audio events
detect:
width: 640
height: 360
record:
enabled: true
events:
retain:
default: 14
#mode: motion
# required_zones:
#- yard
snapshots:
enabled: true
required_zones:
- yard
review:
alerts:
required_zones:
- yard
motion:
mask:
- 0,0,640,0,640,139,421,163,393,212,295,223,117,164,72,81,0,59
zones:
yard:
coordinates: 0,360,640,360,640,268,410,205,277,219,0,132
filters:
person:
threshold: 0.99
car:
threshold: 0.97
cat:
threshold: 0.95
dog:
threshold: 0.95
deer:
threshold: 0.95
package:
threshold: 0.99
#audio:
# enabled: False # <- enable audio events
doorbell:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/doorbell?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- record
- detect
detect:
#width: 896
#height: 672
fps: 5
record:
enabled: true
retain:
days: 7
mode: all
events:
retain:
default: 14
mode: motion
snapshots:
enabled: true
required_zones:
- street_passing_by
- porch
review:
alerts:
required_zones:
- yard
- driveway
- porch
motion:
mask:
#- 0,36,896,36,896,283,540,261,185,258,0,286 # for 640x480
- 0,262,2560,260,2560,1031,2352,1203,1705,1072,1472,968,494,915,0,987
zones:
street_passing_by:
#coordinates: 104,340,324,362,545,366,795,356,896,340,896,401,559,460,210,436,0,423,0,301 # for 640x480
coordinates: 865,1180,1372,1233,2407,1142,2414,969,323,926,220,1030
filters:
car:
# Optional: minimum width*height of the bounding box for the detected object (default: 0)
min_area: 16000 # 4000
threshold: 0.85
person:
#min_area: 5000
#max_area: 100000
threshold: 0.84
porch:
#coordinates: 896,672,896,415,517,495,488,452,294,449,207,497,0,672
coordinates:
2560,1920,2560,1290,2367,1238,1667,1425,1661,1489,1464,1518,1435,1444,726,1417,582,1440,0,1899
filters:
person:
threshold: 0.85
cat:
threshold: 0.85
dog:
threshold: 0.85
deer:
threshold: 0.65
package:
threshold: 0.65
driveway:
coordinates: 0,1850,521,1443,779,1377,1055,1222,673,1155,338,1205,0,1389
filters:
car:
# Optional: minimum width*height of the bounding box for the detected object (default: 0)
min_area: 16000 # 4000
threshold: 0.85
person:
#min_area: 5000
#max_area: 100000
threshold: 0.84
yard:
coordinates: 879,1398,1392,1419,2182,1272,2144,1203,1577,1233,1099,1201
audio:
enabled: false # <- enable audio events
porchzoom:
#enabled: false
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/porchzoom_sub?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- detect
##- rtmp
- path: rtsp://127.0.0.1:8554/porchzoom?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- record
#- rtmp
#- detect
output_args:
record: preset-record-generic-audio-copy
detect:
#width: 704
#height: 480
width: 640
height: 360
record:
enabled: true
snapshots:
enabled: true
review:
alerts:
required_zones:
- yard
- woods
zones:
yard:
coordinates: 640,360,640,176,189,161,0,360
filters:
person:
threshold: 0.85
car:
threshold: 0.85
cat:
threshold: 0.85
dog:
threshold: 0.85
deer:
threshold: 0.85
neighboryard:
coordinates: 181,116,0,267,0,137
woods:
coordinates: 494,163,640,176,640,45,0,40,0,129,189,111,188,162
filters:
person:
threshold: 0.85
car:
threshold: 0.85
cat:
threshold: 0.85
dog:
threshold: 0.85
deer:
threshold: 0.85
audio:
enabled: false # <- enable audio events
#motion:
#threshold: 15
#mask:
#- 0,0,704,0,704,201,478,228,250,227,0,248
attic:
#enabled: false
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/attic_sub?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/attic?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- record
output_args:
record: preset-record-generic
#detect:
#width: 640
#height: 360
record:
enabled: true
retain:
days: 60
mode: motion
snapshots:
enabled: true
audio:
enabled: false # <- enable audio events
backporchsouth:
#enabled: false
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/backporchsouth_sub?video=copy
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/backporchsouth?video=copy
input_args: preset-rtsp-restream
roles:
- record
output_args:
record: preset-record-generic-audio-copy
detect:
width: 640
height: 360
record:
enabled: true
snapshots:
enabled: true
required_zones:
- yard
review:
alerts:
required_zones:
- yard
zones:
neighboryard:
coordinates: 640,0,640,151,582,125,458,83,315,59,320,0
yard:
coordinates: 0,360,505,360,614,158,504,96,372,68,236,73,0,144
#motion:
#threshold: 15
#mask:
#- 0,0,704,0,704,201,478,228,250,227,0,248
audio:
enabled: false # <- enable audio events
woodscam:
enabled: false
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/woodscam_sub?video=copy
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/woodscam?video=copy
input_args: preset-rtsp-restream
roles:
- record
output_args:
record: preset-record-generic-audio-copy
# r
audio:
enabled: false # <- enable audio events
detect:
width: 640
height: 360
record:
enabled: true
snapshots:
enabled: true
objects:
track:
- person
- face
- license_plate
- dog
- cat
- car
- deer
- amazon
- fedex
- ups
- package
filters:
dog:
min_score: .7
threshold: .9
cat:
min_score: .65
threshold: .8
face:
min_score: .7
package:
min_score: .65
threshold: .9
license_plate:
min_score: .6
amazon:
min_score: .75
ups:
min_score: .75
fedex:
min_score: .75
person:
min_score: .65
threshold: .85
car:
min_score: .65
threshold: .89
audio:
enabled: true
listen:
- bark
- fire_alarm
- scream
- speech
- yell
- gunshot
- reversing_beeps
- siren
detect:
stationary:
# Optional: Frequency for running detection on stationary objects (default: 0)
# When set to 0, object detection will never be run on stationary objects. If set to 10, it will be run on every 10th frame.
interval: 10
review:
alerts:
labels:
- car
- cat
- dog
- person
- speech
- package
- deer
record:
expire_interval: 60
retain:
days: 7
mode: all
export:
timelapse_args: -vf setpts=0.005*PTS -r 60
events:
pre_capture: 10
post_capture: 60
retain:
default: 20
#mode: motion
logger:
# Optional: Default log verbosity (default: info)
default: info
birdseye:
# Optional: Mode of the view. Available options are: objects, motion, and continuous
# objects - cameras are included if they have had a tracked object within the last 30 seconds
# motion - cameras are included if motion was detected in the last 30 seconds
# continuous - all cameras are included always
mode: continuous
detectors:
coral_pci:
type: edgetpu
device: pci
#cpu1:
#type: cpu
# num_threads: 4
#cpu2:
#type: cpu
#num_threads: 4
#cpu3:
#type: cpu
#num_threads: 4
#cpu4:
#type: cpu
#num_threads: 4
version: 0.14 docker-compose file or Docker CLI commandfrigate:
container_name: frigate
# enabling privileged for coral TPU
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:0.14.0
networks:
- default
environment:
- LIBVA_DRIVER_NAME=radeonsi
- PLUS_API_KEY=###redacted###
ports:
- "5000:5000"
- "1936:1935" # RTMP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
- "8554:8554" # RTSP restream
- "1984:1984" # gortc debug
shm_size: "1024mb" # update for your cameras based on calculation above
devices:
#- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
- /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128:/dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
- /dev/dri:/dev/dri
volumes:
#- /etc/localtime:/etc/localtime:ro
#- $DOCKERDIR/appdata/frigate/config.yml:/config/config.yml:rw
- $DOCKERDIR/appdata/frigate/:/config/:rw
#- $DOCKERDIR/appdata/frigate/storage:/media/frigate
- /bulk2/frigate/storage:/media/frigate
#- $DOCKERDIR/appdata/frigate/jellyfin-deb:/jellyfin-deb
- /usr/share/zoneinfo/America/New_York:/etc/localtime:ro
#- /usr/bin/radeontop:/usr/sbin/radeontop:ro
#- /usr/lib/aarch64-linux-gnu/libpciaccess.so.0.11.1:/usr/lib/aarch64-linux-gnu/libpciaccess.so.0.11.1:ro
#- /usr/lib/aarch64-linux-gnu/libpciaccess.so.0:/usr/lib/aarch64-linux-gnu/libpciaccess.so.0:ro
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
logging:
options:
max-size: "10m"
max-file: "3" Relevant Frigate log output�[36mfrigate |�[0m 2024-09-21 16:31:24.023638192 [INFO] Starting certsync...
�[36mfrigate |�[0m s6-rc: info: service legacy-services successfully started
�[36mfrigate |�[0m 2024-09-21 16:31:24.183941588 127.0.0.1 - - [21/Sep/2024:16:31:24 -0400] "" 400 0 "-" "-" "-"
�[36mfrigate |�[0m 2024-09-21 16:31:26.057280458 [2024-09-21 16:31:26] asyncio ERROR : Task exception was never retrieved
�[36mfrigate |�[0m 2024-09-21 16:31:26.057292738 future: <Task finished name='Task-11' coro=<set_gpu_stats() done, defined at /opt/frigate/frigate/stats/util.py:137> exception=FileNotFoundError(2, 'No such file or directory')>
�[36mfrigate |�[0m 2024-09-21 16:31:26.057295858 Traceback (most recent call last):
�[36mfrigate |�[0m 2024-09-21 16:31:26.057298538 File "/opt/frigate/frigate/stats/util.py", line 210, in set_gpu_stats
�[36mfrigate |�[0m 2024-09-21 16:31:26.057301578 amd_usage = get_amd_gpu_stats()
�[36mfrigate |�[0m 2024-09-21 16:31:26.057304178 File "/opt/frigate/frigate/util/services.py", line 236, in get_amd_gpu_stats
�[36mfrigate |�[0m 2024-09-21 16:31:26.057336258 p = sp.run(
�[36mfrigate |�[0m 2024-09-21 16:31:26.057338898 File "/usr/lib/python3.9/subprocess.py", line 505, in run
�[36mfrigate |�[0m 2024-09-21 16:31:26.057341178 with Popen(*popenargs, **kwargs) as process:
�[36mfrigate |�[0m 2024-09-21 16:31:26.057343538 File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
�[36mfrigate |�[0m 2024-09-21 16:31:26.057388338 self._execute_child(args, executable, preexec_fn, close_fds,
�[36mfrigate |�[0m 2024-09-21 16:31:26.057391098 File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
�[36mfrigate |�[0m 2024-09-21 16:31:26.057415698 raise child_exception_type(errno_num, err_msg, err_filename)
�[36mfrigate |�[0m 2024-09-21 16:31:26.057418378 FileNotFoundError: [Errno 2] No such file or directory: 'radeontop' Relevant go2rtc log outputNot relevant FFprobe output from your cameraNot relevant Operating systemDebian Install methodDocker Compose Network connectionWired Camera make and modelAmcrest, Hikvision, and Reolink Screenshots of the Frigate UI's System metrics pages
Any other information that may be helpfulNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I don't see a reason it can't be installed in the arm build |
Beta Was this translation helpful? Give feedback.
-
First off, it's absolutely fantastic that the build now includes radeontop. Thanks for adding that! ... but now I have a related problem, and I'm hoping someone here happens to know the details. On upgrading to 0.15.0, I noticed hardware encoding with my old Radeon RX 550 wasn't working. Upon closer investigation, it looks like vaapi support is not included in either the v5 or v7 ffmpeg variants that are installed with 0.15.0. So that's odd. This makes a little bit of sense - I remember reading something a while back about a change-up of which ffmpeg is being used. Looking around through, the upstream ffmpeg version (both BtbN and Nickm-27 ) have this info:
(emphasis on last line) To add sprinkles on top of my confusion ice cream: my host system (Debian 12) ships ffmpeg 5.1.6 with vaapi compiled in - so debian did it somehow. Now I'm totally confused. I swear this was working with vaapi HW acceleration under 0.14 - I even had to comment it from the config when I switched to the beta! I even monitored usage with radeontop. But it looks like the version of ffmpeg that we've been using since at least 0.13 can't have worked with vaapi on ARM64? Any idea how this could have ever worked under 0.14? Also, I'm guessing folks here keep up with ffmpeg versions and builds much more closely than I do, so any thoughts on my chances of finding an ARM ffmpeg release with libva/ vaapi (that still works with Frigate)? Or what went down that caused libva to not be in BtbN / Nickm-27's builds? I can run CPU decoding for 5 cameras if I have to (ugh), but I'd really like to use the much more efficient GPU. (and yes, this is what I get for using an AMD card under ARM64.) |
Beta Was this translation helpful? Give feedback.
I don't see a reason it can't be installed in the arm build