nvidia-docker icon indicating copy to clipboard operation
nvidia-docker copied to clipboard

docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime error

Open lychenpan opened this issue 7 years ago • 43 comments

The template below is mostly useful for bug reports and support questions. Feel free to remove anything which doesn't apply to you and add more information where it makes sense.

Also, before reporting a new issue, please make sure that:


1. Issue or feature description

I'm tring to install nvidia-docker v2, and follow the steps at the last step: docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi it will have error message: docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/56ca0b73c5720021671123b7f44c885bb1e7b42957c9b18e7b509be26760b993/log.json: no such file or directory): nvidia-container-runtime did not terminate sucessfully: unknown.

2. Steps to reproduce the issue

  1. Just the same as the readme here

3. Information to attach (optional if deemed irrelevant)

  • [ ] Some nvidia-container information: nvidia-container-cli -k -d /dev/tty info `e3380-8b5c-cbf2-8bb2-1bcced59103d at 00000000:01:00.0) NVRM version: 418.56 CUDA version: 10.1

Device Index: 0 Device Minor: 0 Model: GeForce GTX 1080 Ti Brand: GeForce GPU UUID: GPU-e17e3380-8b5c-cbf2-8bb2-1bcced59103d Bus Location: 00000000:01:00.0 Architecture: 6.1 I0720 05:40:32.999897 19015 nvc.c:318] shutting down library context I0720 05:40:33.000865 19017 driver.c:192] terminating driver service I0720 05:40:33.010816 19015 driver.c:233] driver service terminated successfully`

  • [ ] Kernel version from uname -a Linux cp 4.4.0-154-generic #181-Ubuntu SMP Tue Jun 25 05:29:03 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

  • [ ] Any relevant kernel output lines from dmesg

  • [ ] Driver information from nvidia-smi -a `Timestamp : Sat Jul 20 13:42:03 2019 Driver Version : 418.56 CUDA Version : 10.1

Attached GPUs : 1 GPU 00000000:01:00.0 Product Name : GeForce GTX 1080 Ti`

  • [ ] Docker version from docker version `Client: Version: 18.06.1-ce API version: 1.38 Go version: go1.10.3 Git commit: e68fc7a Built: Tue Aug 21 17:24:56 2018 OS/Arch: linux/amd64 Experimental: false

Server: Engine: Version: 18.06.1-ce API version: 1.38 (minimum version 1.12) Go version: go1.10.3 Git commit: e68fc7a Built: Tue Aug 21 17:23:21 2018 OS/Arch: linux/amd64 Experimental: false`

  • [ ] NVIDIA packages version from dpkg -l '*nvidia*' or rpm -qa '*nvidia*' Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= ii libnvidia-cont 1.0.2-1 amd64 NVIDIA container runtime library ii libnvidia-cont 1.0.2-1 amd64 NVIDIA container runtime library un nvidia-304 <none> <none> (no description available) un nvidia-340 <none> <none> (no description available) un nvidia-384 <none> <none> (no description available) un nvidia-common <none> <none> (no description available) ii nvidia-contain 3.0.0-1 amd64 NVIDIA container runtime ii nvidia-contain 1.4.0-1 amd64 NVIDIA container runtime hook un nvidia-docker <none> <none> (no description available) ii nvidia-docker2 2.1.0-1 all nvidia-docker CLI wrapper un nvidia-libopen <none> <none> (no description available) un nvidia-prime <none> <none> (no description available)

  • [ ] NVIDIA container library version from nvidia-container-cli -V version: 1.0.2

  • [ ] NVIDIA container library logs (see troubleshooting)

  • [ ] Docker command, image and tag used tensorflow/tensorflow:nightly-gpu-py3-jupyter

lychenpan avatar Jul 20 '19 05:07 lychenpan

Can anyone help me? Thanks.

lychenpan avatar Jul 20 '19 05:07 lychenpan

We need more information.

Can you do this:

  1. In file /etc/nvidia-container-runtime/config.toml, add this:
[nvidia-container-runtime]
debug = "/var/log/nvidia-container-runtime"
  1. Run docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
  2. Give the content of /var/log/nvidia-container-runtime

jjacobelli avatar Jul 20 '19 15:07 jjacobelli

@Ethyling thanks for your help.
2019/07/21 19:46:34 Running nvidia-container-runtime 2019/07/21 19:46:34 Using bundle file: /var/run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/ffb99321f8a60d6cccf1a461ce7782d24b00217e530138d8aa779d98c2ec27a0/config.json 2019/07/21 19:46:34 Prestart hook path: /usr/bin/nvidia-container-runtime-hook 2019/07/21 19:46:34 Prestart hook added, executing runc 2019/07/21 19:46:34 ERROR: find runc path: exec: "runc": executable file not found in $PATH That is the content.

lychenpan avatar Jul 21 '19 11:07 lychenpan

Can you do this too, and give us the output:

  1. Run whereis runc
  2. Run whereis docker-runc

Thank you!

jjacobelli avatar Jul 22 '19 12:07 jjacobelli

