Skip to content

XGBoost PyPi package seems to lack CUDA support #11482

@Aman-Surkar

Description

@Aman-Surkar

Hello Team,
I installed XGBoost==3.0.1 via pip from PyPI, and when I try to run a test using device='cuda', I get this warning:
WARNING: /workspace/src/context.cc:196: XGBoost is not compiled with CUDA support.
Even though I’ve specified device='cuda', it still runs on CPU. Just wanted to check — does the PyPI version not come with GPU/CUDA support?
I am using UBI9 nvidia CUDA 12.6 x86 container.
when I run below sample program:

import numpy as np
import xgboost as xgb
xgb_model = xgb.XGBRegressor( # tree_method="gpu_hist" # deprecated
    tree_method="hist",
    device="cuda"
)
X = np.random.rand(50, 2)
y = np.random.randint(2, size=50)
xgb_model.fit(X, y)
print(xgb_model )

error message i get:

/home/builder/test/lib64/python3.9/site-packages/xgboost/core.py:158: UserWarning: [11:40:57] WARNING: /workspace/src/context.cc:43: No visible GPU is found, setting device to CPU.
  warnings.warn(smsg, UserWarning)
/home/builder/test/lib64/python3.9/site-packages/xgboost/core.py:158: UserWarning: [11:40:57] WARNING: /workspace/src/context.cc:196: XGBoost is not compiled with CUDA support.
  warnings.warn(smsg, UserWarning)
XGBRegressor(base_score=None, booster=None, callbacks=None,
             colsample_bylevel=None, colsample_bynode=None,
             colsample_bytree=None, device='cuda', early_stopping_rounds=None,
             enable_categorical=False, eval_metric=None, feature_types=None,
             gamma=None, grow_policy=None, importance_type=None,
             interaction_constraints=None, learning_rate=None, max_bin=None,
             max_cat_threshold=None, max_cat_to_onehot=None,
             max_delta_step=None, max_depth=None, max_leaves=None,
             min_child_weight=None, missing=nan, monotone_constraints=None,
             multi_strategy=None, n_estimators=None, n_jobs=None,
             num_parallel_tree=None, random_state=None, ...)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions