Frigate + nvidia gpu detection with tensorrt

Just wanted to start a discussion thread about using the new tensorrt detector with frigate.

I got it working in a docker ubuntu 22.04 server vm hosted on proxmox. I’m passing through a MSI 1080 gpu.

I just started using it so I haven’t quite figured out all the power moves one can do with frigate. Like getting masking and zones set up. I’m sure that is just a youtube video away.

But if anyone has questions or would like help, maybe we can assist each other in here.

Just wanted to say, youtube videos are typically quite out of date and lead to more confusion than they do help. The frigate docs are up to date and include a step by step guide for each thing you’d want to setup.

Especially since we just released 0.12 which changed many things

1 Like

For my setup, I have had to jump through hoops, lol. I’m still trying to get Nvidia-vaapi drivers setup in Ubuntu 22.04. there isn’t an apt install package for it. I think my config is generally excessive.

But I have a small issue with the cameras. Reolink 811a, lol.

I have them being decoded by the GPU in 4k. I’m not getting artifacts and junk like when I tried Shinobi. So that’s a win.

But the cameras main stream is h265, and the sub is h264. Frigate Nvidia presets are one or the other, so I can use the sub steam for just viewing, and the main for recording.

Or I need to figure out restream properly.

But for now, I’m down this vaapi rabbit hole.

vaapi is intel or amd, not nvidia (nvidia is cuda for decoding and nvenc for encoding)

yes, but you can set the preset at the stream level, so it is not a problem

cameras:
  reolink:
    ffmpeg:
      inputs:
        - path: rtsp://h265
          hwaccel_args: preset-nvidia-h265
          roles:
            - record
        - path: rtsp://h264
          hwaccel_args: preset-nvidia-h264
          roles:
            - detect

Oh hey that’s awesome.

There is a 3rd party repo for vaapi-nvidia.

is there a reason you are trying to use vaapi vs just using the built in cuda / nvenc that frigate already supports?

Not really beyond just getting it to work.

I didn’t know I could decode each stream seperate in a single camera. So that’s helpful. Thanks again.

With rtmp deprecated, is there a difference ‘role’ for restream?

if you have nvidia-container setup correctly (the driver) it will work out of the box

There is no role, the restream is done automatically for the live view and the integration when there is a stream under go2rtc with a name which exactly matches a name of a camera in cameras section

oh, yeah that is working. I’m just wanting the vaapi driver to work. only just because. call it self education.

Hello. Are you using Home asssistant ? Is that installed on the same host ?

running hassos in a vm on proxmox. Frigate is running as a docker container under another vm

1 Like

Thank You for the answer. Sorry for so late comment) I thought this was an old thread… At this momet i am running HA on debian host as supervised home assistant. This installation can not provide me tensor rt by nvidia GPU (in my case quadro p620)? yes or no i am not sure… By official instructure i have to install Frigate to host (hassio addon doesnot support the nvidia runtime… ) but i think if i will do that i will get unsupported installation of HA…
P.S. i use Lenovo ThinkCentre M91p i3-2100 8Gb RAM, i think there is enough power for proxmox, but have never use that…

I have some questions about just getting it working with proxmox ubuntu vm. I have similar system to yours. I cant able to figure out get it working.
1- how did you figured make the docker container use your gpu ?
2- Can you mention what did you make to get it working ?

Check this guide out.

1 Like

I checked that but I need configs about Frigate and Docker. I have done the GPU passthrough successfully. (even run heaven benchmark on windows10 vm) I also checked Frigate docs but nothing worked as expected and I kept getting errors while running docker compose up.

my docker compose file :
frigate: container_name: frigate privileged: true # this may not be necessary for all setups restart: always image: ghcr.io/blakeblackshear/frigate:stable shm_size: "250mb" # update for your cameras based on calculation above devices: - /dev/dri/renderD128 - /dev/nvidia0:/dev/nvidia0 volumes: - /etc/localtime:/etc/localtime:ro - /home/nex/frigate/config.yml:/config/config.yml - /mnt/hdd1:/media/frigate - 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: "passwd"

I don’t get any errors in this config but still doesn’t work at live view