I've run a find command on a very large folder inside my docker, and now it is stuck for more than an hour.

I've tried to kill -9 the process, and kill the docker container with docker kill <containerid>, but nothing helps it move. I can't run anymore commands inside the docker. The host is very responsive.

The process status is R (running). I can't strace it (strace stucks), and kill -9 don't have any effect on it.

I've tried to look the /proc/PID/status file, it shows :

State:  R (running) 
voluntary_ctxt_switches:    2387
nonvoluntary_ctxt_switches: 29121

The two last numbers are increasing quite fast.

I don't care very much about that docker container or the result of the find command, but I care about the other containers on the same host.

Is there a way to nuke the process or the container without restarting the host ?

  • Since the host is active: Have tried sudo docker stop container_id?? and docker start container_id?
    – saviour123
    Mar 27, 2019 at 10:36
  • @saviour123 Yes. This command hangs. The command docker kill can be killed, but the container is still active.
    – blue112
    Mar 27, 2019 at 10:41
  • stop the container service and start??
    – saviour123
    Mar 27, 2019 at 11:20

1 Answer 1


when you build Docker, use this command :

RUN apt-get install lsof

then in py file you can use:

os.system("lsof /dev/nvidia* | awk '{print $2}' | xargs -I {} kill {}")

REMEMBER: this command kill all process on GPU

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.