Closed csreynolds closed 1 year ago
Cc @NateMeyer
What is your config file? Looks like the model dimensions are off.
Nevermind, I am blind.
What is your config file? Looks like the model dimensions are off.
Nevermind, I am blind.
All good. I should have added that if I change detectors to cpu it runs fine.
It's really just the cuda version present/expected mismatch that is stopping the gpu from being used.
edit: forgot the word cuda
The model size is off though, it should be a square (640x640) not 640x480
ooo Hot tip! This is my first stab at getting this going, forgive my ignorance config side.
I've changed it to the following but still errors out before it even loads the model because of the cannot find libcudart.so.12
detectors:
tensorrt:
type: tensorrt
device: 0 #This is the default, select the first GPU
model:
path: /trt-models/yolov7x-640.trt
input_tensor: nchw
input_pixel_format: rgb
width: 640
height: 640
I've run this with with Cuda 12.0 on my machine. I'll update to 12.1 and confirm it still works.
Works on my machine with Cuda 12.1
Sat Apr 15 11:23:19 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.46 Driver Version: 531.61 CUDA Version: 12.1 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce GTX 1080 Ti On | 00000000:26:00.0 On | N/A |
| 37% 42C P0 66W / 300W| 1033MiB / 11264MiB | 1% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 20 G /Xwayland N/A |
| 0 N/A N/A 20 G /Xwayland N/A |
| 0 N/A N/A 22 G /Xwayland N/A |
+---------------------------------------------------------------------------------------+
And the tensorrt detector seems to load without issue.
frigate-tensor-frigate-1 | 2023-04-15 11:18:13.207724731 [2023-04-15 11:18:13] frigate.app INFO : Starting Frigate (0.12.0-da3e197)
frigate-tensor-frigate-1 | 2023-04-15 11:18:13.223706414 [2023-04-15 11:18:13] frigate.app INFO : Creating directory: /tmp/cache
frigate-tensor-frigate-1 | 2023-04-15 11:18:13.225429917 [2023-04-15 11:18:13] peewee_migrate INFO : Starting migrations
frigate-tensor-frigate-1 | 2023-04-15 11:18:13.242344340 [2023-04-15 11:18:13] peewee_migrate INFO : There is nothing to migrate
frigate-tensor-frigate-1 | 2023-04-15 11:18:13.252592370 [2023-04-15 11:18:13] frigate.app INFO : Output process started: 1012
frigate-tensor-frigate-1 | 2023-04-15 11:18:13.255297902 [2023-04-15 11:18:13] frigate.app INFO : Camera processor started for front_door: 1016
frigate-tensor-frigate-1 | 2023-04-15 11:18:13.259829838 [2023-04-15 11:18:13] frigate.app INFO : Capture process started for front_door: 1017
frigate-tensor-frigate-1 | 2023-04-15 11:18:13.675196273 [2023-04-15 11:18:13] detector.tensorrt INFO : Starting detection process: 1010
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.050631486 [2023-04-15 11:18:13] frigate.detectors.plugins.tensorrt DEBUG : Num Available Devices: 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.240346821 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::GridAnchor_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.264781621 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::GridAnchorRect_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.264968439 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::NMS_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265023879 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Reorg_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265088342 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Region_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265117792 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Clip_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265167981 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::LReLU_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265229074 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::PriorBox_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265282080 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Normalize_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265330376 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::ScatterND version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265386113 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::RPROI_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265409563 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::BatchedNMS_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265458414 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::BatchedNMSDynamic_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265513928 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::BatchTilePlugin_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265571943 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::FlattenConcat_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265627332 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::CropAndResize version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265667431 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::CropAndResizeDynamic version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265724901 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::DetectionLayer_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265772981 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::EfficientNMS_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265828185 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::EfficientNMS_ONNX_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265876289 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::EfficientNMS_Explicit_TF_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.265927539 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::EfficientNMS_Implicit_TF_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266012016 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::ProposalDynamic version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266067606 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Proposal version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266111787 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::ProposalLayer_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266163947 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::PyramidROIAlign_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266234391 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::ResizeNearest_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266257260 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Split version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266317320 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::SpecialSlice_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266400034 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::InstanceNormalization_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266418884 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::InstanceNormalization_TRT version 2
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266471782 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::CoordConvAC version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266499212 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::DecodeBbox3DPlugin version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266549594 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::GenerateDetection_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266602132 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::MultilevelCropAndResize_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266657952 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::MultilevelProposeROI_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266727919 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::NMSDynamic_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266791470 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::PillarScatterPlugin version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266867739 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::VoxelGeneratorPlugin version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266939599 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::MultiscaleDeformableAttnPlugin_TRT version 1
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.266985218 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt INFO : [MemUsageChange] Init CUDA: CPU +189, GPU +0, now: CPU 245, GPU 1140 (MiB)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.284277268 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt INFO : Loaded engine size: 34 MiB
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.539384998 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Using cublas as a tactic source
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.539468007 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt INFO : [MemUsageChange] Init cuBLAS/cuBLASLt: CPU +194, GPU +74, now: CPU 501, GPU 1250 (MiB)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.539698935 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Using cuDNN as a tactic source
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.646830924 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt INFO : [MemUsageChange] Init cuDNN: CPU +111, GPU +44, now: CPU 612, GPU 1294 (MiB)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.653447819 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Deserialization required 369097 microseconds.
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.659505728 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt INFO : [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +34, now: CPU 0, GPU 34 (MiB)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660080924 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Using cublas as a tactic source
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660146422 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt INFO : [MemUsageChange] Init cuBLAS/cuBLASLt: CPU +0, GPU +8, now: CPU 577, GPU 1286 (MiB)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660203452 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Using cuDNN as a tactic source
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660256341 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt INFO : [MemUsageChange] Init cuDNN: CPU +0, GPU +8, now: CPU 577, GPU 1294 (MiB)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660310521 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Total per-runner device persistent memory is 570880
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660361301 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Total per-runner host persistent memory is 102816
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660416590 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Allocated activation device memory of size 12979200
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660476899 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt INFO : [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +12, now: CPU 0, GPU 46 (MiB)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660533488 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Allocated Tensor Binding input Memory 2076672 Bytes (519168 * DataType.FLOAT)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660612578 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Input has Shape (1, 3, 416, 416)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660663787 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Allocated Tensor Binding detections Memory 298116 Bytes (74529 * DataType.FLOAT)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660716047 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : Output has Shape (1, 74529, 1, 1)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660784456 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : TensorRT loaded. Input shape is ((416, 416), <class 'numpy.float32'>)
frigate-tensor-frigate-1 | 2023-04-15 11:18:14.660804616 [2023-04-15 11:18:14] frigate.detectors.plugins.tensorrt DEBUG : TensorRT version is 8
What version of the NVidia Container runtime do you have installed?
$ nvidia-container-runtime-hook --version
NVIDIA Container Runtime Hook version 1.13.0
commit: b7079454b5b8fed1390ce78ca5a3343748f62657
Do you have the libcudart installed on your host?
My nvidia-container-runtime-hook was way out of date(1.3.0). I've updated it to the following version which did not fix the problem. Would have been a nice easy win there.
[creynolds@masterblaster docker-compose]$ nvidia-container-runtime-hook --version
NVIDIA Container Runtime Hook version 1.13.0
commit: b7079454b5b8fed1390ce78ca5a3343748f62657
I do not see a libcudart package available but I do have these installed
[creynolds@masterblaster docker-compose]$ rpm -qa | grep cudart
cuda-cudart-12.1.55-1.fc37.x86_64
cuda-cudart-devel-12.1.55-1.fc37.x86_64
cuda-cudart-static-12.1.55-1.fc37.x86_64
edit: add contents of cuda-cudart package
[creynolds@masterblaster docker-compose]$ rpm -qlv cuda-cudart
lrwxrwxrwx 1 root root 20 Apr 11 07:09 /usr/lib64/libcudart.so.12 -> libcudart.so.12.1.55
-rwxr-xr-x 1 root root 679264 Apr 11 07:09 /usr/lib64/libcudart.so.12.1.55
drwxr-xr-x 2 root root 0 Apr 11 07:09 /usr/share/licenses/cuda-cudart
-rw-r--r-- 1 root root 61498 Jan 24 23:09 /usr/share/licenses/cuda-cudart/LICENSE
Not sure if it matters, but maybe try changing the "capabilities" in your docker-compose.yml? Here is what I use.
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [video,compute,utility]
Also, can you try to run with the debug logging enabled? Maybe we're going down the wrong path.
Add this to your config.yml
logger:
logs:
frigate.detectors.plugins.tensorrt: debug
Ok, i've updated my compose file to match the suggested deploy section and added the logger line to the config.yml. this is the resulting log.
Thanks for taking time to look at this. I will try directly mapping in the libcudart.12.so from the host machine into the container and see what happens later tonight when I can sit at the computer again. Not sure why frigate would be looking for .12 when it has .11 available.
edit: this is the system working when I change the detector to cpu: https://i.imgur.com/kh2qjvF.jpg
s6-rc: info: service s6rc-fdholder: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service log-prepare: starting
s6-rc: info: service log-prepare successfully started
s6-rc: info: service nginx-log: starting
s6-rc: info: service go2rtc-log: starting
s6-rc: info: service frigate-log: starting
s6-rc: info: service nginx-log successfully started
s6-rc: info: service go2rtc-log successfully started
s6-rc: info: service go2rtc: starting
s6-rc: info: service frigate-log successfully started
s6-rc: info: service go2rtc successfully started
s6-rc: info: service go2rtc-healthcheck: starting
s6-rc: info: service frigate: starting
s6-rc: info: service go2rtc-healthcheck successfully started
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
2023-04-15 15:31:56.037356878 [INFO] Starting NGINX...
2023-04-15 15:31:56.037359844 [INFO] Preparing go2rtc config...
2023-04-15 15:31:56.037429924 [INFO] Starting Frigate...
s6-rc: info: service legacy-services successfully started
2023-04-15 15:31:56.283015169 [INFO] Not injecting WebRTC candidates into go2rtc config as it has been set manually
2023-04-15 15:31:56.325714165 [INFO] Starting go2rtc...
2023-04-15 15:31:56.452139485 15:31:56.452 INF go2rtc version 1.2.0 linux/amd64
2023-04-15 15:31:56.452405553 15:31:56.452 INF [api] listen addr=:1984
2023-04-15 15:31:56.452753543 15:31:56.452 INF [rtsp] listen addr=:8554
2023-04-15 15:31:56.453104726 15:31:56.453 INF [srtp] listen addr=:8443
2023-04-15 15:31:56.453389402 15:31:56.453 INF [webrtc] listen addr=:8555
2023-04-15 15:31:57.415857970 [2023-04-15 15:31:57] frigate.app INFO : Starting Frigate (0.12.0-da3e197)
2023-04-15 15:31:57.452201170 [2023-04-15 15:31:57] frigate.app INFO : Creating directory: /tmp/cache
2023-04-15 15:31:57.455214384 [2023-04-15 15:31:57] peewee_migrate INFO : Starting migrations
2023-04-15 15:31:57.495345149 [2023-04-15 15:31:57] peewee_migrate INFO : There is nothing to migrate
2023-04-15 15:31:57.520735800 [2023-04-15 15:31:57] detector.tensorrt INFO : Starting detection process: 437
2023-04-15 15:31:57.526496251 [2023-04-15 15:31:57] frigate.app INFO : Output process started: 439
2023-04-15 15:31:57.536403212 [2023-04-15 15:31:57] frigate.app INFO : Camera processor started for camera1: 442
2023-04-15 15:31:57.545745059 [2023-04-15 15:31:57] frigate.app INFO : Camera processor started for camera2: 444
2023-04-15 15:31:57.563477730 [2023-04-15 15:31:57] frigate.app INFO : Camera processor started for camera3: 447
2023-04-15 15:31:57.571649549 [2023-04-15 15:31:57] frigate.app INFO : Camera processor started for camera4: 448
2023-04-15 15:31:57.581104295 [2023-04-15 15:31:57] frigate.app INFO : Capture process started for camera1: 449
2023-04-15 15:31:57.594334660 [2023-04-15 15:31:57] frigate.app INFO : Capture process started for camera2: 452
2023-04-15 15:31:57.622412532 [2023-04-15 15:31:57] frigate.app INFO : Capture process started for camera3: 459
2023-04-15 15:31:57.632663988 [2023-04-15 15:31:57] frigate.app INFO : Capture process started for camera4: 464
2023-04-15 15:31:57.757909450 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Num Available Devices: 1
2023-04-15 15:31:57.787278351 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::GridAnchor_TRT version 1
2023-04-15 15:31:57.787984649 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::GridAnchorRect_TRT version 1
2023-04-15 15:31:57.788116230 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::NMS_TRT version 1
2023-04-15 15:31:57.788221827 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Reorg_TRT version 1
2023-04-15 15:31:57.788306192 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Region_TRT version 1
2023-04-15 15:31:57.788389375 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Clip_TRT version 1
2023-04-15 15:31:57.788472115 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::LReLU_TRT version 1
2023-04-15 15:31:57.788589062 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::PriorBox_TRT version 1
2023-04-15 15:31:57.788681228 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Normalize_TRT version 1
2023-04-15 15:31:57.788761026 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::ScatterND version 1
2023-04-15 15:31:57.788839473 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::RPROI_TRT version 1
2023-04-15 15:31:57.788922747 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::BatchedNMS_TRT version 1
2023-04-15 15:31:57.789011227 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::BatchedNMSDynamic_TRT version 1
2023-04-15 15:31:57.789099144 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::BatchTilePlugin_TRT version 1
2023-04-15 15:31:57.789180866 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::FlattenConcat_TRT version 1
2023-04-15 15:31:57.789264893 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::CropAndResize version 1
2023-04-15 15:31:57.789345149 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::CropAndResizeDynamic version 1
2023-04-15 15:31:57.789418270 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::DetectionLayer_TRT version 1
2023-04-15 15:31:57.789500964 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::EfficientNMS_TRT version 1
2023-04-15 15:31:57.789576647 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::EfficientNMS_ONNX_TRT version 1
2023-04-15 15:31:57.789658289 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::EfficientNMS_Explicit_TF_TRT version 1
2023-04-15 15:31:57.789734360 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::EfficientNMS_Implicit_TF_TRT version 1
2023-04-15 15:31:57.789802654 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::ProposalDynamic version 1
2023-04-15 15:31:57.789873588 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Proposal version 1
2023-04-15 15:31:57.789946279 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::ProposalLayer_TRT version 1
2023-04-15 15:31:57.790017899 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::PyramidROIAlign_TRT version 1
2023-04-15 15:31:57.790097294 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::ResizeNearest_TRT version 1
2023-04-15 15:31:57.790170597 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::Split version 1
2023-04-15 15:31:57.790244785 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::SpecialSlice_TRT version 1
2023-04-15 15:31:57.790313610 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::InstanceNormalization_TRT version 1
2023-04-15 15:31:57.790389214 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::InstanceNormalization_TRT version 2
2023-04-15 15:31:57.790459447 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::CoordConvAC version 1
2023-04-15 15:31:57.790547208 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::DecodeBbox3DPlugin version 1
2023-04-15 15:31:57.790618450 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::GenerateDetection_TRT version 1
2023-04-15 15:31:57.790687805 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::MultilevelCropAndResize_TRT version 1
2023-04-15 15:31:57.790757960 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::MultilevelProposeROI_TRT version 1
2023-04-15 15:31:57.790828645 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::NMSDynamic_TRT version 1
2023-04-15 15:31:58.681534419 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::PillarScatterPlugin version 1
2023-04-15 15:31:58.681717411 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::VoxelGeneratorPlugin version 1
2023-04-15 15:31:58.681822006 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt DEBUG : Registered plugin creator - ::MultiscaleDeformableAttnPlugin_TRT version 1
2023-04-15 15:31:58.681926540 [2023-04-15 15:31:57] frigate.detectors.plugins.tensorrt ERROR : ERROR: failed to load libraries. libcudart.so.12: cannot open shared object file: No such file or directory
2023-04-15 15:31:58.730965889 [2023-04-15 15:31:58] frigate.detectors.plugins.tensorrt INFO : [MemUsageChange] Init CUDA: CPU +189, GPU +0, now: CPU 245, GPU 132 (MiB)
2023-04-15 15:32:01.540110391 [2023-04-15 15:32:01] frigate.detectors.plugins.tensorrt INFO : Loaded engine size: 328 MiB
2023-04-15 15:32:01.590784123 [2023-04-15 15:32:01] frigate.detectors.plugins.tensorrt ERROR : 1: [stdArchiveReader.cpp::StdArchiveReader::40] Error Code 1: Serialization (Serialization assertion stdVersionRead == serializationVersion failed.Version tag does not match. Note: Current Version: 213, Serialized Engine Version: 232)
2023-04-15 15:32:01.604333330 [2023-04-15 15:32:01] frigate.detectors.plugins.tensorrt ERROR : 4: [runtime.cpp::deserializeCudaEngine::50] Error Code 4: Internal Error (Engine deserialization failed.)
2023-04-15 15:32:01.635978083 Process detector:tensorrt:
2023-04-15 15:32:01.639431130 Traceback (most recent call last):
2023-04-15 15:32:01.639449519 File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2023-04-15 15:32:01.639451626 self.run()
2023-04-15 15:32:01.639453358 File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2023-04-15 15:32:01.639454882 self._target(*self._args, **self._kwargs)
2023-04-15 15:32:01.639456481 File "/opt/frigate/frigate/object_detection.py", line 98, in run_detector
2023-04-15 15:32:01.639493940 object_detector = LocalObjectDetector(detector_config=detector_config)
2023-04-15 15:32:01.639496396 File "/opt/frigate/frigate/object_detection.py", line 52, in __init__
2023-04-15 15:32:01.639498696 self.detect_api = create_detector(detector_config)
2023-04-15 15:32:01.639500353 File "/opt/frigate/frigate/detectors/__init__.py", line 24, in create_detector
2023-04-15 15:32:01.639501918 return api(detector_config)
2023-04-15 15:32:01.639529584 File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 220, in __init__
2023-04-15 15:32:01.639532554 self.input_shape = self._get_input_shape()
2023-04-15 15:32:01.639534878 File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 92, in _get_input_shape
2023-04-15 15:32:01.639536341 binding = self.engine[0]
2023-04-15 15:32:01.639537811 TypeError: 'NoneType' object is not subscriptable
2023-04-15 15:32:01.639548242 Exception ignored in: <function TensorRtDetector.__del__ at 0x7f516c1c65e0>
2023-04-15 15:32:01.639549843 Traceback (most recent call last):
2023-04-15 15:32:01.639551522 File "/opt/frigate/frigate/detectors/plugins/tensorrt.py", line 238, in __del__
2023-04-15 15:32:01.639721254 if self.outputs is not None:
2023-04-15 15:32:01.639725996 AttributeError: 'TensorRtDetector' object has no attribute 'outputs'
2023-04-15 15:32:06.029796100 [INFO] Starting go2rtc healthcheck service...
2023-04-15 15:32:17.962106657 [2023-04-15 15:32:17] frigate.watchdog INFO : Detection appears to have stopped. Exiting Frigate...
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
s6-rc: info: service go2rtc-healthcheck: stopping
2023-04-15 15:32:17.979411028 [INFO] The go2rtc-healthcheck service exited with code 256 (by signal 15)
s6-rc: info: service go2rtc-healthcheck successfully stopped
2023-04-15 15:32:18.010487087 [INFO] Service NGINX exited with code 0 (by signal 0)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service nginx-log: stopping
s6-rc: info: service frigate: stopping
2023-04-15 15:32:18.013679405 [2023-04-15 15:32:18] frigate.app INFO : Stopping...
s6-rc: info: service nginx-log successfully stopped
2023-04-15 15:32:18.014861764 [2023-04-15 15:32:18] frigate.watchdog INFO : Exiting watchdog...
2023-04-15 15:32:18.020580526 [2023-04-15 15:32:18] frigate.record INFO : Exiting recording cleanup...
2023-04-15 15:32:18.021036923 [2023-04-15 15:32:18] frigate.stats INFO : Exiting stats emitter...
2023-04-15 15:32:18.021040558 [2023-04-15 15:32:18] frigate.record INFO : Exiting recording maintenance...
2023-04-15 15:32:18.021042921 [2023-04-15 15:32:18] frigate.storage INFO : Exiting storage maintainer...
2023-04-15 15:32:18.021045270 [2023-04-15 15:32:18] frigate.events INFO : Exiting event cleanup...
2023-04-15 15:32:18.021213153 [2023-04-15 15:32:18] frigate.object_processing INFO : Exiting object processor...
2023-04-15 15:32:18.521274640 [2023-04-15 15:32:18] frigate.comms.ws INFO : Exiting websocket client...
2023-04-15 15:32:18.985641189 [2023-04-15 15:32:18] frigate.events INFO : Exiting event processor...
2023-04-15 15:32:18.986090731 [2023-04-15 15:32:18] peewee.sqliteq INFO : writer received shutdown request, exiting.
2023-04-15 15:32:18.993085671 [2023-04-15 15:32:18] watchdog.camera3 INFO : Terminating the existing ffmpeg process...
2023-04-15 15:32:18.993453008 [2023-04-15 15:32:18] watchdog.camera1 INFO : Terminating the existing ffmpeg process...
2023-04-15 15:32:18.993798438 [2023-04-15 15:32:18] watchdog.camera4 INFO : Terminating the existing ffmpeg process...
2023-04-15 15:32:18.993958922 [2023-04-15 15:32:18] watchdog.camera3 INFO : Waiting for ffmpeg to exit gracefully...
2023-04-15 15:32:18.994127913 [2023-04-15 15:32:18] watchdog.camera4 INFO : Waiting for ffmpeg to exit gracefully...
2023-04-15 15:32:18.994268860 [2023-04-15 15:32:18] watchdog.camera2 INFO : Terminating the existing ffmpeg process...
2023-04-15 15:32:18.994386100 [2023-04-15 15:32:18] watchdog.camera2 INFO : Waiting for ffmpeg to exit gracefully...
2023-04-15 15:32:18.994528493 [2023-04-15 15:32:18] watchdog.camera1 INFO : Waiting for ffmpeg to exit gracefully...
2023-04-15 15:32:19.010167283 [2023-04-15 15:32:19] watchdog.camera2 INFO : Terminating the existing ffmpeg process...
2023-04-15 15:32:19.010331970 [2023-04-15 15:32:19] watchdog.camera2 INFO : Waiting for ffmpeg to exit gracefully...
2023-04-15 15:32:19.020597265 [2023-04-15 15:32:19] watchdog.camera3 INFO : Terminating the existing ffmpeg process...
2023-04-15 15:32:19.020764297 [2023-04-15 15:32:19] watchdog.camera3 INFO : Waiting for ffmpeg to exit gracefully...
2023-04-15 15:32:19.023953382 [2023-04-15 15:32:19] watchdog.camera4 INFO : Terminating the existing ffmpeg process...
2023-04-15 15:32:19.024041925 [2023-04-15 15:32:19] watchdog.camera4 INFO : Waiting for ffmpeg to exit gracefully...
2023-04-15 15:32:19.039158232 [2023-04-15 15:32:19] watchdog.camera1 INFO : Terminating the existing ffmpeg process...
2023-04-15 15:32:19.039246568 [2023-04-15 15:32:19] watchdog.camera1 INFO : Waiting for ffmpeg to exit gracefully...
2023-04-15 15:32:19.175721971 [2023-04-15 15:32:19] frigate.output INFO : exiting output process...
2023-04-15 15:32:23.242191248 /usr/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 23 leaked shared_memory objects to clean up at shutdown
2023-04-15 15:32:23.242197533 warnings.warn('resource_tracker: There appear to be %d '
2023-04-15 15:32:23.245059898 [INFO] Service Frigate exited with code 0 (by signal 0)
s6-rc: info: service frigate successfully stopped
s6-rc: info: service go2rtc: stopping
s6-rc: info: service frigate-log: stopping
2023-04-15 15:32:23.247983790 exit OK
s6-rc: info: service frigate-log successfully stopped
2023-04-15 15:32:23.254215098 [INFO] The go2rtc service exited with code 0 (by signal 0)
s6-rc: info: service go2rtc successfully stopped
s6-rc: info: service go2rtc-log: stopping
s6-rc: info: service go2rtc-log successfully stopped
s6-rc: info: service log-prepare: stopping
s6-rc: info: service s6rc-fdholder: stopping
s6-rc: info: service log-prepare successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service s6rc-fdholder successfully stopped
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
If I remember correctly, this looks like it could be complaining about the version of tensorrt libraries used to generate the model?
2023-04-15 15:32:01.590784123 [2023-04-15 15:32:01] frigate.detectors.plugins.tensorrt ERROR : 1: [stdArchiveReader.cpp::StdArchiveReader::40] Error Code 1: Serialization (Serialization assertion stdVersionRead == serializationVersion failed.Version tag does not match. Note: Current Version: 213, Serialized Engine Version: 232)
What version of the tensorrt container did you use to generate the models? From the docs:
docker run --gpus=all --rm -it -v `pwd`/trt-models:/tensorrt_models -v `pwd`/tensorrt_models.sh:/tensorrt_models.sh nvcr.io/nvidia/tensorrt:22.07-py3 /tensorrt_models.sh
This specifically uses the 22.07-py3
version to produce trt models compatible with frigate's included libraries.
Wasn't sure if I pasted the command from the docs or not so I regen-d the trt-models with the line and now it works.
Sorry for the goat rope!
I'm facing the same issue and I need some help.
ERROR: failed to load libraries. libcudart.so.12: cannot open shared object file: No such file or directory
frigate.detectors.plugins.tensorrt ERROR : 1: [stdArchiveReader.cpp::StdArchiveReader::30] Error Code 1: Serialization (Serialization assertion magicTagRead == kMAGIC_TAG failed.Magic tag does not match)
2023-05-31 21:21:44.021000447 [2023-05-31 21:21:44] frigate.detectors.plugins.tensorrt ERROR : 4: [runtime.cpp::deserializeCudaEngine::50] Error Code 4: Internal Error (Engine deserialization failed.)
I'm on Unraid and nvidia-smi shows Cuda version 12.1. I'm not sure what to do. Do I need to manually install the cuda toolkit?
I compiled the trt models using a version higher than 22.07-py3. 22.07-py3 didn't work for me. It says Nvidia gpu is detected but not supported.
I narrowed down the issue.
WARNING: Detected NVIDIA NVIDIA Graphics Device GPU, which is not yet supported in this version of the container
ERROR: No supported GPU(s) detected to run this container
Tensorrt 22.07-py3 doesn't support rtx 4060ti. I tried 22.08-py3 and no luck. I could compile the trt models using 22.09-py3 but frigate threw out a lot of errors related to magic tag does not match. Perhaps the entire rtx 4000 series won't work in frigate's current tensorrt build? Any chance for the frigate team to consider supporting a higher version of tensorrt that works with rtx 4000 series?
Describe the problem you are having
My host machine has cuda12 installed and the container has 11.7 listed in requirements-tensorrt.txt
Pretty sure cuda is backwards compatible so a bump shouldn't break anything.
Produces the log below:
this is the file present inside the container:
my system info
docker-compose file or Docker CLI command
Relevant log output
FFprobe output from your camera
Operating system
Other Linux
Install method
Docker Compose
Network connection
Wired
Camera make and model
Amcrest https://www.amazon.com/dp/B07RHQGS8V/
Any other information that may be helpful
No response