3
votes

I have been trying to train a XGBoost model in a Jupyter Notebook. I installed XGboost(GPU) by following commands:

git clone — recursive https://github.com/dmlc/xgboost
cd xgboost
mkdir build
cd build
cmake .. -DUSE_CUDA=ON
make -j

But whenever I try to train the model but model.fit, the kernel restarts after a few minutes. code:

params = { 'max_depth': 50, 'n_estimators':80, 'learning_rate':0.1, 'colsample_bytree':7, 'gamma':0, 'reg_alpha':4, 'objective':'binary:logistic', 'eta':0.3, 'silent':1, 'subsample':0.8, 'tree_method':'gpu_hist', 'predictor':'gpu_predictor',}
xgb_model = xgb.XGBClassifier(**params).fit(X_train, y_train) 
xgb_prediction = xgb_model.predict(X_valid)

where X_train and y_train are derived form sklearn TfidfVectorizer

I have cuda installed, cat /usr/local/cuda/version.txt gives : CUDA Version 10.2.89

1
Hi @ent3r_, Python 3.7.6 - flames

1 Answers

3
votes

Try using param['updater'] = 'grow_gpu' as another parameter with XGBClassifier. Read this in detail here: https://xgboost.ai/2016/12/14/GPU-accelerated-xgboost.html.