doitandbedone / ispyagentdvr-docker

GNU General Public License v3.0
113 stars 44 forks source link

Nvidia GPU features not working #79

Open izevar opened 3 years ago

izevar commented 3 years ago

Hello Seem that all GPU related features are not working: GPU decoding GPU encoding Object detection

There is any extra step needed to enable it ?

ispysoftware commented 3 years ago

you might need to get an ffmpeg build with GPU enabled or install a video codec SDK. The GPU stuff is only tested on Windows. Something like: https://hub.docker.com/r/willprice/nvidia-ffmpeg/ Note that RAW recording will always be faster than GPU encode if you are using IP cameras as there is basically no encode step.

doitandbedone commented 3 years ago

@izevar did you try the above steps? Did they work? Could you please give us an update? Thank you!

stripeyhorse commented 3 years ago

im not having any performance issues , but is intel quicksync supported under docker.

btw im using raw and having no issues at all. just trying to make sure it uses as little resources as possible.

ispysoftware commented 3 years ago

we're working on quicksync under docker. Nothing will beat raw for encoding though.

On Tue, Nov 10, 2020 at 5:56 PM stripeyhorse notifications@github.com wrote:

im not having any performance issues , but is intel quicksync supported under docker.

btw im using raw and having no issues at all. just trying to make sure it uses as little resources as possible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-724594735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXIH6EB3FVN73CSOKR3SPEE4ZANCNFSM4TF2GKTA .

ispysoftware commented 3 years ago

@doitandbedone test version here for linux h264 support https://ispyrtcdata.blob.core.windows.net/downloads/Agent_Linux64_H264.zip see server settings and you can set the Codec to H264 on the General tab. Then set the encoder on the recording tab on the camera to use quicksync and if the drivers are installed properly it should use them. See the logs for messages. Specifically on Agent startup if quicksync is going to work there should be a message about it under "Hardware Support"

doitandbedone commented 3 years ago

Perfect. I'll give it a try. Thanks!

On Thu, Nov 12, 2020, 11:38 PM sean tearney notifications@github.com wrote:

@doitandbedone https://github.com/doitandbedone test version here for linux h264 support https://ispyrtcdata.blob.core.windows.net/downloads/Agent_Linux64_H264.zip see server settings and you can set the Codec to H264 on the General tab. Then set the encoder on the recording tab on the camera to use quicksync and if the drivers are installed properly it should use them. See the logs for messages. Specifically on Agent startup if quicksync is going to work there should be a message about it under "Hardware Support"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-726577116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AORTFNBCCXDGVX7KVUQ5SLTSPTO6LANCNFSM4TF2GKTA .

doitandbedone commented 3 years ago

Sorry for the delay, been having issues lately with the sever, spent the last few days to put it back up and not lose any of my data phew. So back to almost normal but still need to do a few other things. If everything goes well I should be able to run a test tomorrow. I really appreciate all the help and effort you're putting into this!

oriol73 commented 3 years ago

Hi there, I'm running a server with Ubuntu 20.04, Docker 19.03.13, with your AgentDVR container. I've been trying to enable GPU decoding/encoding as well to reduce CPU workload. 5x IP cameras (four RSTP streams at 1080p, one at 720p bring my cpu above 60%). I have one Nvidia Geforce GT710 with nvidia-driver-455.38 installed, nvidia-docker2, docker nvidia/cuda 11.1 , nvtop. All up and running.

If I log into the container via shell and retry dotnet /agent/Agent.dll, I get an ffmpeg output like this:

Init FFmpeg ffmpeg path: /usr/lib/x86_64-linux-gnu Error: Unable to load DLL 'avutil.56': The specified module could not be found. Error: at FFmpeg.AutoGen.ffmpeg.LoadLibrary(String libraryName, Boolean throwException) at FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__6_0(String libraryName) at FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__6_604(Int32 level) at FFmpeg.AutoGen.ffmpeg.av_log_set_level(Int32 level) at CoreLogic.FFmpeg.SetFfmpegLogging(Int32 loglevel) at CoreLogic.FFmpeg.Init() at CoreLogic.Threads.StartUp() Unable to load DLL 'avutil.56': The specified module could not be found. Install FFMPEG (v4) using the terminal. See the download page on ispyconnect.com for instructions. Killed

I can run some tests for you on my server if this helps us speed up the resolution.

Best regards, oriol

ispysoftware commented 3 years ago

