Thursday, June 16, 2016

How to install MXnet in Ubuntu 14.04 LTS

Hardware Configutation
S7050GM2NR
CPU: E5-2650 v3 x1
RAM: DDR4 8GB x4
OS: Ubuntu 14.04 LTS Desktop 64bit
GPU: Nvidia Tesla K80 x1 (Driver: v352.93)

Setup Environment
1.      Install Ubuntu 14.04 LTS Desktop
2.      Boot to text mode
vi /etc/default/grub
mark GRUB_CMDLINE_LINUX_DEFAULT=”quiet”
change GRUB_CMDLINE_LINUX=”text”
umark GRUB_TERMINAL=console
save

update grub via command:
update-grub
reboot system


Install K80 Driver
     ./NVIDIA-Linux-x86_64-352.93.run

     apt-get update
     apt-get install –y build-essential git libblas-dev libopencv-dev libatlas-base-dev

Download MXnet
1.      git clone –recursive https://github.com/dmlc/mxnet

Install CUDA 7.5 environment
    dpkg –I cuda-repo-ubuntu1404_7.5-18_amd64.deb

You can also type follows command if you have CUDA 7.5 source file already
    dpkg –I cuda-repo-ubuntu1404-7.5-local_7.5-18_amd64.deb

    apt-get update
    apt-get install cuda

Set CUDA environment
     export PATH=/usr/local/cuda-7.5/bin:$PATH
     export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH

Check CUDA environment
     printenv LD_LIBRARY_PATH
     nvidia-smi

Set CUDA for MXnet
     cd /temp/mxnet
     cp /temp/mxnet/make/config.mk /temp/mxnet/.
Modify config.mk
     USE_CUDA = 1
     USE_CUDA_PATH = /usr/local/cuda
     USE_BLAS = atlas

Complie MXNET
     make –j4

Install Python
     apt-get install python-setuptools python-dev python-pip
     pip install numpy
     cd python; python setup.py install

Test MXnet
     cd /temp/mxnet/example/image-classificatopm
     python train_mnist.py            <= use CPU only

     python train_mnist.py --gpus “0,1” <=use GPUs

No comments:

Post a Comment