M. Fire
M. Fire

Reputation: 127

Installing XGBoost on iMac M1 with GPU Support

I currently wrote some script for running XGBoost on my M1 iMac computer. I have installed XGBoost already within conda-forge as seen:

...
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xgboost                   1.5.0            py39ha480839_0    conda-forge
xz                        5.2.5                h642e427_1    conda-forge
...

But I get this error, not sure why:

Traceback (most recent call last):
  File "/Volumes/XXXXDrive/ProjectDrive/Project/Project.py", line 195, in
    xgb_model.fit(dtrainx, dtrainy)
  File "/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/core.py", line 506, in inner_f
    return f(**kwargs)
  File "/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/sklearn.py", line 789, in fit
    self._Booster = train(
  File "/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/training.py", line 188, in train
    bst = _train_internal(params, dtrain,
  File "/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/training.py", line 81, in _train_internal
    bst.update(dtrain, i, obj)
  File "/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/core.py", line 1680, in update
    _check_call(_LIB.XGBoosterUpdateOneIter(self.handle,
  File "/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/core.py", line 218, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
xgboost.core.XGBoostError: [01:00:46] /Users/runner/miniforge3/conda-bld/xgboost-split_1635105055642/work/src/gbm/../common/common.h:157: XGBoost version not compiled with GPU support.
Stack trace:
  [bt] (0) 1   libxgboost.dylib                    0x000000011f9418b0 dmlc::LogMessageFatal::~LogMessageFatal() + 124
  [bt] (1) 2   libxgboost.dylib                    0x000000011f9bf708 xgboost::gbm::GBTree::ConfigureUpdaters() + 464
  [bt] (2) 3   libxgboost.dylib                    0x000000011f9bf248 xgboost::gbm::GBTree::Configure(std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&) + 1008
  [bt] (3) 4   libxgboost.dylib                    0x000000011f9d91dc xgboost::LearnerConfiguration::Configure() + 1076
  [bt] (4) 5   libxgboost.dylib                    0x000000011f9d951c xgboost::LearnerImpl::UpdateOneIter(int, std::__1::shared_ptr<xgboost::DMatrix>) + 144
  [bt] (5) 6   libxgboost.dylib                    0x000000011f945b58 XGBoosterUpdateOneIter + 164
  [bt] (6) 7   libffi.dylib                        0x0000000199014050 ffi_call_SYSV + 80
  [bt] (7) 8   libffi.dylib                        0x000000019901c9e4 ffi_call_int + 948
  [bt] (8) 9   _ctypes.cpython-39-darwin.so        0x0000000113f8c744 _ctypes_callproc + 1236

I'm guessing that the xgboost I currently have is not the GPU support but rather just CPU support. My predictor is a gpu_predictor. But does anyone know how to check if I have the GPU version? Or at least how I can install the GPU version of the XGBoost on my M1 iMac? Thanks!

Upvotes: 2

Views: 6701

Answers (1)

nilsfl
nilsfl

Reputation: 103

Fire,

xgb is not supporting Apple M1 GPU. You can check the issue on Github: https://github.com/dmlc/xgboost/issues/6408

I don't expect xgb or lgbm to support Apple GPU very soon, which is very unfortunate.

Cheers

Upvotes: 4

Related Questions