Tag Archives: Trouble & Bug

[Solved] Docker error: “unknown runtime specified NVIDIA” using GPU“

Question 1 recurrence

System: Ubuntu 18.04 docker version: 20.10.7
when I start a container, run the following command:

docker run -itd \
   --runtime=nvidia --gpus=all \
   -e NVIDIA_DRIVER_CAPABILITIES=compute,utility,video,graphics \
   image_name
   

report errors:

docker: Error response from daemon: Unknown runtime specified nvidia.
See 'docker run --help'.

Solution 1

This is because the user did not join the docker group and added his own user to the docker user group.

sudo usermod -a -G docker $USER

Question 2 recurrence

docker: Error response from daemon: Unknown runtime specified nvidia.
See 'docker run --help'.

Solution 2

NVIDIA docker2 needs to be installed

sudo apt-get install -y nvidia-docker2

Restart docker

sudo systemctl daemon-reload
sudo systemctl restart docker