Hardware transcoding inside Docker using Nvidia GPU

Transcoding with Nvidia GPUs within a Docker container requires extra setup, to allow the container to be able to access and use your GPU.

Requirements

  • Use the fancybits/channels-dvr:nvidia docker container

    This container includes necessary Nvidia GPU drivers, and also includes Chrome for TV Everywhere support

  • Install the nvidia-container-runtime

    This adds special hooks into docker to pass through GPU access into your containers
    For example, using: sudo apt install nvidia-container-runtime

  • Pass additional arguments to your docker run command:

    --runtime=nvidia \
    -e NVIDIA_VISIBLE_DEVICES=all \
    -e NVIDIA_DRIVER_CAPABILITIES=compute,utility,video

Troubleshooting

  • Run nvidia-smi on your host to ensure the GPU is accessible
  • Run nvidia-smi inside your container
  • Run the troubleshooting test
1 Like