[英]docker: Error response from daemon: failed to create shim
On a fresh ubunto i installed docker and when i run the image, i got following error在新的 ubunto 上,我安装了 docker,当我运行图像时,出现以下错误
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "--gpus": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled
This is how i make system ready这就是我让系统准备就绪的方式
sudo apt updat
sudo apt full-upgrade
sudo apt autoremove
#install gpu drivers via software and updates #通过软件和更新安装GPU驱动程序
sudo apt install nvidia-cuda-toolkit
sudo apt install docker.io
#here is docker file #这里是docker文件
FROM python:3
WORKDIR /workspace
COPY test.py /workspace
RUN pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
CMD ["python", "./test.py"]
#here is test.py file #这里是test.py文件
import torch
print('testing')
print(torch.cuda.get_device_name(0))
print(torch.cuda.is_available())
print(torch.cuda.current_device())
print(torch.cuda.device_count())
print('gpu')
nvcc --version nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
nvidia-smi英伟达-smi
-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.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 GeForce ... Off | 00000000:01:00.0 On | N/A |
| N/A 64C P0 24W / N/A | 513MiB / 6069MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
uname -r 5.8.0-63-generic
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
docker version
Client:
lient:
Version: 20.10.2
API version: 1.41
Go version: go1.13.8
Git commit: 20.10.2-0ubuntu1~20.04.3
Built: Fri Jul 23 21:06:26 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.8
Git commit: 20.10.2-0ubuntu1~20.04.3
Built: Fri Jul 23 19:35:35 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.5.2-0ubuntu1~20.04.2
GitCommit:
runc:
Version: 1.0.0~rc95-0ubuntu1~20.04.2
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
This is how i build image and run it这就是我构建图像并运行它的方式
sudo docker build -t test .
sudo docker run test --gpus all
This command is incorrectly ordered:此命令的顺序不正确:
sudo docker run test --gpus all
The docker run command takes the syntax: docker run 命令采用以下语法:
docker ${args_to_docker} run ${args_to_run} image_name ${cmd_override}
The --gpus
is a flag to the run
command, and not a command you want to run inside your container. --gpus
是run
命令的标志,而不是您要在容器内运行的命令。 So you'd reorder as:所以你会重新排序为:
sudo docker run --gpus all test
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.