All Products
Search
Document Center

Elastic GPU Service:Error: "docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]"

Last Updated:Jun 21, 2026

After installing Docker on a GPU Cloud Server, you might encounter the docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]] error when you start a container from an image by running the docker run --gpus all [image-name] command. This error occurs because the NVIDIA Container Toolkit is not installed.

Symptoms

On a GPU Cloud Server with Docker installed, when you run the docker run --gpus all [image-name] command to start a Docker container, the following error message appears:

ecs-user@xxx:~$ sudo docker run --gpus all ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/base:alinux3.2104
Unable to find image 'ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/base:alinux3.2104' locally
a1xxx04: Pulling from ac2/base
49xxx e3: Pull complete
30xxx 7c: Pull complete
17xxx ee: Pull complete
75xxx 8a: Pull complete
9fxxx 55: Pull complete
edxxx 55: Pull complete
Digest: sha256:5065d5946b1e30xxx7xxx4fxxx8xxxdxxx74acxxx6d0180f97
Status: Downloaded newer image for ac2-registry.cn-hangzhou.cr.aliyuncs.com/ac2/base:alinux3.2104
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]

Cause

The NVIDIA Container Toolkit allows Docker to access GPU resources. Without this toolkit, Docker cannot select a GPU device, which triggers the error.

Solution

  1. Run the following command to verify that the NVIDIA GPU driver is installed on the GPU instance.

    Note

    GPU instances do not come with pre-installed drivers. You must install a driver manually, as Docker cannot access the GPU device without one.

    nvidia-smi

    If the output displays the driver version, as shown in the following example, the NVIDIA GPU driver is installed. If not, see Install a Tesla driver or Install a GRID driver to install the required driver.

    NVIDIA-SMI 550.127.08        Driver Version: 550.127.08      CUDA Version: 12.4
    GPU  Name        Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC
    Fan  Temp  Perf  Pwr:Usage/Cap |      Memory-Usage | GPU-Util  Compute M.
                                   |                      |               MIG M.
      0  NVIDIA A10          On    | 00000000:00:07.0 Off |                    0
     0%   27C    P8    10W / 150W  |      1MiB / 23028MiB |      0%    Default |
                                   |                      |               N/A |
    Processes:
      GPU   GI   CI        PID   Type   Process name                  GPU Memory
            ID   ID                                                   Usage
      No running processes found
  2. Run the following command to verify that Docker is installed on the GPU instance.

    sudo docker -v

    If the output displays the Docker version, as shown in the following example, Docker is installed. If not, see Install and use Docker and Docker Compose to install Docker.

    [ecs-xxx ~]$ sudo docker -v
    Docker version 26.1.3, build b72abbb
  3. Run the following commands to install the NVIDIA Container Toolkit.

    The following commands are examples for CentOS, Alibaba Cloud Linux, and Ubuntu. For installation commands on other operating systems, see Installing the NVIDIA Container Toolkit.

    • For Alibaba Cloud Linux 3 and CentOS 8

      # Configure the repository.
      curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | \
        sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
      # Install the toolkit.
      sudo yum install -y nvidia-container-toolkit
      # Restart the Docker service.
      sudo systemctl restart docker

      Alternative method

      sudo dnf config-manager --add-repo=https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo
      sudo yum install -y nvidia-container-toolkit
    • For Ubuntu

      # Configure the repository.
      curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
        && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
          sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
          sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
      sudo apt-get update
      # Install the toolkit.
      sudo apt-get install -y nvidia-container-toolkit
      # Restart the Docker service.
      sudo systemctl restart docker

      Alternative method

      distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
      wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/3bf863cc.pub
      sudo apt-key add 3bf863cc.pub
      echo "deb https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
      sudo apt-get update
      sudo apt-get install -y nvidia-container-toolkit
  4. To verify the installation, run the command for your operating system:

    • For CentOS and Alibaba Cloud Linux

      sudo rpm -qa | grep nvidia-container-toolkit
    • For Ubuntu

      sudo dpkg -l | grep nvidia-container-toolkit

    If the output displays the NVIDIA Container Toolkit version, as shown in the following example, the toolkit is installed.

    ecs-uxxxx@xxxxxxxxxxxxxxxxxxxxx:~$ sudo dpkg -l | grep nvidia-container-toolkit
    ii  nvidia-container-toolkit            1.17.5-1                              amd64        NVIDIA Container toolkit
    ii  nvidia-container-toolkit-base       1.17.5-1                              amd64        NVIDIA Container Toolkit Base
  5. Run docker run --gpus all [image-name] again to verify that the issue is resolved.