xgboost
xgboost copied to clipboard
[CI] Build and Test XGBoost GPU algorithm with Microsoft Visual Studio 2019
There have been a user report saying that Visual Studio 2019 could not compile XGBoost from the source. See https://discuss.xgboost.ai/t/installing-xgboost-with-gpu-support-for-r-on-windows-build-does-not-complete/2227/15. The issue surfaces when the GPU support is enabled with -DUSE_CUDA=ON.
Currently, our CI uses Visual Studio 2017 to build and test the GPU algorithm.
Just tried building XGBoost with Visual Studio 2019 + CUDA 11.3, and the build fails with cryptic error
identifier "_Verify_range" is undefined
System information:
- Windows Server 2019
- Visual Studio 2019 version 16.10.1
- CUDA 11.3
It would be best if we find the combination of compiler versions that are known to work on the Windows platform, as CUDA can be finicky about the version of the host compiler.
Known to work: Visual Studio 2017 + CUDA 10.1
I have just tested 2019 + cuda 11.4 and didn't see the error. After adding proper includes in some test files I was able to build XGBoost in this configuration.
I pushed the changes to https://github.com/dmlc/xgboost/pull/7180 .
I believe I am that user. I continue to have issues with VS 2022, 2019, and 2017, althouh error now is not the same as before and it is the same for each. I am using WIndows 10 64 bit and CUDA 11.7.
D:\xgboost\src\tree\gpu_hist\histogram.cu(315): note: see reference to function template instantiation 'auto xgboost::tree::BuildGradientHistogram::<lambda_6d0a0949a274b91398442d30e87cb3ab>::operator ()<void(__cdecl *)(x
gboost::EllpackDeviceAccessor,xgboost::tree::FeatureGroupsAccessor,xgboost::common::Span<const uint32_t,18446744073709551615>,GradientSumT *__restrict ,const xgboost::GradientPair *__restrict ,xgboost::tree::HistRounding
<GradientSumT>)>(void (__cdecl )(xgboost::EllpackDeviceAccessor,xgboost::tree::FeatureGroupsAccessor,xgboost::common::Span<const uint32_t,18446744073709551615>,GradientSumT _restrict ,const xgboost::GradientPair *re
strict ,xgboost::tree::HistRounding<GradientSumT>)) const' being compiled
with
[
GradientSumT=xgboost::detail::GradientPairInternal
bin\nvcc.exe" -gencode=arch=compute_86,code="sm_86,compute_86" -gencode=arch=compute_86,code="compute_86,compute_86" -gencode=arch=compute_86,code="sm_86,compute_86" --use-local-env -ccbin "C:\Program Files (x86)\Mic
rosoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64" -x cu -ID:\xgboost\include -I"D:\xgboost\dmlc-core\include" -ID:\xgboost\rabit\include -ID:\xgboost\gputreeshap -I"D:\xgboost\buildgpu\dml
c-core\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static --expt-extended-lambda --expt-relaxed-constexpr -Xfatb
in=-compress-all -lineinfo -std=c++14 -Xcompiler="/EHsc -Ob2 -openmp /utf-8" -D_WINDOWS -DNDEBUG -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -DXGBOOST_USE_CUDA=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_MM_PREFETCH_PRES
ENT=1 -D__USE_XOPEN2K8 -DDMLC_CORE_USE_CMAKE -DDMLC_USE_CXX11=1 -DXGBOOST_STRICT_R_MODE=1 -DXGBOOST_CUSTOMIZE_GLOBAL_PRNG=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_DISABLE_STDIN=1 -DRABIT_CUSTOMIZE_MSG
According to Visual Studio, rhe error comes from line 298 in histogram.cu which reads:
constexpr int kMinItemsPerBlock = kItemsPerTile;
If that helps.
I think it's fixed in 1.7.