在运行docker gui以后显示:
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
导致这个问题的主要原因是因为nvidia-container-toolkit没有装。可以通过输入以下指令安装。
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 update
#安装nvidia-container-toolkit
sudo apt install nvidia-container-toolkit
#重启
sudo systemctl restart docker
重新进入docker gui,成功!