you need to use a build of ffmpeg that has the libraries instead of the static binaries - agent uses the libraries like avutil.56 not the ffmpeg binary file.

also to decode using the gpu you need to select GPU on the decoder options under the video source settings.. and you'd need to use the build of agent that i uploaded up there ^^ somewhere

doitandbedone commented 3 years ago

Yes, that's where I left off as well. Seems the recommended ffmpeg repo has other libraries included. I was using the logs to try and install all the ones it complained about and use the compilation flags for it too. Still a work in progress though. The build is posted in an earlier comment, you will have to modify the current Dockerfile to make use of the new build however. Once the version is ready I'll make it available more publicly.

ispysoftware commented 3 years ago

Do you have it working? It works fine on Windows so in theory should be OK on Docker. As long as the ffmpeg parts are there

doitandbedone commented 3 years ago

Not yet, ffmpeg is proving to be the most challenging part so far, but then again, haven't been able to get back to it, there's two branches I created if you want to take a look.

ispysoftware commented 3 years ago

I'm not 100% certain you need to rebuild it. If it can save to mp4 using the h264 codec then it should be able to use the gpu if the codecs are available

doitandbedone commented 3 years ago

So I finally had to time to run it, ran into a few issues (dirvers/cuda version) but all resolved, however, it still prefers software. I do see a warning: Warning: h264 compatible version of ffmpeg must be installed to use H264 encoding Do I need another version, or is this just a friendly warning?

And a few errors/warnings:

Parking: Failed to create specified HW device.

[h264 @ 0x14c03403ba40] A hardware frames or device context is required for hardware accelerated decoding.
[h264 @ 0x14c03403ba40] Failed setup for format vaapi_vld: hwaccel initialisation returned error.

Parking: Failed to create specified HW device.

[h264 @ 0x14c03403ba40] A hardware frames or device context is required for hardware accelerated decoding.
[h264 @ 0x14c03403ba40] Failed setup for format vaapi_vld: hwaccel initialisation returned error.

I followed setup as instructed:

Full logs: nvidia-docker-ispy-error.zip

ispysoftware commented 3 years ago

if you set LogFFMPEGLevel in the media/xml/config.xml file to 48 ffmpeg should write a whole load of debug to the logs.

On Mon, Nov 23, 2020 at 1:58 PM doitandbedone notifications@github.com wrote:

