title: Installing XGBoost on iMac M1 with GPU Support
body: <p>I currently wrote some script for running XGBoost on my M1 iMac computer. I have installed XGBoost already within conda-forge as seen:</p>
  <pre><code>...
  wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
  xgboost                   1.5.0            py39ha480839_0    conda-forge
  xz                        5.2.5                h642e427_1    conda-forge
  ...
  </code></pre>
  <p>But I get this error, not sure why:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/Volumes/XXXXDrive/ProjectDrive/Project/Project.py&quot;, line 195, in
      xgb_model.fit(dtrainx, dtrainy)
    File &quot;/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/core.py&quot;, line 506, in inner_f
      return f(**kwargs)
    File &quot;/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/sklearn.py&quot;, line 789, in fit
      self._Booster = train(
    File &quot;/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/training.py&quot;, line 188, in train
      bst = _train_internal(params, dtrain,
    File &quot;/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/training.py&quot;, line 81, in _train_internal
      bst.update(dtrain, i, obj)
    File &quot;/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/core.py&quot;, line 1680, in update
      _check_call(_LIB.XGBoosterUpdateOneIter(self.handle,
    File &quot;/Users/XXXX/miniforge3/lib/python3.9/site-packages/xgboost/core.py&quot;, 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&lt;std::__1::pair&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt;, std::__1::allocator&lt;std::__1::pair&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; &gt; const&amp;) + 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&lt;xgboost::DMatrix&gt;) + 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
  </code></pre>
  <p>I'm guessing that the xgboost I currently have is not the GPU support but rather just CPU support. My <code>predictor</code> is a <code>gpu_predictor</code>. 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!</p>