#保证gpu是正常可用的:
nvidia-smi
nvcc -V
#进入root权限,且python环境为你正常使用环境,比如anaconda3,而不是python2.7
#依赖:sudo apt-get install --no-install-recommends git cmake build-essential libboost-dev libboost-system-dev libboost-filesystem-dev
#首先进行必要的升级:
#cmake>=3.2(eg: v3.16.8)
#https://cmake.org/download/
./configure
make
make install
cmake -version #若不正常显示,则添加软连接:
ln -s /xxx/cmake /usr/bin/cmake
#boost>=1.56(eg: v1.61)
#https://dl.bintray.com/boostorg/release/
#安装会有一些错误,但没关系~~~之前浪费很多时间
./bootstrap.sh --with-python=/xxx/anaconda3/bin/python --with-python-version=3.x --with-python-root=/xxx/anaconda3/bin/python3.x
./b2
./b2 install
#lightgbm==2.3.2
git clone --recursive https://github.com/microsoft/LightGBM
cd LightGBM
mkdir build ; cd build
cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda/include/ ..
make -j$(nproc)
python ../python-package/setup.py install #注意你要安装到哪个python环境下
#To test!
lightgbm(gpu)在linux(centos7)安装
最新推荐文章于 2024-07-18 19:45:00 发布