gpustat-unraid icon indicating copy to clipboard operation
gpustat-unraid copied to clipboard

[ENHANCEMENT] - Frigate Icon

Open shadow7412 opened this issue 2 years ago • 17 comments

Can we add https://frigate.video to the list of detected applications? It's the only one I have running 24/7.

shadow7412 avatar Jul 27 '22 13:07 shadow7412

@shadow7412 Can you get me the result of nvidia-smi while Frigate is actively using your GPU? I need to see what process it runs to trigger the app detection.

b3rs3rk avatar Nov 08 '22 12:11 b3rs3rk

Tue Nov  8 23:28:17 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.76       Driver Version: 515.76       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| 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 ...  Off  | 00000000:41:00.0 Off |                  N/A |
| 20%   67C    P2    51W / 180W |    592MiB /  8192MiB |      5%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A     44160      C   ffmpeg                            323MiB |
|    0   N/A  N/A    125423      C   ffmpeg                            267MiB |
+-----------------------------------------------------------------------------+

Hmm. You might not have a great deal to work with here...

shadow7412 avatar Nov 08 '22 12:11 shadow7412

(both of those are frigate, by the way)

shadow7412 avatar Nov 08 '22 12:11 shadow7412

You're right about that. I have a second method of detection though but is an extra step. Again, while Frigate is using your GPU, take the PID from nvidia-smi for each process and execute the following for each process and paste it to me:

cat /proc/<pid>/cmdline

b3rs3rk avatar Nov 08 '22 13:11 b3rs3rk

ffmpeg-hide_banner-loglevelwarning-c:vh264_cuvid-avoid_negative_tsmake_zero-fflags+genpts+discardcorrupt-rtsp_transporttcp-stimeout5000000-use_wallclock_as_timestamps1-irtsp://[URL_REDACTED]-fsegment-segment_time10-segment_formatmp4-reset_timestamps1-strftime1-c:vcopy-c:aaac/tmp/cache/front-%Y%m%d%H%M%S.mp4-ccopy-fflvrtmp://127.0.0.1/live/front-r5-s1280x720-frawvideo-pix_fmtyuv420ppipe

Poking around in there for anything useful, I did come across /proc/44160/cwd which contains a folder called frigate... but that's the best I could see. Perhaps you know of something in there that might be more useful (like, getting the parent pid?)

shadow7412 avatar Nov 09 '22 00:11 shadow7412

Ok.

So, the following steps seem to work.

  1. nvidia-smi (to get the pid)
  2. cat /proc/53892/task/53892/status | grep PPid (where 53892 is the pid found in the previous step. Note it's present twice in this command)
  3. cat /proc/91204/cmdline to get the command line of the parent process, which is python3-u-mfrigate.

shadow7412 avatar Nov 10 '22 11:11 shadow7412

@shadow7412 Does the plugin detect Frigate now?

b3rs3rk avatar Nov 29 '22 12:11 b3rs3rk

Looks like there's been a regression :( image

Are there any logs I could attach to help you diagnose what's wrong? (There's no related javascript errors coming up in the console)

shadow7412 avatar Nov 29 '22 12:11 shadow7412

@shadow7412 Can you update your plugin and test again? Thanks.

b3rs3rk avatar Nov 29 '22 15:11 b3rs3rk

I just updated - the plugin is no longer broken, but I'm not seeing frigate in the active apps.

shadow7412 avatar Nov 29 '22 22:11 shadow7412

Here is a screenshot of me going through the process I outlined in the ticket above, in case that helps you in any way. image

shadow7412 avatar Nov 29 '22 22:11 shadow7412

Hmm, I'll have to look at my code again, but my initial impression is that it should be working with the parent process detection I added.

b3rs3rk avatar Nov 29 '22 22:11 b3rs3rk

I had a poke around - and have raised a PR with a change I think will do the trick.

shadow7412 avatar Nov 30 '22 09:11 shadow7412

Let me know when I can test the release.

shadow7412 avatar Dec 01 '22 01:12 shadow7412

@shadow7412 You should be able to update and try now

b3rs3rk avatar Dec 01 '22 12:12 b3rs3rk

Hmm. Still no dice...

shadow7412 avatar Dec 01 '22 21:12 shadow7412

For what it's worth, upgrading unraid to 6.11.5 didn't seem to make an impact.

shadow7412 avatar Dec 06 '22 10:12 shadow7412