b3rs3rk / gpustat-unraid

An UnRAID plugin for displaying GPU status
https://forums.unraid.net/topic/89453-plugin-gpu-statistics/?tab=comments#comment-830112
MIT License
50 stars 12 forks source link

[ENHANCEMENT] - fileflows icon #41

Open binarygeek119 opened 2 years ago

binarygeek119 commented 2 years ago

fileflows is like unmanic or tdarr the dev is very active and im sure will work with you to add support https://fileflows.com/

b3rs3rk commented 1 year ago

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

binarygeek119 commented 1 year ago
Tue Nov  8 12:01:32 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 ...  On   | 00000000:43:00.0 Off |                  N/A |
|  0%   49C    P2    26W / 140W |    643MiB /  6144MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A     23351      C   /usr/local/bin/ffmpeg             382MiB |
|    0   N/A  N/A     23367      C   /usr/local/bin/ffmpeg             258MiB |
+-----------------------------------------------------------------------------+
b3rs3rk commented 1 year ago

Yeah, I was afraid of that. So many applications just invoke ffmpeg and not an app specific wrapper to ffmpeg or at least a good directory I can key the detection from. I'm going to need more info.

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

binarygeek119 commented 1 year ago

/usr/local/bin/ffmpeg-fflags+genpts-probesize5M-hwaccelcuda-i/media/media/Movies/Van Wilder Freshman Year (2009)/Van Wilder Freshman Year (2009).mkv-y-map0:v:0-c:v:0hevc_nvenc-rcconstqp-qp20-presetp6-spatial-aq1-map0:a:0-c:a:0aac-ac:a:06-map0:s:0-c:s:0copy-metadata:s:s:0language=eng-map0:s:1-c:s:1copy-metadata:s:s:1title=SDH-metadata:s:s:1language=eng-strict-2/temp/Runner-297c7b3c-4a4a-4979-867c-91ada137e988/a1091c43-b5d2-4f89-8c7b-268848fadc41.mkv

binarygeek119 commented 1 year ago

fyi the dev might work with you to fix the ffmpeg path issue. its very active

binarygeek119 commented 1 year ago

fileflows is not showing up /usr/local/bin/ffmpeg-fflags+genpts-probesize5M-hwaccelcuda-i/media/media/Movies/The Rookie (2002)/The Rookie (2002).mkv-y-map0:v:0-c:v:0hevc_nvenc-rcconstqp-qp20-presetp6-spatial-aq1-map0:a:0-c:a:0aac-ac:a:06-map0:s:0-c:s:0copy-metadata:s:s:0language=eng-strict-2/temp/Runner-f0d62019-ad2e-43ae-949c-2193370f31bc/0fa83fe0-ad25-4768-8a7a-156f2d8bef4a.m

binarygeek119 commented 1 year ago
Wed Nov 16 10:09:36 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.56.06    Driver Version: 520.56.06    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| 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:43:00.0 Off |                  N/A |
|  0%   51C    P2    26W / 140W |    640MiB /  6144MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      6907      C   /usr/local/bin/ffmpeg             253MiB |
|    0   N/A  N/A     30507      C   /usr/local/bin/ffmpeg             385MiB |
+-----------------------------------------------------------------------------+
binarygeek119 commented 1 year ago

/usr/local/bin/ffmpeg-fflags+genpts-probesize5M-hwaccelcuda-i/media/media/Movies/Once Upon a Time in Hollywood (2019)/Once Upon a Time… in Hollywood (2019).mkv-y-map0:v:0-c:v:0hevc_nvenc-rcconstqp-qp20-presetp6-spatial-aq1-filter:v:0zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p-map0:a:0-c:a:0aac-ac:a:06-strict-2/temp/Runner-71812128-0e48-46f8-88e6-9812d6e14f05/669dd16f-e961-4217-9675-44fce4cb2b60.mkv

b3rs3rk commented 1 year ago

I don't really have a test setup, so I'm kind of eyeballing it here. I haven't released anything, but what I've already done will be required anyways. You probably missed the previous commit where I look at the parent process calling the ffmpeg process to try and identify the app?

EDIT: a82f3de55715f52d894791c67db9712f58a47d0f <--- this commit for parent process checking

b3rs3rk commented 1 year ago

@binarygeek119 Same question, does it work?

binarygeek119 commented 1 year ago

fileflows does not show up but etv does.

b3rs3rk commented 1 year ago

Okay, we need to see what the full command of the parent process is. I'm guessing it doesn't contain 'fileflows' anywhere which would make it impossible to detect. Do you know how to check the parent process?

binarygeek119 commented 1 year ago

no i dont

b3rs3rk commented 1 year ago
Wed Nov 16 10:09:36 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.56.06    Driver Version: 520.56.06    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| 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:43:00.0 Off |                  N/A |
|  0%   51C    P2    26W / 140W |    640MiB /  6144MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      6907      C   /usr/local/bin/ffmpeg             253MiB |
|    0   N/A  N/A     30507      C   /usr/local/bin/ffmpeg             385MiB |
+-----------------------------------------------------------------------------+

So in this case, you would take the PID of the known fileflows-spawned ffmpeg process and find the parent PID:

ps j 6907

The first section of the output will be the Parent PID. All you need to do is the same process as before except use the parent PID instead:

cat /proc/<parent_pid>/cmdline and paste the result. If the string fileflows isn't showing up in the parent PID process somewhere then I'll have to talk to the developer or container maintainer to make it more detectable.

binarygeek119 commented 1 year ago

/dotnet/dotnetFileFlows.FlowRunner.dll--uid162ed1db-9f00-43ed-879f-e5e60ebd152d--libfileb1f23706-020c-4a8a-86ed-cfe134094d3f--tempPath/temp--cfgPath/app/Data/Data/Config/73--cfgKeyd9f018fd-a5f7-4d8c-b0eb-3edac6488974--baseUrlhttp://localhost:5000--docker--server

binarygeek119 commented 1 year ago

it might be case sensitive the dev spells the app FileFlows with capital F's

b3rs3rk commented 1 year ago

@binarygeek119 You're exactly right. I need to change this function that does the match to stripos which is insensitive and then detection should work.

b3rs3rk commented 1 year ago

@binarygeek119 Did the latest update make FileFlows detection work?

binarygeek119 commented 1 year ago

still not showing up