Unofficial minimal docker instructions for managing NVIDIA Multi-Instance GPU (MIG) in containers.
Prerequisites:
Run:
docker run --rm -it --gpus all \
--cap-add=SYS_ADMIN \
-e NVIDIA_MIG_CONFIG_DEVICES=all \
ubuntu
# in the container
nvidia-smi mig -cgi 9,3g.20gb -C
nvidia-smi mig -dci && nvidia-smi mig -dgi
Note: --runtime=nvidia
, -e NVIDIA_VISIBLE_DEVICES=all
, and -e NVIDIA_DRIVER_CAPABILITIES=all
may be required depending on your environment and use cases.
Some references I found useful during the investigation.
Thanks Hsu-Tzu Ting for discussions.