Is there any way to limit GPU resource to multiple container?

  containers, docker, gpu, linux

For example, if I ran two docker containers at the same time, root and container-1. Is there any way that I can give access to the root container to take as much GPU resource as it needs then any leftover GPU resource is passed on to the container-1. In a way, I am trying to put these two containers in a hierarchical manner.

Source: Docker Questions