I'm getting EXACTLY the same error as the reporter, on all my dev, staging, and production systems, as soon as ElasticBeanstalk tries to create new servers. Code / Config hasn't been touched in 15 days, and everything has been stable for the last 2 weeks, so something referenced during EC2 startup is failing ( I hardcode my nvidia driver install etc into my baked AMI ). the only thing it could be really is the nvidia-docker install as that is installed on server startup. Again, I've not changed anything !, it's just suddenly started happening ! Hope you guys can fix this asap or suggest a work-around !

mikecouk avatar Jul 22 '19 14:07 mikecouk

I am also seeing this same issue @mikecouk. We use nvidia-docker on some AWS beanstalk environments. Starting last Friday, deploys stopped working due to this issue. It looks like some automatic updates trigger and update nvidia-docker, and now it no longer works.

mikeobr avatar Jul 22 '19 14:07 mikeobr

We are currently working on this, but first we need more information:

Can you do this too, and give us the output:

1. Run `whereis runc`

2. Run `whereis docker-runc`

Thank you!

jjacobelli avatar Jul 22 '19 14:07 jjacobelli

@Ethyling :

`[ec2-user]$ whereis runc

runc:

[ec2-user]$ whereis docker-runc

docker-runc: /usr/bin/docker-runc

`

mikeobr avatar Jul 22 '19 14:07 mikeobr

@mikeobr Thank you, I will come back to you asap

jjacobelli avatar Jul 22 '19 14:07 jjacobelli

We're currently testing a fix by aliasing docker-runc to runc, which as you've already worked out doesn't exist anymore :) Will get back to you asap.

mikecouk avatar Jul 22 '19 14:07 mikecouk

Hi, I am facing the same problem. This is the output of command.

$ whereis runc
runc:
$ whereis docker-runc
docker-runc: /usr/bin/docker-runc /usr/bin/X11/docker-runc

thanks

kosuke55 avatar Jul 22 '19 14:07 kosuke55

Working with @mikecouk on this one. While yum provides runc still lists the AWS Docker packages, none of the published 18.06 versions actually installed the runc binary (we tried downgrading to all of them).

brett-lempereur avatar Jul 22 '19 15:07 brett-lempereur

The "brett hack" to give it it's official name has fixed our problem, currently rolling it out to all servers before they have a chance to die and respawn ( we use spot instances ! ). The line you'll want for the moment in your scripts AFTER then nvidia-docker2 yum install is ;

if [ \! -f /usr/bin/runc -a -f /usr/bin/docker-runc ]; then ln -s /usr/bin/docker-runc /usr/bin/runc; else echo "DID NOT CREATE RUNC SYMLINK"; fi

Phew, panic over the for the moment, but could do with an explanation on this ( even if it's blame AWS ! )

mikecouk avatar Jul 22 '19 15:07 mikecouk

Please use the 'brett hack' for the time being. This is a combination of two underlying non-issues that make an issue because of incompatibility:

  1. nvidia-container-runtime has a new release that uses the existing runc binary on host rather than compiling and shipping its own.
  2. The host may not have the 'runc' binary after all. It is called docker-runc instead.

What next: a new release in the pend for nvidia-docker that will look for docker-runc if runc is not found. It is still better to chase the binary's new name rather than chase its version, so point number '1' from above is here to stay.

rajatchopra avatar Jul 22 '19 15:07 rajatchopra

I am getting the same runc error, but I am using Ubuntu. Can someone tell me what is the "brett hack" version for this?

isildur7 avatar Jul 22 '19 15:07 isildur7

I am getting the same runc error, but I am using Ubuntu. Can someone tell me what is the "brett hack" version for this?

Create a runc symlink to point to docker-runc.

As @mikecouk will do it:

if [ \! -f /usr/bin/runc -a -f /usr/bin/docker-runc ]; then ln -s /usr/bin/docker-runc /usr/bin/runc; else echo "DID NOT CREATE RUNC SYMLINK"; fi

rajatchopra avatar Jul 22 '19 15:07 rajatchopra

The brett hack works, thanks for the quick workaround.

@mikecouk

( even if it's blame AWS ! )

I'm pretty sure AWS ElasticBeanstalk runs something like a yum update during install, I've had a similar issue before where stuff started breaking with no code changes. If you find a good way to lock versions or prevent this, I'd be happy to know 😃

mikeobr avatar Jul 22 '19 15:07 mikeobr

sudo ln -s /usr/bin/nvidia-container-toolkit /usr/bin/nvidia-container-runtime-hook Solved the problem for me

ramab1988 avatar Jul 23 '19 10:07 ramab1988

Is anyone else having issues again today? I put the Brett hack into place yesterday and it resolved the issue. Today I am seeing the same problem again (unable to retrieve OCI runtime error) with the workaround in place.

This is on AWS Beanstalk, so I'm not sure if it pulled a newer version.

EDIT: @ramab1988 's alias works for resolving the issue. Did something change that caused the initial workaround to no longer worker?

mikeobr avatar Jul 23 '19 13:07 mikeobr

Hi @mikeobr, can you do this please:

  1. In file /etc/nvidia-container-runtime/config.toml, add this:
[nvidia-container-runtime]
debug = "/var/log/nvidia-container-runtime"
  1. Run docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
  2. Give the content of /var/log/nvidia-container-runtime
  3. Run whereis runc
  4. Run whereis docker-runc
  5. Give the output

It will help us a lot, thank you!

jjacobelli avatar Jul 23 '19 14:07 jjacobelli