-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add RMM as an optional dependency
- Loading branch information
Showing
6 changed files
with
147 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# RMM | ||
if (USE_RMM) | ||
# Use Conda env if available | ||
if(DEFINED ENV{CONDA_PREFIX}) | ||
set(CMAKE_PREFIX_PATH "$ENV{CONDA_PREFIX};${CMAKE_PREFIX_PATH}") | ||
message(STATUS "Detected Conda environment, CMAKE_PREFIX_PATH set to: ${CMAKE_PREFIX_PATH}") | ||
else() | ||
message(STATUS "No Conda environment detected") | ||
endif() | ||
|
||
find_path(RMM_INCLUDE "rmm" | ||
HINTS "$ENV{RMM_ROOT}/include") | ||
|
||
find_library(RMM_LIBRARY "rmm" | ||
HINTS "$ENV{RMM_ROOT}/lib" "$ENV{RMM_ROOT}/build") | ||
|
||
if ((NOT RMM_LIBRARY) OR (NOT RMM_INCLUDE)) | ||
message(FATAL_ERROR "Could not locate RMM library") | ||
endif () | ||
|
||
message(STATUS "RMM: RMM_LIBRARY set to ${RMM_LIBRARY}") | ||
message(STATUS "RMM: RMM_INCLUDE set to ${RMM_INCLUDE}") | ||
|
||
target_include_directories(objxgboost PUBLIC ${RMM_INCLUDE}) | ||
target_link_libraries(objxgboost PUBLIC ${RMM_LIBRARY} cuda) | ||
target_compile_definitions(objxgboost PUBLIC -DXGBOOST_USE_RMM=1) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
ARG CUDA_VERSION | ||
FROM nvidia/cuda:$CUDA_VERSION-devel-ubuntu18.04 | ||
|
||
# Environment | ||
ENV DEBIAN_FRONTEND noninteractive | ||
SHELL ["/bin/bash", "-c"] # Use Bash as shell | ||
|
||
# Install all basic requirements | ||
RUN \ | ||
apt-get update && \ | ||
apt-get install -y wget unzip bzip2 libgomp1 build-essential ninja-build git && \ | ||
# Python | ||
wget -O Miniconda3.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | ||
bash Miniconda3.sh -b -p /opt/python && \ | ||
# CMake | ||
wget -nv -nc https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh --no-check-certificate && \ | ||
bash cmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=/usr | ||
|
||
ENV PATH=/opt/python/bin:$PATH | ||
|
||
# Create new Conda environment with RMM | ||
RUN \ | ||
conda create -n rmm_test -c nvidia -c rapidsai -c conda-forge -c defaults \ | ||
python=3.7 rmm=0.14 cudatoolkit=$CUDA_VERSION | ||
|
||
ENV GOSU_VERSION 1.10 | ||
|
||
# Install lightweight sudo (not bound to TTY) | ||
RUN set -ex; \ | ||
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" && \ | ||
chmod +x /usr/local/bin/gosu && \ | ||
gosu nobody true | ||
|
||
# Default entry-point to use if running locally | ||
# It will preserve attributes of created files | ||
COPY entrypoint.sh /scripts/ | ||
|
||
WORKDIR /workspace | ||
ENTRYPOINT ["/scripts/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
if [[ "$1" == --conda-env=* ]] | ||
then | ||
conda_env=$(echo "$1" | sed 's/^--conda-env=//g' -) | ||
echo "Activating Conda environment ${conda_env}" | ||
shift 1 | ||
cmake_args="$@" | ||
source activate ${conda_env} | ||
else | ||
cmake_args="$@" | ||
fi | ||
|
||
rm -rf build | ||
mkdir build | ||
cd build | ||
cmake .. "$@" -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON | ||
cmake .. ${cmake_args} -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON | ||
make clean | ||
make -j$(nproc) | ||
cd .. |