踩坑lightGBM的windows安装gpu版本


最近有个念头想搞一波boost,有不想折腾Linux,在安装了windows下的gpu版本xgboost之后,听闻传说中的倚天剑lightGBM神速无敌,为了不可惜一个1060ti的gpu,强行在windows上安装。

​ 然而,就像预想的一样,想不采坑,那是很困难的。按照官方的步骤,安装了cuda和boost以及cmake之后,执行以下几条语句即可:

Set BOOST_ROOT=D:\local\boost_1_66_0\
Set BOOST_LIBRARYDIR=D:\local\boost_1_66_0\lib64-msvc-14.1
git clone –recursive https://github.com/Microsoft/LightGBM
<https://github.com/Microsoft/LightGBM>
cd LightGBM
mkdir build
cd build
cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DUSE_GPU=1 ..
cmake –build . –target ALL_BUILD –config Release


我的boost版本使1.66.0,然而并不行,提示找不到静态库boost_system和boost_filesysytem。我丢雷老谋啊,我看着我的libboost_filesystem-vc141-mt-s-x64-1_66.lib和libboost_system-vc141-mt-s-x64-1_66.lib静静地躺在

boost的目录中的时候,我陷入了沉思。mmp版本使对的,使用1.64提示版本太旧,ms编译器也是14.1(vs 2017)。

过程略过,,最后发现问题,原来是cmake版本的问题,在stackoverflow上找到一个答案
<https://stackoverflow.com/questions/42123509/cmake-finds-boost-but-the-imported-targets-not-available-for-boost-version>


Your CMake version is too old. Update CMake and it will work.

CMake cannot detect the dependencies between the different Boost libraries.
They have explicitly implemented inFindBoost.
For every Boost release this information is added by the CMake maintainers
and it gets part of the next CMake release. So you have to make sure, that your
CMake version was released after the Boost version you try to find.

Boost 1.63 requires CMake 3.7 or newer
Boost 1.64 requires CMake 3.8 or newer
Boost 1.65 and 1.65.1 require CMake 3.9.3 or newer
Boost 1.66 will be supported by CMake 3.11 or newer.

打开我的cmd,输入cmake /V ,3.10赫然显示在控制台中。

日了狗,下了衣蛾3.11的cmake,一切搞定。

pip install lightgbm –install-option=–gpu

直接装上了python的接口,之前的几条指令也可以用。

测试了device:gpu,可以运行。但是,,两天就这么过去了,你大爷。

友情链接
ioDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信