Unable to run DLC Docker inamge (./dlc-docker: line 179: nvidia-docker: command not found)

I am trying to run the DLC docker image (https://github.com/DeepLabCut/Docker4DeepLabCut2.0) on Pop!_OS 20.04, with NVIDIA 455.38, GeForce RTX 2070.
I have the latest nvidia-container-toolkit from the Pop!_OS repositories, which I am assured is the same as the latest NVIDIA for Ubuntu 20.04, .
I also have the latest Docker from the repositories, version 19.03.13, build 4484c46d9d.

nvidia-smi:

Wed Dec  9 09:47:20 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.38       Driver Version: 455.38       CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+
| 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  GeForce RTX 2070    Off  | 00000000:07:00.0  On |                  N/A |
| N/A   44C    P0    29W /  N/A |    680MiB /  7973MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

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

gcc --version

gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I set up the Docker image according to the readme, but when I get to the command:

GPU=0 bash ./dlc-docker run -d -p 2351:8888 -e USER_HOME=$HOME/DeepLabCut --name dlcContainer kdys/dlcdocker

I get the following:

ret run -d -p 2351:8888 -e USER_HOME=/home/kdys/DeepLabCut --name dlcContainer kdys/dlcdocker run
1st CMD run

* Setting user name to:             kdys
* Setting user ID to:               1000
* Setting user groups to:           sudo
* Setting password to:              pw
* Setting Notebook port binding to: 2351 (to set manually add -p 2351:8888 as flag)

You can now open the notebook on the host machine by directing your browser to

    http://localhost:2351

0 nvidia-docker run -v /home/kdys:/home/kdys -p 35053:22 -p 2351:8888 -e USER_GROUPS=sudo -e USER=kdys -e USER_ID=1000 -e USER_ENCRYPTED_PASSWORD=aa5V9MSdgw5ec -e USER_HOME=/home/kdys -e GPU=0 -e DISPLAY=:1 -d -e USER_HOME=/home/kdys/DeepLabCut --name dlcContainer kdys/dlcdocker
./dlc-docker: line 179: nvidia-docker: command not found

A little searching has led me to understand that “nvidia-docker” command is deprecated.
I tried to install nvidia-docker2 as suggested here https://github.com/NVIDIA/nvidia-docker/issues/1028, but I am met with:
E: Unable to locate package nvidia-docker2

Is anyone running this on Ubuntu 20.04? And if so how do we bypass the depricated nvidia-docker command?
Thanks

it looks as if you have a mismatch here:

-e USER_HOME=$HOME/DeepLabCut

i.e., do you have this folder under home/DeepLabCut? It looks like you actually have it under kdys/DeepLabCut. So when you try to build the container, be sure you pass:

GPU=0 bash ./dlc-docker run -d -p 2351:8888 -e USER_HOME=$HOME/kdys/DeepLabCut --name dlcContainer kdys/dlcdocker

Thanks for the quick reply. But I don’t understand.
in the ReadMe it states:

# Create the DLC directory if it does not already exist
mkdir -p $HOME/DeepLabCut # or $HOME/whateveryouwant (see the options above)

# Run the docker container
GPU=1 bash ./dlc-docker run -d -p 2351:8888 -e USER_HOME=$HOME/DeepLabCut --name containername dlc_username/dlcdocker

So I:

  1. created the directory /home/kdys/DeepLabCut (echo $HOME returns /home/kdys)
  2. ran the command GPU=0 bash ./dlc-docker run -d -p 2351:8888 -e USER_HOME=$HOME/DeepLabCut --name dlcContainer kdys/dlcdocker from with in the /home/kdys/Docker4DeepLabCut2.0 directory

are these not the correct steps?

but the issue is if you don’t have a /home/DeepLabCut you have: home/kdys/DeepLabCut, so you simply need to change that one line to be either -e USER_HOME=$HOME/kdys/DeepLabCut or -e USER_HOME=$HOME/kdys

I have:

/home/kdys/DeepLabCut

I run:

GPU=0 bash ./dlc-docker run -d -p 2351:8888 -e USER_HOME=/kdys/DeepLabCut --name dlcContainer kdys/dlcdocker

or

GPU=0 bash ./dlc-docker run -d -p 2351:8888 -e USER_HOME=$HOME/kdys/DeepLabCut --name dlcContainer kdys/dlcdocker

or

GPU=0 bash ./dlc-docker run -d -p 2351:8888 -e USER_HOME=$HOME/DeepLabCut --name dlcContainer kdys/dlcdocker

from /home/kdys/Docker4DeepLabCut2.0

I still get:

ret run -d -p 2351:8888 -e USER_HOME=/kdys/DeepLabCut --name dlcContainer kdys/dlcdocker run
1st CMD run

* Setting user name to:             kdys
* Setting user ID to:               1000
* Setting user groups to:           sudo
* Setting password to:              pw
* Setting Notebook port binding to: 2351 (to set manually add -p 2351:8888 as flag)

You can now open the notebook on the host machine by directing your browser to

    http://localhost:2351

0 nvidia-docker run -v /home/kdys:/home/kdys -p 50418:22 -p 2351:8888 -e USER_GROUPS=sudo -e USER=kdys -e USER_ID=1000 -e USER_ENCRYPTED_PASSWORD=aa5V9MSdgw5ec -e USER_HOME=/home/kdys -e GPU=0 -e DISPLAY=:1 -d -e USER_HOME=/kdys/DeepLabCut --name dlcContainer kdys/dlcdocker
./dlc-docker: line 179: nvidia-docker: command not found

Issue solved on https://github.com/DeepLabCut/Docker4DeepLabCut2.0/issues/36.
Needed to install nvidia-docker2:

$ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
$ 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-get update

$ sudo apt-get install nvidia-docker2

for Pop!_OS echo $distribution returns pop20.04, which is “unsupported” by nvidia, but since it is basically Ubuntu 20.04 entering ubuntu20.04 in place of $distribution works in this case.

Then restart Docker:

 $ sudo systemctl daemon-reload
 $ sudo systemctl restart docker