Skip to content

SoonminHwang/dockers

Repository files navigation

Repository for dockerfiles


  1. cuda-caffe-matlab

     Ubuntu 14.04 + cuda 8.0 + cudnnv5 + caffe/matlab dependencies
    
  2. matlab-anaconda-cuda7.0-cudnn4

     Ubuntu 14.04 + cuda7.0 + cudnnv4 + matlab dependencies + anaconda
    
  3. PSPNet: based on "matlab-anaconda-cuda7.0-cudnn4"

     caffe dependencies
    
  4. MXNet for Resnet-38 segmentation [Link]

     Ubuntu 14.04 + cuda 8.0 + cudnnv5.1 + mxnet
    

Usage


Pull docker image

  1. Choose one of these [IMAGE_NAME]: cuda-caffe-matlab, matlab-anaconda-cuda7.0-cudnn4, pspnet, mxnet

     docker pull soonminh/IMAGE_NAME
    

Or Build Docker image on your machine

  1. Preparation: generate Dockerfile with name

     ./make_dockerfile.sh matlab-anaconda-cuda7.0-cudnn4
    
  2. matlab-anaconda-cuda7.0-cudnn4

     docker build -t soonminh/baseenv:mat-py-cuda7.0-cudnn4 matlab-anaconda-cuda7.0-cudnn4/
    

Run docker image

  1. To use gui interface,

    • Use follow options:

        -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
        -e DISPLAY=$DISPLAY
      
  2. To use matlab in docker container,

    • Specify several variables (modify follows depending on your MATLAB version & mac address)

        export MATLAB_ROOT=/usr/local/MATLAB/R2015b
        export MATLAB_LOGS=/home/rcvlab/matlab-logs
        export MATLAB_MAC_ADDRESS=11:22:33:44:55:66
      
    • Use follow options:

        -v "$MATLAB_ROOT":/usr/local/MATLAB/from-host \
        -v "$MATLAB_LOGS":/var/log/matlab \
        --mac-address="$MATLAB_MAC_ADDRESS"
      
    • For more details, please refer original description (ninjaben/matlab-support)

  3. Example

    • My case,

        $ export MATLAB_ROOT=/usr/local/MATLAB/R2015b
        $ export MATLAB_LOGS=/home/rcvlab/matlab-logs
        $ export MATLAB_MAC_ADDRESS=11:22:33:44:55:66
      
        $ echo 'alias caffematlabos='sudo nvidia-docker run -it -u rcvlab \
        		-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
        		-e DISPLAY=$DISPLAY \
        		-v "$MATLAB_ROOT":/usr/local/MATLAB/from-host \
        		-v "$MATLAB_LOGS":/var/log/matlab \
        		--mac-address="$MATLAB_MAC_ADDRESS" \
        		soonminh/baseenv:mat-py-cuda7.0-cudnn4' >> ~/.bashrc
      
        $ source ~/.bashrc
        $ caffematlabos
      

Tips

- Use mount in container (connect network drive)
		$ sudo nvidia-docker run -it \
		--cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined $DOCKER_IMAGE_NAME

- Add your account into sudo group & set password,	
		$ sudo nvidia-docker run -it --name base -u root soonminh/baseenv:mat-py-cuda7.0-cudnn4
		$ adduser USER_NAME sudo
		$ passwd USER_NAME
		$ exit
		$ docker commit base soonminh/baseenv:mat-py-cuda7.0-cudnn4


- Deprecated (Below procedure is already done in Dockerfile),
		
		$ id (remember id number = USER_ID_NUM)
		$ sudo nvidia-docker run -it -name base -u root soonminh/baseenv:mat-py-cuda7.0-cudnn4
		$ groupadd -r USER_NAME -g USER_ID_NUM
		$ useradd -u USER_ID_NUM -g USER_NAME -m -s /bin/bash USER_NAME
		$ adduser USER_NAME sudo
		$ passwd USER_NAME
		$ docker commit base soonminh/baseenv:mat-py-cuda7.0-cudnn4

- Set alias,

		$ echo -e alias pspnetos=\"sudo nvidia-docker run -it -u ${USER_NAME} \\n
			\t -v /tmp/.X11-unix:/tmp/.X11-unix:ro \\n
			\t -e DISPLAY=$DISPLAY \\n
			\t -v $MATLAB_ROOT:/usr/local/MATLAB/from-host \\n
			\t -v $MATLAB_LOGS:/var/log/matlab \\n
			\t --mac-address=$MATLAB_MAC_ADDRESS \\n
			\t -v ~/workspace:/home/rcvlab/workspace \\n
            \t -v /mnt/HDD4TB:/mnt/HDD4TB \\n
            \t -v /media/rcvlab/New4TB:/media/rcvlab/New4TB \\n
			\t soonminh/pspnet:latest\" >> ~/.bashrc
		$ source ~/.bashrc

If you are struggling with python-unicode problem, see here

$ python -c "print(chr(0x5555))"
On a correctly configured system, it gives:
啕
Else,
$ export LANG=C.UTF-8

About

Dockerfiles for my working environments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages