Failed to compile XGBoost-R on Windows 10 with GPU support

Hi all,

I’ve been trying to compile XGBoost-R on Windows 10 with GPU support:

mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64" -DUSE_CUDA=ON -DR_LIB=ON
cmake --build . --target install --config Release

And I hit the following error

Project "C:\Users\Administrator\Desktop\xgboost\build\xgboost.vcxproj" (1) is building "C:\Users\Administrator\Desktop\
xgboost\build\gpuxgboost.vcxproj" (4) on node 1 (default targets).
PrepareForBuild:
  Creating directory "gpuxgboost.dir\Release\".
  Creating directory "C:\Users\Administrator\Desktop\xgboost\build\Release\".
  Creating directory "gpuxgboost.dir\Release\gpuxgboost.tlog\".
InitializeBuildStatus:
  Creating "gpuxgboost.dir\Release\gpuxgboost.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ComputeCustomBuildOutput:
  Creating directory "C:\Users\Administrator\Desktop\xgboost\build\CMakeFiles\gpuxgboost.dir\src\common\Release\".
  Creating directory "C:\Users\Administrator\Desktop\xgboost\build\CMakeFiles\gpuxgboost.dir\src\linear\Release\".
  Creating directory "C:\Users\Administrator\Desktop\xgboost\build\CMakeFiles\gpuxgboost.dir\src\objective\Release\".
  Creating directory "C:\Users\Administrator\Desktop\xgboost\build\CMakeFiles\gpuxgboost.dir\src\predictor\Release\".
  Creating directory "C:\Users\Administrator\Desktop\xgboost\build\CMakeFiles\gpuxgboost.dir\src\tree\Release\".
CustomBuild:
  Building NVCC (Device) object CMakeFiles/gpuxgboost.dir/src/common/Release/gpuxgboost_generated_host_device_vector.cu
  .obj
  CMake Error at gpuxgboost_generated_host_device_vector.cu.obj.Release.cmake:222 (message):
    Error generating
    C:/Users/Administrator/Desktop/xgboost/build/CMakeFiles/gpuxgboost.dir/src/common/Release/gpuxgboost_generated_host
  _device_vector.cu.obj


C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,
5): error MSB6006: "cmd.exe" exited with code 1. [C:\Users\Administrator\Desktop\xgboost\build\gpuxgboost.vcxproj]
Done Building Project "C:\Users\Administrator\Desktop\xgboost\build\gpuxgboost.vcxproj" (default targets) -- FAILED.

Anyone having similar problems?

I got it to work by using CUDA 8.0 + MSVC v140 compilers:

cmake .. -G"Visual Studio 15 2017 Win64" -T v140,cuda=8.0 -DR_LIB=ON -DUSE_CUDA=ON

@RAMitchell It appears that CUDA 9.2 and Visual Studio 2017 may prove problematic for compiling GPU code. Would it be better to update the installation doc?

Yes it would be good to add any notes to the docs re. setups that are know to work. I have installed it with R on windows a total of 1 time so can’t offer much insight.

@hcho3
the same issue happen on mxnet windows version, which also working very well at CUDA 8.0 but fail at CUDA9.2

@hcho3

following official tutorial https://xgboost.readthedocs.io/en/latest/build.html#installing-r-package-with-gpu-support

to build xgboost gpu R-package

cmake .. -DUSE_CUDA=ON -DUSE_NCCL=ON -DR_LIB=ON

error:

-- Found CUDA: /usr/local/cuda (found suitable version "9.0", minimum required is "8.0")
CMake Error at /usr/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Nccl (missing: NCCL_INCLUDE_DIR NCCL_LIBRARY)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindNccl.cmake:51 (find_package_handle_standard_args)
  CMakeLists.txt:135 (find_package)

I am installing xgboost-gpu on centos7, which seems does not support cuda-90 too. Is any plan to support cuda-90?

You should either install NCCL2 or set -DUSE_NCCL=OFF

1 Like

@hcho3
you are right, it is not CUDA problem, I turned off NCCL, it works. Thanks a lot.

Hi I am facing an issue. I had posted a question on Stack overflow: https://stackoverflow.com/questions/52307360/how-to-compile-xgboost-with-gpu-support-on-windows-10-for-r

I was able to successfully update the libraries in C:\Program Files\R\R-3.5.1\library with GPU support. But when I run tree_method in xgb.cv or xgb.train. Rstudio session crashes.

@rohanadagouda

please directly post more information in here.