- 1 year ago
Installing XGboost R package with GPU support on Windows 10 - Not getting CMAKE installation to work
Comment
1 / 1
Installing the XGBoost R package with GPU support on Windows 10 can be a bit challenging due to the dependencies and configuration required. Here's a step-by-step guide to help you:
Install CMake:
- Download the CMake installer for Windows from the official CMake website (https://cmake.org/download/).
- Run the installer and follow the instructions to install CMake on your system.
Set up CUDA:
- Download and install the CUDA Toolkit for Windows from the NVIDIA website (https://developer.nvidia.com/cuda-downloads).
- Follow the CUDA Toolkit installation instructions carefully.
- Ensure that the CUDA installation directory is added to the system's
PATH
environment variable.
Set up MinGW-w64:
- Download and install MinGW-w64 for Windows from the official MinGW-w64 website (http://mingw-w64.org/doku.php).
- Select the appropriate architecture (32-bit or 64-bit) that matches your system.
- During the installation, choose "posix" thread model and add the installation directory to the system's
PATH
environment variable.
Install Rtools:
- Download and install Rtools from the official Rtools website (https://cran.r-project.org/bin/windows/Rtools/).
- Follow the Rtools installation instructions carefully.
- Add the Rtools installation directory to the system's
PATH
environment variable.
Install XGBoost with GPU support:
- Open the R console or RStudio.
- Install the
devtools
package if you haven't already:Rinstall.packages("devtools")
- Install the XGBoost package from the GitHub repository using
devtools
:Rdevtools::install_github("dmlc/xgboost", subdir = "R-package", force = TRUE, args = "--with-gpu --with-cuda")
The
--with-gpu
and--with-cuda
options enable GPU support during the installation process.Verify the installation:
- Load the XGBoost package in R:R
library(xgboost)
- Use the
xgboost_gpu_available()
function to check if GPU support is available:Rxgboost_gpu_available()
If GPU support is properly configured, the function should return
TRUE
.- Load the XGBoost package in R:
By following these steps, you should be able to install the XGBoost R package with GPU support on Windows 10. Keep in mind that the process can be complex, and it's important to carefully follow the installation instructions for each component.