So I finally had to time to run it, ran into a few issues (dirvers/cuda version) but all resolved, however, it still prefers software. I do see a warning: �[37m�[40mWarning: h264 compatible version of ffmpeg must be installed to use H264 encoding Do I need another version, or is this just a friendly warning?

And a few errors/warnings:

�[37m�[40mParking: Failed to create specified HW device.

�[32m�[40m[h264 @ 0x14c03403ba40] A hardware frames or device context is required for hardware accelerated decoding.

�[32m�[40m[h264 @ 0x14c03403ba40] Failed setup for format vaapi_vld: hwaccel initialisation returned error.

�[37m�[40mParking: Failed to create specified HW device.

�[32m�[40m[h264 @ 0x14c03403ba40] A hardware frames or device context is required for hardware accelerated decoding.

�[32m�[40m[h264 @ 0x14c03403ba40] Failed setup for format vaapi_vld: hwaccel initialisation returned error.

I followed setup as instructed:

Full logs: nvidia-docker-ispy-error.zip https://github.com/doitandbedone/ispyagentdvr-docker/files/5581268/nvidia-docker-ispy-error.zip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-731944709, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXNGRRIIZXXSOJZQQGLSRH22FANCNFSM4TF2GKTA .

doitandbedone commented 3 years ago

Woah, after enabling more logs it goes haywire, it gets so overwhelming it starts to freeze the server...

Anyhow, had to kill the container and collect logs afterwards. The container also seems to stay fine, so got the logs from it as well. They seem to be truncated given the huge amount of data. Hope it helps: ffmpeg-loglevel-48.zip

ispysoftware commented 3 years ago

It's missing the connection logs where it complains about creating the hardware context. Stop the camera, make sure its all set up to use the gpu, start it and stop it and then save off the logs.

ispysoftware commented 3 years ago

GPU support isn't available on docker on windows, which is my dev environment :( https://www.edureka.co/community/19378/is-gpu-pass-through-possible-with-docker-for-windows

With docker on linux it seems you have to forward the device to the container for it to be able to access it like: https://github.com/jellyfin/jellyfin/issues/2281#issuecomment-695947737 specifically calling docker with: --device /dev/dri:/dev/dri \

also https://stackoverflow.com/questions/25185405/using-gpu-from-a-docker-container

doitandbedone commented 3 years ago

Yes, I'm using the special nvidia cuda container: https://github.com/NVIDIA/nvidia-docker And I am passing the GPU over, I can actually see it in the container when running nvidia-smi:

+-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.59 Driver Version: 440.59 CUDA Version: 10.2 | 0 GeForce GTX 750 Ti +-------------------------------+----------------------+----------------------+

One thing I noticed however, seems the ffmpeg does not have cuda enabled: Hardware acceleration methods: vdpau vaapi drm opencl

I noticed since I tried using the available libx264: #> ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i 11_TimeLapse_2020-12-03_07-04-43.mp4 -c:a copy -c:v libx264 -b:v 5M output.mp4 Device creation failed: -12. [h264 @ 0x5636e258bd80] No device available for decoder: device type cuda needed for codec h264.

Output: Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Device setup failed for decoder on input stream #0:0 : Cannot allocate memory

Perhaps ffmpeg needs to be rebuild to enable cuda acceleration?

ispysoftware commented 3 years ago

i've got it working on my linux test box on ubuntu 18, hardware encode h264 and decode using vaapi, needed quite a lot of code changes. Will have an update soon. Testing on OSX/ VP8 etc.

On Thu, Dec 3, 2020 at 11:31 PM doitandbedone notifications@github.com wrote:

Yes, I'm using the special nvidia cuda container: https://github.com/NVIDIA/nvidia-docker And I am passing the GPU over, I can actually see it in the container when running nvidia-smi. One thing I noticed however, seems the ffmpeg does not have cuda enabled: Hardware acceleration methods: vdpau vaapi drm opencl

I noticed since I tried using the available libx264:

> ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i

11_TimeLapse_2020-12-03_07-04-43.mp4 -c:a copy -c:v libx264 -b:v 5M output.mp4 Device creation failed: -12. [h264 @ 0x5636e258bd80] No device available for decoder: device type cuda needed for codec h264.

Output: Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Device setup failed for decoder on input stream #0:0 : Cannot allocate memory

Perhaps ffmpeg needs to be rebuild to enable cuda acceleration?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-738080907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXMOBPI3KPGRP3QOMJTSS6VNRANCNFSM4TF2GKTA .

ispysoftware commented 3 years ago

here's an updated version - use this and set the recorder mode to GPU and the codec in settings to h264 https://ispyrtcdata.blob.core.windows.net/downloads/Agent_Linux64.zip Should have hardware decode and encode using vaapi. Any probs check the logs.

doitandbedone commented 3 years ago

Wow, you beat me to it.. I'll try it, give me a few mins. I did managed to recompile ffmpeg but with minimal codecs. I tried using Jonathon's PPA as a base for all the libraries it installs. I then tried to get ffmpeg 4.3.1 source and recompile with old + new config flags but ffmpeg configure cannot find the reference to the libraries it had installed even though they are there. Anyhow, let me see...

doitandbedone commented 3 years ago

Did you take any extra steps to get it working? Seems it's not using the GPU, however, I turn everything off and rebooted to see starting logs, I see this:

[37mffmpeg path: /usr/lib/x86_64-linux-gnu Initializing devices Hardware Decoders: vdpau vaapi drm opencl CUDA not available call ffplay -nodisp -f v4l2 -list_formats all /dev/video0 [video4linux2,v4l2 @ 0x14d760000b80] cannot open video device /dev/video0: no such file or directory

I tried a standalone command: ffmpeg -hwaccel vdpau -i /agent/Media/WebServerRoot/Media/video/Mazda\ Parking/13_2020-11-22_21-08-50_542.mp4 /agent/Media/WebServerRoot/Media/output.mp4

Output:

[AVHWDeviceContext @ 0x5594cf789880] Cannot open the X11 display . Device creation failed: -1313558101. [h264 @ 0x5594cf6942c0] No device available for decoder: device type vdpau needed for codec h264. Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Device setup failed for decoder on input stream #0:0 : Unknown error occurred

I'm thinking compatibility issues with the card? Or somehow missing something that is not letting the card be seen? I do get a good output with nvidia-smi thoug,h as shown before.

doitandbedone commented 3 years ago

So I went back to your comment earlier on passing the devices. I guess internally it's looking for /dev/video0 ... /dev/video<n> So then I found this: https://stackoverflow.com/questions/25185405/using-gpu-from-a-docker-container Recommends to use the following to get your device list: ls -la /dev | grep nvidia Then forward it: --device /dev/<host-device>:/dev/<container-device> Mine spits out:

crw-rw-rw- 1 root root 195, 254 Dec 2 12:05 nvidia-modeset crw-rw-rw- 1 root root 244, 0 Dec 2 12:05 nvidia-uvm crw-rw-rw- 1 root root 244, 1 Dec 2 12:05 nvidia-uvm-tools crw-rw-rw- 1 root root 195, 0 Dec 2 11:37 nvidia0 crw-rw-rw- 1 root root 195, 255 Dec 2 11:37 nvidiactl

I then tried --device /dev/nvidia0:/dev/video0 And the logs now don't spit out the error:

call ffplay -nodisp -f v4l2 -list_formats all /dev/video0 [video4linux2,v4l2 @ 0x14fb88000b80] ioctl(vidioc_querycap): invalid argument call ffplay -nodisp -f v4l2 -list_formats all /dev/video1 [video4linux2,v4l2 @ 0x14ce40000b80] cannot open video device /dev/video1: no such file or directory

But as you may have noticed, it then goes onto /dev/video1. Not too sure about that "invalid argument" though. How should devices be forwarded? Not too sure how to correlate them, what do you recommend?

P.S.: Do note that the devices are being forwarded by nvidia onto the container without the need of --device, the print was in fact from inside the container (and it prints the same on the host machine), they are just referenced differently within agent's commands/libs.

ispysoftware commented 3 years ago

i've been concentrating on getting it working on linux, should work on docker as long as the devices are forwarded into the container.

maybe this will help: https://github.com/doitandbedone/ispyagentdvr-docker/issues/100#issuecomment-733405196

doitandbedone commented 3 years ago

Right, I mean at the end of the day docker container is running ubuntu 18.04. The question again is what the devices ffplay is expecting in what order. The nvidia runtime forwards with the naming printed above. But ffplay seems to be using /dev0, /dev1 not too sure what those are supposed to be mapped to. nvidia-uvm, nvidia-actl, nvidia-0, etc

ispysoftware commented 3 years ago

Did you try "I just launched the container with --device /dev/dri:/dev/dri "?

doitandbedone commented 3 years ago

Scratch what I said earlier, that's probably some other error, I found that dev/device-N it's just for any connected device. As for the forwarding, yes, I also tried the manual command: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -i /agent/Media/WebServerRoot/Media/video/Mazda\ Parking/13_2020-11-22_21-08-50_542.mp4 /out.mp4

Output:

[AVHWDeviceContext @ 0x558fe3c59ac0] libva: va_getDriverName() failed with unknown libva error,driver_name=(null) [AVHWDeviceContext @ 0x558fe3c59ac0] Failed to initialise VAAPI connection: -1 (unknown libva error). Device creation failed: -5. [h264 @ 0x558fe3afc300] No device available for decoder: device type vaapi needed for codec h264. Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Device setup failed for decoder on input stream #0:0 : Input/output error

Seems there's some driver issues? Still looking around...

Edit: Just wanted to add what gets forwarded when adding the /dev/dri/:

drwxr-xr-x 2 root root 80 Dec 4 14:20 . drwxr-xr-x 6 root root 480 Dec 4 14:20 .. crwxrwxrwx 1 99 users 226, 0 Dec 4 14:20 card0 crwxrwxrwx 1 99 users 226, 128 Dec 4 14:20 renderD128

ispysoftware commented 3 years ago

The other post mentions:

apt update
apt install mesa-va-drivers
ispysoftware commented 3 years ago

did that resolve it?

doitandbedone commented 3 years ago

Sorry I couldn't get back to you earlier. And yes, I did try it while I got the error before but the drivers are already in place:

: apt install mesa-va-drivers

Reading package lists... Done Building dependency tree
Reading state information... Done mesa-va-drivers is already the newest version (20.0.8-0ubuntu1~18.04.1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So out of luck here...

ispysoftware commented 3 years ago

@rb2k would you be able to help us out here how you got the gpu working under docker?

rb2k commented 3 years ago

The mesa-va-drivers will just help with open source drivers (intel, amd). I don't have any Nvidia cards myself, but I've seen other containers having to do a whole song and dance:

https://github.com/blakeblackshear/frigate/blob/master/docker/Dockerfile.amd64nvidia#L17-L47

doitandbedone commented 3 years ago

Oh yup... I know all about it. But it essentially comes down to installing drivers on your host machine and either using the nvidia runtime for any base image or the cuda base image that comes with the included runtime. From there there's the --runtime nvidia flag and the environment variables to expose the GPU and its capabilities. All done and check working. In fact I have this working on other containers. As a side note, you can only pass the GPU to one container or VM otherwise you get into funky town. But for this case I stopped other constiners VMs before trying. In ispy's case, we are not using CUDA which is what usually the environment is installed. Since we are using VAAPI I'm not too sure but from the website it states that either generic drivers must be installed or the ones from nvidia. Just hit a roadblock...

ispysoftware commented 3 years ago

Vaapi is a wrapper.. It should work with cuda. The message about cuda not available in the logs is from opencv saying it wasn't built with cuda support (because that adds about 300mb to the size of it).

doitandbedone commented 3 years ago

Right, that's why I was looking on the ffmpeg side but needs to be rebuilt to add support for it. Vaapi still uses Cuda under the hood? I thought it was just an alternative and cuda wasn't needed.

ispysoftware commented 3 years ago

I'm not sure about that, I guess so, when I run it on windows it lists CUDA as an option but that is using a different build of ffmpeg. I don't think the build of ffmpeg is the issue though as it's (vaapi) working fine on my linux box for decode and encode (not under docker but with all the same libraries)

Screenshot from 2020-12-07 06-13-31

doitandbedone commented 3 years ago

Just so we're clear and have no differences: Ubuntu 18.04 Nvidia Card (I have 750 TI, drivers 440.59) Special build of Agent previously linked Codec H264 Encoder GPU Decoder GPU ffmpeg Jonathon's PPA (Although we know there's a difference here)

On Sun, Dec 6, 2020, 2:17 PM sean tearney notifications@github.com wrote:

I'm not sure about that, I guess so, when I run it on windows it lists CUDA as an option but that is using a different build of ffmpeg. I don't think the build of ffmpeg is the issue though as it's (vaapi) working fine on my linux box for decode and encode (not under docker but with all the same libraries)

[image: Screenshot from 2020-12-07 06-13-31] https://user-images.githubusercontent.com/800093/101294635-baa8d580-3853-11eb-875b-5fda95f0020c.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-739573791, or unsubscribe https://github.com/notifications/unsubscribe-auth/AORTFND3SHI7TJ2UMWWAGDTSTP7F5ANCNFSM4TF2GKTA .

ispysoftware commented 3 years ago

That's all the same except I haven't got an nvidia card in this box, it's just using the intel graphics drivers on the chip. So Codec H264 in settings then set the decoder to GPU on the General tab when you edit the camera and Encoder to GPU on the Recording tab.

On Mon, Dec 7, 2020 at 7:29 AM doitandbedone notifications@github.com wrote:

Just so we're clear and have no differences: Ubuntu 18.04 Nvidia Card (I have 750 TI, drivers 440.59) Special build of Agent previously linked Codec H264 Encoder GPU Decoder GPU ffmpeg Jonathon's PPA (Although we know there's a difference here)

On Sun, Dec 6, 2020, 2:17 PM sean tearney notifications@github.com wrote:

I'm not sure about that, I guess so, when I run it on windows it lists CUDA as an option but that is using a different build of ffmpeg. I don't think the build of ffmpeg is the issue though as it's (vaapi) working fine on my linux box for decode and encode (not under docker but with all the same libraries)

[image: Screenshot from 2020-12-07 06-13-31] < https://user-images.githubusercontent.com/800093/101294635-baa8d580-3853-11eb-875b-5fda95f0020c.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-739573791 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AORTFND3SHI7TJ2UMWWAGDTSTP7F5ANCNFSM4TF2GKTA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-739584240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDKXI7EKMPFFCRXLJ5F4LSTQHV5ANCNFSM4TF2GKTA .

doitandbedone commented 3 years ago

Oh, I thought you did have an nvidia card. That's vastly different. And yes, everything is as stated. Tough luck :(

On Sun, Dec 6, 2020, 3:43 PM sean tearney notifications@github.com wrote:

That's all the same except I haven't got an nvidia card in this box, it's just using the intel graphics drivers on the chip. So Codec H264 in settings then set the decoder to GPU on the General tab when you edit the camera and Encoder to GPU on the Recording tab.

On Mon, Dec 7, 2020 at 7:29 AM doitandbedone notifications@github.com wrote:

Just so we're clear and have no differences: Ubuntu 18.04 Nvidia Card (I have 750 TI, drivers 440.59) Special build of Agent previously linked Codec H264 Encoder GPU Decoder GPU ffmpeg Jonathon's PPA (Although we know there's a difference here)

On Sun, Dec 6, 2020, 2:17 PM sean tearney notifications@github.com wrote:

I'm not sure about that, I guess so, when I run it on windows it lists CUDA as an option but that is using a different build of ffmpeg. I don't think the build of ffmpeg is the issue though as it's (vaapi) working fine on my linux box for decode and encode (not under docker but with all the same libraries)

[image: Screenshot from 2020-12-07 06-13-31] <

https://user-images.githubusercontent.com/800093/101294635-baa8d580-3853-11eb-875b-5fda95f0020c.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-739573791

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AORTFND3SHI7TJ2UMWWAGDTSTP7F5ANCNFSM4TF2GKTA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-739584240 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAGDKXI7EKMPFFCRXLJ5F4LSTQHV5ANCNFSM4TF2GKTA

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-739586394, or unsubscribe https://github.com/notifications/unsubscribe-auth/AORTFNGSADS4776NJSEBUHLSTQJKZANCNFSM4TF2GKTA .

ispysoftware commented 3 years ago

whats the console output from start to decode/ encode with GPU enabled?

ispysoftware commented 3 years ago

apt install mesa-va-drivers should be added to the docker file though right for it to work with gpu under other devices

doitandbedone commented 3 years ago

When running it, it says it's up to date. I can try a non nvidia runtime and see if it works. It's required for pasthrough though.

On Sun, Dec 6, 2020, 5:01 PM sean tearney notifications@github.com wrote:

apt install mesa-va-drivers should be added to the docker file though right for it to work with gpu under other devices

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-739604641, or unsubscribe https://github.com/notifications/unsubscribe-auth/AORTFNHTSNKKJ5BGZR673DDSTQSNDANCNFSM4TF2GKTA .

oriol73 commented 3 years ago

Hey guys, happy New Year! any update on this? Thanks

doitandbedone commented 3 years ago

@oriol73 Sorry for the late reply and Happy New Year as well! Unfortunately, no advances have been done on this. But will post any developments in this topic as soon as we find them. For the time being, we still recommend using raw for fastest results.

thomasleitner commented 3 years ago

Hi guys, I’m also wondering if there’s any update on this ? Thanks!

ispysoftware commented 3 years ago

@doitandbedone bearing in mind i know next to nothing about docker, there's a deploy command in this example that seems to give deepstack access to the gpu, is this something that could be used to open up the gpu to agent in docker?

https://github.com/doitandbedone/ispyagentdvr-docker/issues/197

doitandbedone commented 3 years ago

Right, the problem is not pass-through/access to the GPU, I was able to achieve that, the problem was ispy/ffmpeg taking use of it. It came down to having ffmpeg being recompiled to use nvidia's codec/decoder but since it has other dependencies it became overwhelming. If you have suggestions on building ffmpeg or another pre built repo with nvidia support then I can revisit this. As for the other one. The access is for deepstack itself. Their image seems to have support for nvidia GPU's.

On Wed, Mar 24, 2021, 8:02 PM sean tearney @.***> wrote:

@doitandbedone https://github.com/doitandbedone bearing in mind i know next to nothing about docker, there's a deploy command in this example that seems to give deepstack access to the gpu, is this something that could be used to open up the gpu to agent in docker?

197 https://github.com/doitandbedone/ispyagentdvr-docker/issues/197

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doitandbedone/ispyagentdvr-docker/issues/79#issuecomment-806327955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AORTFNDEWVYL4EUMALR5YO3TFKRS5ANCNFSM4TF2GKTA .

ispysoftware commented 3 years ago

there is this https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/ just need to get it building in shared library mode instead

oriol73 commented 3 years ago

@doitandbedone there's a docker container with ffmpeg already compiled with nvidia libraries here:

example: docker run --runtime=nvidia jrottenberg/ffmpeg:4.1-nvidia -hwaccel cuvid -c:v h264_cuvid -i INPUT -vf scale_npp=-1:720 -c:v h264_nvenc -preset slow OUTPUT

You can leave this container up and running with: docker run --runtime=nvidia -it --entrypoint='bash' jrottenberg/ffmpeg:4.1-nvidia

and then ffmpeg binaries/libraries could be shared/cloned from ffmpeg container to agentdvr container....then adding the right PATH env, and start using them.

Would this help?