Skip to content

Instantly share code, notes, and snippets.

@ruxi
Last active December 5, 2020 08:08
Show Gist options
  • Save ruxi/a49c7d183c3c70ec6dc20da53d747984 to your computer and use it in GitHub Desktop.
Save ruxi/a49c7d183c3c70ec6dc20da53d747984 to your computer and use it in GitHub Desktop.
how to build xgboost with gpu support
# install latest nvidia driver
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
# then go to device manager and dl newest driver
# nvidia-390 for linux >4.13.32 | there is a bug with <nvidia-390 & >linux 4.13.25
# download and install cudatoolkit via the docs
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu
# install xgboost with gpu support
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; make -j4
cd build
cmake .. -DUSE_CUDA=ON -DR_LIB=OFF # this is if R is not installed
make install -j
# install xgboost via setup.py
cd .. #xgboost directory
cd python-package
python setup.py develop --user
# test if gpu support works
cd xgboost
python tests/benchmark/benchmark.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment