You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

训练XGBoost模型时如何使用Intel集成GPU?

问题:XGBoost无法识别Intel Iris Xe集成GPU

设备与环境

  • 设备:戴尔Vostro 15 5510
  • GPU:Intel(R) Iris(R) Xe Graphics
  • XGBoost安装方式:pip install xgboost

训练代码

param = {'objective': 'multi:softmax', 'num_class':22}
param['tree_method'] = 'gpu_hist'
bst = xgb.train(param, dtrain, 50, verbose_eval=True, evals=eval_set)

错误信息

XGBoostError: [11:16:53] C:/buildkite-agent/builds/buildkite-windows-cpu-autoscaling-group-i-0ac76685cf763591d-1/xgboost/xgboost-ci-windows/src/gbm/gbtree.cc:611: Check failed: common::AllVisibleGPUs() >= 1 (0 vs. 1) : No visible GPU is found for XGBoost.

问题原因与解决办法

  1. Intel集成GPU的支持限制:XGBoost原生的gpu_hist后端仅支持NVIDIA CUDA GPU,Intel Iris Xe这类集成GPU不在其适配范围内——这就是你在Colab(使用NVIDIA GPU)能正常运行、本地却报错的核心原因。
  2. 适配Intel GPU的方案:
    • 卸载现有XGBoost:pip uninstall -y xgboost
    • 安装Intel优化版本:pip install xgboost-intel
    • 修改代码参数,将tree_method改为hist(该后端会自动调用Intel oneAPI加速集成GPU,无需指定gpu_hist):
      param = {'objective': 'multi:softmax', 'num_class':22}
      param['tree_method'] = 'hist'
      bst = xgb.train(param, dtrain, 50, verbose_eval=True, evals=eval_set)
      
  3. 替代方案:如果必须使用原生XGBoost的gpu_hist加速,只能更换为NVIDIA独立GPU,因为该后端仅适配CUDA环境。

内容的提问来源于stack exchange,提问作者Nika Tsereteli

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 05:15:35