Skip to main content

Hardware

A container doesn't get hardware access on the host.

Different /dev mount point

The /dev mount point inside the container namespace isn't same as the one on the host. Containers have no access to hardware devices on the host by default.

Enable hardware inside containers

The following configurations are necessary to enable a specific hardware.

  1. cgroup - Read details here resource control group.
  2. seccomp - read details here seccomp.

How GPU is made available inside a container?

  1. Docker - NVIDIA provides its own runtime. This extends the default runc runtime with the following additional steps.
    1. mounting GPU devices and driver
    2. adding capabilities.
  2. Kubernetes - it uses Container Device Interface (CDI) to mount GPUs.