deep-learning-containers icon indicating copy to clipboard operation
deep-learning-containers copied to clipboard

[bug] nvidia-smi not available on GPU inference images

Open bgleadle opened this issue 6 years ago • 4 comments

Concise Description: When building a custom container from the Pytorch-Inference 1.5.1 container image we utilize the Python GPUtil library (https://github.com/anderskm/gputil) to get information about the currently available GPUs. That library has an internal dependency on nvidia-smi. I was surprised to see that these images have CUDA installed but don't have nvidia-smi available.

$ echo $PATH /opt/amazon/bin:/opt/amazon/sbin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

I see that /usr/local/nvidia/bin is included on the path but that folder doesn't actually exist

DLC image/dockerfile: 763104351884.dkr.ecr.us-east-1.amazonaws.com/pytorch-inference:1.5.1-gpu-py36-cu101-ubuntu16.04

Current behavior: root@dev-dsk-gldlb-2b-b0f9af72:/opt/amazon/bin# nvidia-smi bash: nvidia-smi: command not found

bgleadle avatar Sep 15 '20 01:09 bgleadle

After more testing I discovered that nvidia-smi is available within the docker container if the container is run on a host with a GPU, but it's not included on a host without a GPU. How exactly is this distinction determined?

bgleadle avatar Sep 15 '20 02:09 bgleadle

Hi @bgleadle - thank you for raising the issue.

Driver libaries/binaries are mounted inside the container from the host via the nvidia runtime (see the Driver Capabilities section in https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/user-guide.html). The default "utility" driver capability should be enough for use of nvidia-smi.

Some additional information - this is the base image we use for the DLC image you are using https://hub.docker.com/layers/nvidia/cuda/10.1-cudnn7-devel-ubuntu16.04/images/sha256-986c93509aa48b25a77111c2197d72c3bec9a4632765fd96e4734d216c89f27b?context=explore

arjkesh avatar Sep 15 '20 02:09 arjkesh

Hi @bgleadle - does the above answer your question? Happy to provide any additional context - if none is needed, however, can we close this issue?

arjkesh avatar Sep 16 '20 20:09 arjkesh

Hi @arjkesh - Thank you for the prompt response and for the NVidia documentation. It makes sense that the runtime of the docker container depends on the runtime drivers available on the host the container is running on. That answers my question and I am good to close this issue. Thanks again!

bgleadle avatar Sep 16 '20 22:09 bgleadle