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]: NVIDIA not showing ffmpeg activity

See original GitHub issue

Describe the problem you are having

Following the NVIDIA installation instructions here (https://docs.frigate.video/configuration/nvdec) then running nvidia-smi, I assumed I’d see the ffmpeg activity being pushed to my GPU. But its still blank:

user8@system8:~/Documents/frigate$ nvidia-smi
Tue Jul  5 11:24:43 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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 ...  On   | 00000000:01:00.0 N/A |                  N/A |
| N/A   44C    P8    N/A /  N/A |      4MiB /  4037MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Is there a different docker-compose command that needs to be passed to get the NVIDIA GPU working?

I see this guy is using a sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi command. But I’m using docker-compose, and I don’t know if there is there a specific docker-compose command to use.

Version

0.10.1-83481af

Frigate config file

mqtt:
  host: mqtt
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  stats_interval: 60
logger:
  default: info
record:
  enabled: True
snapshots:
  enabled: False
rtmp:
  enabled: True
cameras:
  testcam:
    ffmpeg:
      inputs:
        - path: rtsp://192.168.0.23:554/s1
          input_args:
            - -c:v
            - h264
          roles: 
            - rtmp
    mqtt:
      enabled: True
      timestamp: True
      bounding_box: True
      height: 720
      quality: 70

Relevant log output

user8@system8:~/Documents/frigate$ docker-compose up -d
[+] Running 3/3
 ⠿ Network frigate_default  Created                                                                                                    0.0s
 ⠿ Container mqtt           Started                                                                                                    0.6s
 ⠿ Container frigate        Started                                                                                                    0.7s
user8@system8:~/Documents/frigate$ docker logs frigate
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-07-05 11:24:34] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
Starting migrations
[2022-07-05 11:24:34] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-07-05 11:24:34] peewee_migrate                 INFO    : There is nothing to migrate
[2022-07-05 11:24:35] detector.cpu                   INFO    : Starting detection process: 223
[2022-07-05 11:24:35] frigate.app                    INFO    : Output process started: 225
[2022-07-05 11:24:35] ws4py                          INFO    : Using epoll
[2022-07-05 11:24:35] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-07-05 11:24:35] frigate.app                    INFO    : Camera processor started for testcam: 229
[2022-07-05 11:24:35] frigate.app                    INFO    : Capture process started for testcam: 231
[2022-07-05 11:24:35] ws4py                          INFO    : Using epoll
user8@system8:~/Documents/frigate$ nvidia-smi
Tue Jul  5 11:24:43 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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 ...  On   | 00000000:01:00.0 N/A |                  N/A |
| N/A   44C    P8    N/A /  N/A |      4MiB /  4037MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

FFprobe output from your camera

user8@system8:~/Documents/frigate$ ffprobe rtsp://192.168.0.23:554/s1
ffprobe version 4.3.4-0+deb11u1 Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1 --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-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rtsp, from 'rtsp://192.168.0.23:554/s1':
  Metadata:
    title           : s1
  Duration: N/A, start: 0.192000, bitrate: N/A
    Stream #0:0: Audio: aac (LC), 48000 Hz, mono, fltp
    Stream #0:1: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 15 fps, 15 tbr, 90k tbn, 30 tbc

Frigate stats

{"detection_fps":3.7,"detectors":{"cpu":{"detection_start":1657046087.192042,"inference_speed":57.55,"pid":223}},"service":{"storage":{"/dev/shm":{"free":265.1,"mount_type":"tmpfs","total":268.4,"used":3.4},"/media/frigate/clips":{"free":94022.8,"mount_type":"ext4","total":115484.1,"used":15547.8},"/media/frigate/recordings":{"free":94022.8,"mount_type":"ext4","total":115484.1,"used":15547.8},"/tmp/cache":{"free":999.1,"mount_type":"tmpfs","total":1000.0,"used":0.9}},"temperatures":{},"uptime":612,"version":"0.10.1-83481af"},"testcam":{"camera_fps":5.1,"capture_pid":231,"detection_fps":3.7,"pid":229,"process_fps":5.0,"skipped_fps":0.0}}

Operating system

Debian

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

UniFi UVC G3 FLEX

Any other information that may be helpful

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
NickM-27commented, Jul 6, 2022

Your config is incorrect, hwaccel needs to be within ffmpeg not at the same level

0reactions
SeaDudecommented, Jul 6, 2022

Thanks @NickM-27. Was working way too late! I think I’ll give the NVIDIA thing a rest. I can’t seem to get any ffmpeg process offloaded to the GPU. All good. Frigate is now working with my single cam. Thats good enough for me, for now 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

FFMPEG WITH NVIDIA ACCELERATION ON UBUNTU LINUX
1. Get FFmpeg. ~/Development/ $ git clone git://source.ffmpeg.org/ffmpeg.git 2. Download the NVIDIA acceleration.
Read more >
Unable to compile ffmpeg to support NVIDIA hardware ...
Try to install the CUDA UTILITY: $ wget http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/cudautils.zip $ unzip ...
Read more >
linux - Using FFMPEG with Nvidia GPU - Super User
In your case, you'll need to build FFmpeg from source. Use the example shown below. For the supported and available hardware accelerated ...
Read more >
FFmpeg In Ubuntu 20.04 with Nvidia Gpu Acceleration
Start by finding whether the graphics-card is working properly in your system by typing the following command nvidia-smi .
Read more >
FFmpeg Can't Capture Window Rendered with Secondary GPU
And looking through the NVidia encode/decode support matrix (which isn't always accurate), it does appear that your 930MX is not up to the...
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