简体   繁体   English

docker:来自守护进程的错误响应:无法创建垫片

[英]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. --gpusrun命令的标志,而不是您要在容器内运行的命令。 So you'd reorder as:所以你会重新排序为:

sudo docker run --gpus all test

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 docker:来自守护程序的错误响应:OCI 运行时创建失败:没有这样的文件或目录”:未知 - docker: Error response from daemon: OCI runtime create failed: no such file or directory": unknown 从 dockerhub 推送后如何创建 docker-build n Docker 文件(来自守护进程的错误响应:意外错误读取 Dockerfile) - how to create docker-build n Docker file after pushed from dockerhub(Error response from daemon: unexpected error reading Dockerfile) Docker错误从守护程序获取事件:EOF - Docker Error getting events from daemon: EOF 来自守护进程的错误响应:容器未运行 Bamboo - Error response from daemon: Container is not running Bamboo Django的mod_wsgi错误:从守护进程读取响应头时超时 - mod_wsgi error with Django: Timeout when reading response headers from daemon process 在 Django 和 Apache 中使用 WSGI 时如何修复“从守护进程读取响应头时超时”错误 - How to fix " Timeout when reading response headers from daemon process" error when using WSGI with Django and Apache Can't create a docker image for COPY failed: stat /var/lib/docker/tmp/docker-builder 错误 - Can't create a docker image for COPY failed: stat /var/lib/docker/tmp/docker-builder error 如何使用docker-py使用接口终端创建守护程序容器? - How to create a daemon container with interface terminal using docker-py? Docker 副本:无法从发送方计算缓存密钥/错误 - Docker copy: failed to compute cache key/error from sender 错误“无法解码木偶的响应失败”后,继续硒脚本 - Continue selenium script after error “Failed to decode response from marionette”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM