码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu 18 安装xgboost GPU版本

时间:2019-02-24 12:16:07      阅读:339      评论:0      收藏:0      [点我收藏+]

标签:csdn   size   make   html   github   www   span   目录   http   

综合上述两个帖子:

https://www.cnblogs.com/huadongw/p/6161145.html

https://blog.csdn.net/u011587516/article/details/78995186

先把之前安装的xgboost都卸载干净:

pip uninstall xgboost

确保电脑里安装了cuda。

然后按照下面的步骤来安装GPU版本的xgboost:

$git clone --recursive https://github.com/dmlc/xgboost
$cd xgboost
$mkdir build
$cd build
$cmake .. -DUSE_CUDA=ON
$make -j
$sh build.sh
$cd python-package
$python setup.py install
 
测试GPU
tests\benchmark目录下

分别执行

python benchmark.py --tree_method gpu_hist
python benchmark.py --tree_method hist
可以看到,第一个gpu版本的比第二个非GPU版本的快。在实际的代码中,只要在添加下面的参数就行了
param[‘tree_method‘] = ‘gpu_hist‘

 

 

ubuntu 18 安装xgboost GPU版本

标签:csdn   size   make   html   github   www   span   目录   http   

原文地址:https://www.cnblogs.com/zhoubiyu/p/10425759.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!