lightgbm安裝(GPU)+用例

英雄王不二發表於2017-05-08

openMPI安裝參考網址:http://blog.csdn.net/jacketinsysu/article/details/44840611

light安裝參考官網:https://github.com/Microsoft/LightGBM/wiki/Installation-Guide

opencl安裝參考網站:http://blog.csdn.net/u010454261/article/details/52734395

opencl安裝參考網站:http://visionlab.uncc.edu/dokuwiki/install_opencl

第一步:安裝openMPI和opencl(必裝)

centos 系統需要安裝對應的centos系統的opencl 具體下載介面請登入intel develop官網:https://registrationcenter.intel.com/en/products/postregistration/?sn=c69g-hhpjw9ht&EmailID=312715289@qq.com&Sequence=2017401&dnld=t

$ wget -r -O intel_sdk_for_opencl_2016_ubuntu_6.3.0.1904_x64.tgz "http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/11060/intel_sdk_for_opencl_2016_ubuntu_6.3.0.1904_x64.tgz"

第一點:下載tgz檔案

第二點:tar -zxvf ***.tar.gz解壓檔案後,./install_GUI.sh安裝


並參考以下網站安裝:

opencl安裝參考網站:http://blog.csdn.net/u010454261/article/details/52734395

openMPI安裝參考網址:http://blog.csdn.net/jacketinsysu/article/details/44840611

第二步:安裝lightgbm

1、安裝Cmake
# 最好下載到/usr/local目錄下
$ sudo wget -r -O cmake-3.8.1.tar.gz "file:///D:/%E5%AE%89%E8%A3%85%E7%9B%AE%E5%BD%95/Google%E4%B8%8B%E8%BD%BD/cmake-3.8.1.tar.gz"
$ tar -zxvf cmake-3.8.1.tar.gz
$ cd cmake-3.8.1
$ sudo ./bootstrap
$ sudo make
$ sudo make install
$ cmake --version
2、配置lightGBM
這裡要把lightGBM安裝到/home目錄下,防止python setup install時 使用系統自帶的python
$ git clone --recursive https://github.com/Microsoft/LightGBM
$ cd LightGBM
$ mkdir build 
$ cd build
$ cmake .. 
$ make -j
然後在目錄***/LightGBM/python-package下執行:
$ python setup.py install

第三步:安裝GPU支援

1、boost 版本>1.54 本地安裝方式
如果不能執行
$ sudo apt-get install ocl-icd-libopencl1
$ sudo apt-get install ocl-icd-opencl-dev
$ sudo apt-get install libboost-dev
$ sudo apt-get install libboost-system-dev
$ sudo apt-get install libboost-filesystem-dev
那就本地安裝吧。下載網址:http://www.boost.org/users/history/version_1_64_0.html
# 最好安裝在/usr/local目錄下
$ wget -r -O boost_1_64_0.tar.gz "https://akamai.bintray.com/04/0445c22a5ef3bd69f5dfb48354978421a85ab395254a26b1ffb0aa1bfd63a108?__gda__=exp=1494500785~hmac=2da9cf0ed2dacd5cf1b0fd62bec02f2825041b89d0bef55027adc0c85431d9ab&response-content-disposition=attachment%3Bfilename%3D%22boost_1_64_0.tar.gz%22&response-content-type=application%2Fgzip&requestInfo=U2FsdGVkX1-BA7ar-kwJdmbDIV4SA5bBemArvLTDVcT38b6xJTD3YTdPTNS3-BdcWWOUkW5_o2A9g7H9qvJ_Rz7JekX3F_t722AYGQ14UWhaO1NIHxLcVxTP8akM0xb_7rYkx_sRkju42Hjvu-oQ7bw6lXH1Er5w2_G4hQQNbr6QP1rV-3AFSQwrDgF42iWr"
$ tar -zxvf boost_1_64_0.tar.gz
$ cd boost_1_64_0
$ ./bootstrap.sh
$ ./bjam
$ sudo cp -r ./boost_1_64_0/boost /usr/include 

2、配置GPU選項
這裡要把lightGBM安裝到/home目錄下,防止python setup install時 使用系統自帶的python
$ git clone --recursive https://github.com/Microsoft/LightGBM
$ cd LightGBM
$ mkdir build
$ cd build
$ cmake -DUSE_GPU=1 .. 
$ make -j

開啟GPU後需要cd到LightGBM/python-package目錄下再次執行:

$ python setup.py install

第四步:用例






相關文章