sudo apt-get install --no-install-recommends git cmake build-essential libboost-dev libboost-system-dev libboost-filesystem-dev
pip install setuptools wheel numpy scipy scikit-learn -U
sudo pip3 install lightgbm --install-option=--gpu --install-option="--opencl-include-dir=/usr/local/cuda/include/" --install-option="--opencl-library=/usr/local/cuda/lib64/libOpenCL.so"
不知道大家怎么样,反正这个方法我一直不行。经过我后期分析,如果上述代码安装失败的化,估计使用sudo pip3 install lightgbm --install-option=--gpu
即可。
git clone --recursive https://github.com/microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
cmake -DUSE_GPU=1 ..
# if you have installed NVIDIA CUDA to a customized location, you should specify paths to OpenCL headers and library like the following:
# cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda/include/ ..
make -j4
本人使用方法二成功安装。
但是需要注意的是,还需要在你想要的环境里进行这个步骤:
cd ../python-package/
python setup.py install