Skip to content

Instantly share code, notes, and snippets.

@sunshineatnoon
Last active October 22, 2018 14:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sunshineatnoon/99ae81c8bd2fdaf8e6189b5a206b9389 to your computer and use it in GitHub Desktop.
Save sunshineatnoon/99ae81c8bd2fdaf8e6189b5a206b9389 to your computer and use it in GitHub Desktop.
  1. Install CMake 3.5.2 on CentOS 7

    Download Source distributions cmake-3.5.2.tar.gz from https://cmake.org/download/
    ./bootstrap
    gmake
    sudo gmake install
    
  2. Install libgpuarray on Centos 7

    git clone https://github.com/Theano/libgpuarray.git
    cd libgpuarray
    mkdir Build
    cd Build
    cmake .. -DCMAKE_BUILD_TYPE=Release
    cd ..
    make
    sudo make install
    
  3. install caffe on centos 7

    (1) sudo yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel

    (2) sudo yum install gflags-devel glog-devel lmdb-devel

    (3) install openblas

    ```
    git clone https://github.com/xianyi/OpenBLAS
    cd OpenBLAS && make
    sudo make PREFIX=/opt/OpenBLAS install
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/OpenBlas/lib/
    ```
    

    (4) Edit Makefile.config

    ```
    cp Makefile.config.example Makefile.config
    BLAS := open
    BLAS_INCLUDE :=  /opt/OpenBLAS/include
    BLAS_LIB := /opt/OpenBLAS/lib
    PYTHON_INCLUDE := /usr/include/python2.7 /usr/lib64/python2.7/site-packages/numpy/core/include/
    ```
    

    (5) Make

    ```
    make all
    make test
    make runtest
    ```
    

    (6) Install python interface

    ```
    cd python
    for req in $(cat requirements.txt); do sudo -E pip install $req; done
    cd ..
    make pycaffe
    ``` 	
    
  4. Install Nivida Driver

    (1) sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

    (2) sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

    (3) sudo yum install nvidia-detect

    (4) nvidia-detect -v

    (5) sudo yum install nvidia-x11-drv nvidia-x11-drv-32bit

    (6) disable Intel on-board graphic through BIOS: Peripheral->Initial Display Output-> PCIe1 shot Peripheral->Intel Processor Graphics->Disabled (7) reboot

  5. Install Cuda

    (1) Download cuda-***.run from Nivida

    (2) sudo yum install gcc gcc-c++ kernel-devel

    (3) disable nouveau:

     `sudo vi /etc/modprobe.d/blacklist.conf and add this line to the end of the file: options nouveau modeset=0`
    

    (4) sudo init 3

    (5) chmod cuda-***.run

    (6) sudo ./cuda-***.run

    (7) reboot

  6. Install Theano and keras

    sudo yum install python-devel
    sudo pip install theano
    sudo pip install keras
    
  7. Install Image

    sudo yum install libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel
    sudo pip install Image
    
  8. Install LAMP on centos

    APpche

    sudo yum install httpd
    sudo service httpd start
    sudo systemctl enable httpd.service
    sudo systemctl restart httpd.service
    

    MYSQL

    sudo yum install mariadb-server
    sudo systemctl enable mariadb.service
    sudo systemctl start mariadb.service
    mysql_secure_installation
    

    PHP

    sudo yum install php php-pear
    sudo yum install php-mysql
    sudo mkdir /var/log/php
    sudo chown apache /var/log/php
    sudo systemctl reload httpd
    

    PHPMyadmin

    sudo -E yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
    sudo -E yum install phpmyadmin
    
  9. Install FFmpeg

    Follow the official compilation guide

    Note that libfdk_aac is not open source, so just disable it when configure FFmpeg.

  10. How to install cudnn on CentOs

    tar -xzvf cudnn-6.5-linux-R1.tgz
    cd cudnn-6.5-linux-R1
    sudo cp lib* /usr/local/cuda/lib64/
    sudo cp cudnn.h /usr/local/cuda/include/
    
  11. RabbitMQ

    sudo -E yum -y install rabbitmq-server
    systemctl start rabbitmq-server
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment