HandBrake running in Docker Container

Happy to read you got it working! Let’s try to see if we can get closer to what you wantL

By default, docker uses pretty much all the resources from the host than it can. See the excerpt from the docker’s documentation below:

By default, a container has no resource constraints and can use as much of a given resource as the host’s kernel scheduler will allow.

Your handbrake container should thus use all it can for video encoding/decoding. Have you kept an eye on the CPU usage while you were converting videos? A simple top / htop should be enough for you to see a big increase in CPU usage, but if you want more information, you can have a look at the Netdata rock-on: it gives you a lot of information about your system usage (borderline too much, but can prove quite useful at times).

That one is a little more complicated, but luckily you’ll find good pointers to at least get you moving forward. The difficulty resides in the fact that in order to use your GPU, the docker container needs to be ran with a different runtime than the default–it is this process that could prove relatively involved. Have a look at the NVIDIA runtime brief introduction below:

The NVIDIA Container Toolkit allows users to build and run GPU accelerated Docker containers. The toolkit includes a container runtime library and utilities to automatically configure containers to leverage NVIDIA GPUs. Full documentation and frequently asked questions are available on the repository wiki.

To install it, I would refer you to the link I posted above (re-pasted below) in which I detailed my notes on part of the process (as I do not have an NVIDIA GPU I couldn’t test the procedure all the way):

These were tested after @criddle was looking for taking advantage of an NVIDIA GPU for similar tasks so maybe he might have some further feedback on the process.

As a reminder, this would be working only if you replace the jlesage/handbrake image by the one linked by @Hooverdan above: djaydev/handbrake .

Hope this helps get you moving forward…

1 Like