采坑lightGBM的windows安装gpu版本

踩坑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
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上找到一个答案

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 in FindBoost.
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,可以运行。但是,,两天就这么过去了,你大爷。

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值