Docker

To get a consistent environment with fixed versions of proprietary programs like cudnn, cuda, bazel and other dependencies of tensorflow, dockers are convenient.

Here's a crash course.

container = an instance of an image, it runs. files that you need to save past the end of a container’s life should be kept in a shared folder. image = a immutable snapshot from a virtual machine image

Images

list all containers

docker image ls -a

Containers

list all containers

(These two commands do the same)

docker ps -a docker container ls -a

restart and attach a stopped container

docker start 3982cfe11658 docker attach 3982cfe11658 docker start -a 3982cfe11658

remove all non-running containers

docker rm `docker ps -aq -f status=exited`

Creating a container based on a public docker

sudo docker run -it -w /jammy -v $PWD:/mnt -e HOST_PERMS="$(id -u):$(id -g)" rstudio/r-base:4.3-jammy bash

apt-get update apt-get install -y gnupg

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600 sudo apt-key del 7fa2af80 wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb dpkg -i cuda-keyring_1.0-1_all.deb apt-get update apt-get -y install —no-install-recommends cuda=11.8.0-1

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: maj 2, 2023