gpu-enabled xgboost with Rstudio Server with Tensorflow-GPU for AWS

We're experimenting with the sweet Rstudio Server with Tensorflow-GPU for AWS AMI. It's look great on the tensorflow front, but we want to get GPU-enabled xgboost onto that instance, too, for some related tasks.

I'm trying to follow these instructions, but first it couldn't find CUDACXX (fixed(?) with this), and then I got this:

CMakeFiles/Makefile2:369: recipe for target 'src/CMakeFiles/objxgboost.dir/all' failed
make[1]: *** [src/CMakeFiles/objxgboost.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Scrolling up, I see a bunch of errors along these lines:

[my home dir]/xgboost/src/data/simple_csr_source.cu(78): error: 
identifier "xgboost::common::CheckNAN" is undefined in device code

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_0000401c_00000000-11_simple_csr_source.compute_70.cpp1.ii".

Any tips? I was hoping using this AMI would mean I don't have to learn out how to solve these sorts of things, but it looks like we might need to solve them after all :upside_down_face:

@jonthegeek I was able to get GPU-enabled xgboost installed using the following procedure:

Your user needs to have /usr/local/cuda/bin in your $PATH so it can find CUDACXX. (The default ubuntu user has this set automatically)

Steps I used to successfully build/install:

git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
mkdir build
cd build
cmake .. -DUSE_CUDA=ON -DR_LIB=ON
sudo make install -j

Note: I had to use sudo to install as root, as the /usr/local/lib/R/site-library/ directory is owned by root. Otherwise I got this error Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/site-library’

I was then able to load xgboost:

jforest@ip-172-16-133-203:~/xgboost/build$ which R
/usr/bin/R
jforest@ip-172-16-133-203:~/xgboost/build$ R

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> require(xgboost)
Loading required package: xgboost
>

I hope this provides enough for you to get it working, please let me know if not!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.