From 2b9a62a806bcd04a30b2dec69951404c9c917f77 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Tue, 7 Jan 2020 11:15:19 +0800 Subject: [PATCH] Throw error when not compiled with NCCL. (#5170) --- src/common/device_helpers.cu | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/device_helpers.cu b/src/common/device_helpers.cu index 90b58649d..c30c55d90 100644 --- a/src/common/device_helpers.cu +++ b/src/common/device_helpers.cu @@ -71,6 +71,10 @@ void AllReducer::Init(int _device_ordinal) { dh::safe_nccl(ncclCommInitRank(&comm, rabit::GetWorldSize(), id, rank)); safe_cuda(cudaStreamCreate(&stream)); initialised_ = true; +#else + if (rabit::IsDistributed()) { + LOG(FATAL) << "XGBoost is not compiled with NCCL."; + } #endif // XGBOOST_USE_NCCL }