Docker
- Install Docker for Ubuntu 16.04 or 18.04
- Nvidia Docker Prerequiste
https://nvidia.github.io/nvidia-docker/
- Nvidia Docker Install
https://github.com/nvidia/nvidia-docker/wiki/Installation-(Native-GPU-Support)
OS Base Selection Tags
https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md
Step 1) use FROM to select a os base (e.g. nvidia-docker) => nvidia/cuda
Step 2) add stuff on top of the os base (e.g. ROS) ; RUN to run as root; ENV to select environmental variables
Step 3) use docker build to “compile” the modified os to a “image”
1 | docker build -t org/repo:tag . |
Step 4) use docker run to run the image as a container
1 | docker run -it --name test -v /home/sam/Music/vivek:/root --gpus all -p 6000:6000 nvidia/cuda #:9.0-devel |
Step 5) use docker push to push the image to dockerhub, however only one repo is free
docker container ls -a
docker image ls
stop all containers:
docker kill $(docker ps -q)
remove all containers
docker rm $(docker ps -a -q)
remove all docker images
docker rmi $(docker images -q)
#######GOOD
ssh -X sam@localhost -p 6000
ssh -X root@localhost -p 6000
ssh -X normal@localhost -p 6000
docker run -it –name test -v /home/sam/Music/vivek:/root –gpus all -p 6000:22 XXXXXXX
Error & solutions
Error:
‘’’
stderr: nvidia-container-cli: requirement error: unsatisfied condition: cuda>=10.1, please update your driver to a newer version, or use an earlier cuda container\\n\\”\””
‘’’
Solution:
You need to upgrade your graphic card driver. This is 9.0, not 8.0.
Or, you can use the nvidia/cuda:8.0-devel image and keep your driver.
https://github.com/NVIDIA/nvidia-docker/issues/543#issuecomment-345888252
To use HOST usb cam
docker run -it –name test -v /home/sam/Music/vivek:/root –gpus all -p 6000:22 –device=/dev/video0:/dev/video0 supercrazysam/supercrazysam:thermal_yolo