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 14 forks source link

[ENHANCEMENT] - Add unmanic app detection #24

Closed JaseNZC closed 3 years ago

JaseNZC commented 3 years ago

Possibly look at unmanic as a detected app when running. https://hub.docker.com/r/josh5/unmanic/tags?page=1&ordering=last_updated

When looking at the process though it only seems to be identifying ffmpeg.

Screen Shot 2021-03-22 at 4 44 54 PM

Was just an idea to look into. :-)

b3rs3rk commented 3 years ago

Unless we could lobby that the maintainer of that docker container change the ffmpeg binary/command path execution I won't be able to add the detection. I just added tdarr and that calls both ffmpeg and HandbrakeCLI with no other identifiers. So unmanic will likely show tdarr app usage when it is actively using the GPU as of right now.

b3rs3rk commented 3 years ago

@JaseNZC Try this when Unmanic is transcoding:

echo $(ps -fp <insert_pid_from_nvidia-smi> -o command)

So from your picture it would be:

echo $(ps -fp 28089 -o command)

You have to be quick in some cases. The Plex Transcoder likes to spawn new processes each time the transcoder is throttled. I doubt this will be a problem with Unmanic but you never know.

What I'm hoping is that there is unmanic specific stuff in the larger ffmpeg argument(s) that I can use. Just paste me the result if you can. Thanks.

JaseNZC commented 3 years ago

Hope this helps. I had 3 files converting at the same time with unmanic running at the same time, all have different pid's but are the same as below. root@box:~# echo $(ps -fp 29788 -o command) COMMAND ffmpeg -hwaccel cuda -hwaccel_device 0 -i /input/5c8d7900b7573ed9dd9573fc/test.mpg -hide_banner -loglevel info -strict -2 -max_muxing_queue_size 512 -map 0:0 -map 0:1 -c:v:0 hevc_nvenc -c:a:0 aac -y /tmp/unmanic/unmanic_file_conversion-1616754474.6918821/test.mp4

b3rs3rk commented 3 years ago

@JaseNZC does unmanic always use /tmp/unmanic or is this user configurable?

EDIT: It might be irrelevant as long as unmanic always uses the unmanic_file_conversion prefix for its temporary files. I can probably use that to determine that unmanic is using the GPU as long as they don't change it often.

JaseNZC commented 3 years ago

Its not configurable that I can see anywhere.

b3rs3rk commented 3 years ago

Cool. I think I have it worked out then. I'll try to spawn an unmanic container and test it then I'll add a new release. You don't by chance also have tdarr running and could do the same thing for that? Meaning get me the extended command line output from it.

JaseNZC commented 3 years ago

Yeah sorry the whole idea of Unmanic was to go away from tdarr I find it much better for my needs :-)

b3rs3rk commented 3 years ago

I'm messing with Unmanic now. Seems pretty simple and straightforward to use.

JaseNZC commented 3 years ago

Yeah set a directory(s) to watch and just let it run that is why I like it.

b3rs3rk commented 3 years ago

image

JaseNZC commented 3 years ago

See easy as :-)