1. 程式人生 > >採坑lightGBM的windows安裝gpu版本

採坑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,可以執行。但是,,兩天就這麼過去了,你大爺。