Run docker nvidia container with GPUS and systemctl

365 views Asked by At

when trying to run systemctl along with GPU,

systemctl is not working without --privileged and when trying to limit GPUS by providing --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 --privileged the container shows all the GPUS available inside the container.

if --privileged is not specified --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 the container shows the desired amount of GPUs

1

There are 1 answers

0
Sushant Agarwal On

NV_GPU='GPU number' nvidia-docker run --runtime=nvidia -it -v path:path nvcr.io/nvidia/tensorflow:xx.xx

Example:

NV_GPU='0,1' nvidia-docker run  --runtime=nvidia -it -v /storage/research/:/storage/research/ nvcr.io/nvidia/tensorflow:17.11-tf2-p3