nicholas@server:~/project$ sudo docker start myproject [sudo] password for nicholas: Error response from daemon: could not select device driver "" with capabilities: [[gpu]] Error: failed to start containers: myproject
nicholas@server:~/project$ sudo docker start myproject [sudo] password for nicholas: Error response from daemon: could not select device driver "" with capabilities: [[gpu]] Error: failed to start containers: myproject
# Docker GPU Error: Missing NVIDIA Container Runtime The error you're seeing indicates that Docker can't find a suitable GPU driver to run your container, which was configured to use GPU capabilities. ## Problem Explanation Your Docker container `myproject` is requesting GPU access, but the necessary NVIDIA Container Runtime isn't properly set up on your system. ## Solution You need to install the NVIDIA Container Toolkit (formerly nvidia-docker2) and configure Docker to work with it: 1. **Install NVIDIA drivers** (if not already installed):
1 2 3 | sudo apt update sudo apt install nvidia-driver-XXX # Replace XXX with appropriate version |
1 2 3 4 5 6 | distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update sudo apt-get install -y nvidia-container-toolkit |
1 2 | sudo systemctl restart docker |
1 2 | sudo docker start myproject |
1 | sudo docker update --device-remove=all myproject |
Testing if the previous output contains the string nvidia-docker2
: True
Testing if the previous output contains the string nvidia-container-toolkit
: True
nicholas@server:~/project$ sudo docker start myproject [sudo] password for nicholas: Error response from daemon: could not select device driver "" with capabilities: [[gpu]] Error: failed to start containers: myproject
nicholas@server:~/project$ sudo docker start myproject [sudo] password for nicholas: Error response from daemon: could not select device driver "" with capabilities: [[gpu]] Error: failed to start containers: myproject
# Docker GPU Driver Error It appears Docker can't find the necessary GPU driver to start your container. Your container `myproject` is configured to use GPU capabilities, but the appropriate driver isn't available or properly configured. ## Solution Steps 1. **Install NVIDIA Container Toolkit** (if using NVIDIA GPUs):
1 2 3 4 5 6 7 8 9 | # Install repository and GPG key curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add - distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list # Update and install sudo apt-get update sudo apt-get install -y nvidia-container-toolkit |
1 2 | sudo nvidia-ctk runtime configure --runtime=docker |
1 2 | sudo systemctl restart docker |
1 2 | sudo docker run --rm --gpus all nvidia/cuda:11.0.3-base-ubuntu20.04 nvidia-smi |
Testing if the previous output contains the string nvidia-docker2
: False
Testing if the previous output contains the string nvidia-container-toolkit
: True