首页 > 解决方案 > 在具有 GPU 支持的 Windows 10 for R 上安装 XGBoost 1.40:未创建 c_api.cu.obj 导致构建失败

问题描述

问题

我正在尝试在 Windows 10 上构建具有对 R 的 GPU 支持的 XGBoost,但在构建过程中遇到了问题。它在该部分期间不可避免地会失败,objxgboost.vcxproj并且不会c_api.cu.objobjxgboost.dir\Release\/c_api/目录中构建。source 下的所有其他目录似乎都构建并具有 e.obj 文件,但不是那个。我相信我严格遵循了官方的指示。我知道 CUDA 安装按照官方说明编译示例程序工作正常,我可以成功地将 keras/tensorflow 用于 R 和 CUDA。

我正在使用以下 VS 2019 和 CUDA 11.2,并拥有 RTX 3080(arch 86)。

我已经尝试安装 2015 构建工具并使用它们,没有骰子。即使没有 R,我也无法编译共享 XGBoost 库。但是我可以编译仅 CPU 共享库。

我不是专家,但经过大约 12 个小时的研究和尝试,我已经束手无策了。任何建议,将不胜感激。我将在下面发布 CMake 的调用、其结果、构建调用和错误消息。

谢谢你。

Cmake 配置(仅限共享库)

调用

cmake .. -G"Visual Studio 16 2019" -A x64 -DUSE_CUDA=ON -DGPU_COMPUTE_VER="80;86"

结果

-- The CXX compiler identification is MSVC 19.28.29913.0
-- The C compiler identification is MSVC 19.28.29913.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CMake version 3.19.20122902-MSVC_2
-- Performing Test XGBOOST_MM_PREFETCH_PRESENT
-- Performing Test XGBOOST_MM_PREFETCH_PRESENT - Success
-- Performing Test XGBOOST_BUILTIN_PREFETCH_PRESENT
-- Performing Test XGBOOST_BUILTIN_PREFETCH_PRESENT - Failed
-- xgboost VERSION: 1.4.0
-- Configured CUDA host compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe
-- The CUDA compiler identification is NVIDIA 11.2.152
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- CMAKE_CUDA_ARCHITECTURES: 86-real;86-virtual;80-real;80-virtual;
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Looking for fopen64
-- Looking for fopen64 - not found
-- Looking for C++ include cxxabi.h
-- Looking for C++ include cxxabi.h - not found
-- Looking for nanosleep
-- Looking for nanosleep - not found
-- Looking for backtrace
-- Looking for backtrace - not found
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- D:/xgboost/dmlc-core/cmake/build_config.h.in -> include/dmlc/build_config.h
-- Found PythonInterp: C:/rtools40/mingw64/bin/python.exe (found version "3.7.7")
-- Configuring done
-- Generating done
-- Build files have been written to: D:/xgboost/build

构建调用

cmake --build . --target xgboost --config Release

构建错误消息 [长]

Building Custom Rule D:/xgboost/src/CMakeLists.txt
  Compiling CUDA source file ..\..\src\c_api\c_api.cu...
  
  D:\xgboost\build\src>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nvcc.exe" -gencode=arch=compute_86,code=\"sm_86,compute_86\" -gencode=arch=compute_86,code=\"compute_86,compute_86\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" -gencode=arch=compute_80,code=\"compute_80,compute_80\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64" -x cu   -ID:\xgboost\cub -ID:\xgboost\include -I"D:\xgboost\dmlc-core\include" -ID:\xgboost\rabit\include -ID:\xgboost\gputreeshap -I"D:\xgboost\build\dmlc-core\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include"     --keep-dir x64\Release  -maxrregcount=0  --machine 64 --compile -cudart static --expt-extended-lambda --expt-relaxed-constexpr -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 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_MM_PREFETCH_PRESENT=1 -D__USE_XOPEN2K8 -DDMLC_CORE_USE_CMAKE -DDMLC_USE_CXX11=1 -D"CMAKE_INTDIR=\"Release\"" -DWIN32 -D_WINDOWS -DNDEBUG -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -DXGBOOST_USE_CUDA=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_MM_PREFETCH_PRESENT=1 -D__USE_XOPEN2K8 -DDMLC_CORE_USE_CMAKE -DDMLC_USE_CXX11=1 -D"CMAKE_INTDIR=\"Release\"" -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Fdobjxgboost.dir\Release\objxgboost.pdb /FS   /MT /GR" -o objxgboost.dir\Release\/c_api/c_api.cu.obj "D:\xgboost\src\c_api\c_api.cu" 
  c_api.cu
D:\xgboost\src\c_api\c_api_utils.h(154): warning C4244: '=': conversion from 'const xgboost::JsonInteger::Int' to 'float', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
D:\xgboost\src\c_api\c_api_utils.h(156): warning C4244: '=': conversion from 'double' to 'float', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
D:\xgboost\src\data\adapter.h(334): warning C4244: '=': conversion from 'T' to 'xgboost::bst_feature_t', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              T=unsigned __int64
          ]
D:\xgboost\dmlc-core\include\dmlc\./common.h(68): warning C4101: 'ex': unreferenced local variable [D:\xgboost\build\src\objxgboost.vcxproj]
  D:/xgboost/include\xgboost/data.h(303): note: see reference to function template instantiation 'void dmlc::OMPException::Run<xgboost::SparsePage::SortRows::<lambda_535b743d2b2f150a1e5e6e78e95fdde0>,>(Function)' being compiled
          with
          [
              Function=xgboost::SparsePage::SortRows::<lambda_535b743d2b2f150a1e5e6e78e95fdde0>
          ]
D:\xgboost\dmlc-core\include\dmlc\./common.h(73): warning C4101: 'ex': unreferenced local variable [D:\xgboost\build\src\objxgboost.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\numeric(35): warning C4244: '=': conversion from 'unsigned __int64' to '_Ty', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              _Ty=int
          ]
  D:\xgboost\src\c_api\c_api_utils.h(113): note: see reference to function template instantiation '_Ty std::accumulate<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<unsigned __int64>>>,int,std::multiplies<void>>(const _InIt,const _InIt,_Ty,_Fn)' being compiled
          with
          [
              _Ty=int,
              _InIt=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<unsigned __int64>>>,
              _Fn=std::multiplies<void>
          ]
D:/xgboost/src/c_api/c_api.cu(53): warning C4244: 'argument': conversion from 'const xgboost::JsonInteger::Int' to 'uint32_t', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
  D:/xgboost/src/c_api/c_api.cu(78): note: see reference to function template instantiation 'int InplacePreidctCuda<xgboost::data::CudfAdapter>(BoosterHandle,const char *,const char *,std::shared_ptr<_Ty>,const xgboost::bst_ulong **,xgboost::bst_ulong *,const float **)' being compiled
          with
          [
              _Ty=xgboost::DMatrix
          ]
D:/xgboost/src/c_api/c_api.cu(53): warning C4244: 'argument': conversion from 'const xgboost::JsonInteger::Int' to 'uint32_t', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
D:\xgboost\src\data\array_interface.h(394): warning C4244: 'return': conversion from 'double' to 'T', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              T=float
          ]
  D:\xgboost\src\data\array_interface.h(363): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement::<lambda_fbdce57e7edd7bd37f17c2c7aad00455>::operator ()<double>(double *) const' being compiled
          with
          [
              T=float
          ]
  D:\xgboost\src\data\array_interface.h(394): note: see reference to function template instantiation 'T xgboost::ArrayInterface::DispatchCall<xgboost::ArrayInterface::GetElement::<lambda_fbdce57e7edd7bd37f17c2c7aad00455>>(Fn) const' being compiled
          with
          [
              T=float,
              Fn=xgboost::ArrayInterface::GetElement::<lambda_fbdce57e7edd7bd37f17c2c7aad00455>
          ]
  D:\xgboost\src\data\adapter.h(247): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement<float>(size_t,size_t) const' being compiled
          with
          [
              T=float
          ]
D:\xgboost\src\data\array_interface.h(394): warning C4244: 'return': conversion from 'int32_t' to 'T', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              T=float
          ]
  D:\xgboost\src\data\array_interface.h(369): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement::<lambda_fbdce57e7edd7bd37f17c2c7aad00455>::operator ()<int32_t>(int32_t *) const' being compiled
          with
          [
              T=float
          ]
D:\xgboost\src\data\array_interface.h(394): warning C4244: 'return': conversion from 'int64_t' to 'T', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              T=float
          ]
  D:\xgboost\src\data\array_interface.h(371): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement::<lambda_fbdce57e7edd7bd37f17c2c7aad00455>::operator ()<int64_t>(int64_t *) const' being compiled
          with
          [
              T=float
          ]
D:\xgboost\src\data\array_interface.h(394): warning C4244: 'return': conversion from 'uint32_t' to 'T', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              T=float
          ]
  D:\xgboost\src\data\array_interface.h(377): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement::<lambda_fbdce57e7edd7bd37f17c2c7aad00455>::operator ()<uint32_t>(uint32_t *) const' being compiled
          with
          [
              T=float
          ]
D:\xgboost\src\data\array_interface.h(394): warning C4244: 'return': conversion from 'uint64_t' to 'T', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              T=float
          ]
  D:\xgboost\src\data\array_interface.h(379): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement::<lambda_fbdce57e7edd7bd37f17c2c7aad00455>::operator ()<uint64_t>(uint64_t *) const' being compiled
          with
          [
              T=float
          ]
D:\xgboost\src\data\array_interface.h(394): warning C4244: 'return': conversion from 'float' to 'T', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              T=unsigned __int64
          ]
  D:\xgboost\src\data\array_interface.h(361): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement::<lambda_fd7a660ce5371d6a8b921598f3058022>::operator ()<float>(float *) const' being compiled
          with
          [
              T=unsigned __int64
          ]
  D:\xgboost\src\data\array_interface.h(394): note: see reference to function template instantiation 'T xgboost::ArrayInterface::DispatchCall<xgboost::ArrayInterface::GetElement::<lambda_fd7a660ce5371d6a8b921598f3058022>>(Fn) const' being compiled
          with
          [
              T=unsigned __int64,
              Fn=xgboost::ArrayInterface::GetElement::<lambda_fd7a660ce5371d6a8b921598f3058022>
          ]
  D:\xgboost\src\data\adapter.h(300): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement<unsigned __int64>(size_t,size_t) const' being compiled
          with
          [
              T=unsigned __int64
          ]
D:\xgboost\src\data\array_interface.h(394): warning C4244: 'return': conversion from 'double' to 'T', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              T=unsigned __int64
          ]
  D:\xgboost\src\data\array_interface.h(363): note: see reference to function template instantiation 'T xgboost::ArrayInterface::GetElement::<lambda_fd7a660ce5371d6a8b921598f3058022>::operator ()<double>(double *) const' being compiled
          with
          [
              T=unsigned __int64
          ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(2198): error C2694: 'std::_Ref_count_obj2<_Ty>::~_Ref_count_obj2(void)': overriding virtual function has less restrictive exception specification than base class virtual member function 'std::_Ref_count_base::~_Ref_count_base(void) noexcept' [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              _Ty=xgboost::data::CudfAdapter
          ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(2198): note: see declaration of 'std::_Ref_count_obj2<_Ty>::~_Ref_count_obj2'
          with
          [
              _Ty=xgboost::data::CudfAdapter
          ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(1230): note: see declaration of 'std::_Ref_count_base::~_Ref_count_base'
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(2907): note: see reference to class template instantiation 'std::_Ref_count_obj2<_Ty>' being compiled
          with
          [
              _Ty=xgboost::data::CudfAdapter
          ]
  D:/xgboost/src/c_api/c_api.cu(48): note: see reference to function template instantiation 'std::shared_ptr<T> std::make_shared<T,std::string&>(std::string &)' being compiled
          with
          [
              T=xgboost::data::CudfAdapter
          ]
  D:/xgboost/src/c_api/c_api.cu(78): note: see reference to function template instantiation 'int InplacePreidctCuda<xgboost::data::CudfAdapter>(BoosterHandle,const char *,const char *,std::shared_ptr<_Ty>,const xgboost::bst_ulong **,xgboost::bst_ulong *,const float **)' being compiled
          with
          [
              _Ty=xgboost::DMatrix
          ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(2198): error C2694: 'std::_Ref_count_obj2<_Ty>::~_Ref_count_obj2(void)': overriding virtual function has less restrictive exception specification than base class virtual member function 'std::_Ref_count_base::~_Ref_count_base(void) noexcept' [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              _Ty=xgboost::data::CupyAdapter
          ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(2198): note: see declaration of 'std::_Ref_count_obj2<_Ty>::~_Ref_count_obj2'
          with
          [
              _Ty=xgboost::data::CupyAdapter
          ]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(1230): note: see declaration of 'std::_Ref_count_base::~_Ref_count_base'
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(2907): note: see reference to class template instantiation 'std::_Ref_count_obj2<_Ty>' being compiled
          with
          [
              _Ty=xgboost::data::CupyAdapter
          ]
  D:/xgboost/src/c_api/c_api.cu(48): note: see reference to function template instantiation 'std::shared_ptr<T> std::make_shared<T,std::string&>(std::string &)' being compiled
          with
          [
              T=xgboost::data::CupyAdapter
          ]
  D:/xgboost/src/c_api/c_api.cu(90): note: see reference to function template instantiation 'int InplacePreidctCuda<xgboost::data::CupyAdapter>(BoosterHandle,const char *,const char *,std::shared_ptr<_Ty>,const xgboost::bst_ulong **,xgboost::bst_ulong *,const float **)' being compiled
          with
          [
              _Ty=xgboost::DMatrix
          ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.2.targets(785,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nvcc.exe" -gencode=arch=compute_86,code=\"sm_86,compute_86\" -gencode=arch=compute_86,code=\"compute_86,compute_86\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" -gencode=arch=compute_80,code=\"compute_80,compute_80\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64" -x cu   -ID:\xgboost\cub -ID:\xgboost\include -I"D:\xgboost\dmlc-core\include" -ID:\xgboost\rabit\include -ID:\xgboost\gputreeshap -I"D:\xgboost\build\dmlc-core\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include"     --keep-dir x64\Release  -maxrregcount=0  --machine 64 --compile -cudart static --expt-extended-lambda --expt-relaxed-constexpr -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 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_MM_PREFETCH_PRESENT=1 -D__USE_XOPEN2K8 -DDMLC_CORE_USE_CMAKE -DDMLC_USE_CXX11=1 -D"CMAKE_INTDIR=\"Release\"" -DWIN32 -D_WINDOWS -DNDEBUG -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -DXGBOOST_USE_CUDA=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_MM_PREFETCH_PRESENT=1 -D__USE_XOPEN2K8 -DDMLC_CORE_USE_CMAKE -DDMLC_USE_CXX11=1 -D"CMAKE_INTDIR=\"Release\"" -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Fdobjxgboost.dir\Release\objxgboost.pdb /FS   /MT /GR" -o objxgboost.dir\Release\/c_api/c_api.cu.obj "D:\xgboost\src\c_api\c_api.cu"" exited with code 2. [D:\xgboost\build\src\objxgboost.vcxproj]

{snip - 构建持续数千行}

  C:\Users\Parents\AppData\Local\Temp\tmpxft_00005cfc_00000000-7_updater_gpu_hist.compute_80.cudafe1.stub.c(148): note: see reference to function template instantiation 'void xgboost::tree::TreeEvaluator::AddSplit<true>(xgboost::bst_node_t,xgboost::bst_node_t,xgboost::bst_node_t,xgboost::bst_feature_t,float,float)' being compiled
D:\xgboost\cub\cub\agent\../grid/grid_even_share.cuh(133): warning C4244: '=': conversion from 'OffsetT' to 'int', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              OffsetT=__int64
          ]
  D:\xgboost\cub\cub\agent\../grid/grid_even_share.cuh(128): note: while compiling class template member function 'void cub::GridEvenShare<__int64>::DispatchInit(OffsetT,int,int)'
          with
          [
              OffsetT=__int64
          ]
  D:\xgboost\cub\cub\device\dispatch/dispatch_reduce.cuh(481): note: see reference to function template instantiation 'void cub::GridEvenShare<__int64>::DispatchInit(OffsetT,int,int)' being compiled
          with
          [
              OffsetT=__int64
          ]
  C:\Users\Parents\AppData\Local\Temp\tmpxft_00005cfc_00000000-7_updater_gpu_hist.compute_80.cudafe1.stub.c(980): note: see reference to class template instantiation 'cub::GridEvenShare<__int64>' being compiled
D:\xgboost\cub\cub\agent\../grid/grid_even_share.cuh(135): warning C4244: '=': conversion from 'OffsetT' to 'int', possible loss of data [D:\xgboost\build\src\objxgboost.vcxproj]
          with
          [
              OffsetT=__int64
          ]

停在这里。从VS 2019内部运行显示:

5>C:\Users\Parents\AppData\Local\Temp\tmpxft_00003988_00000000-7_gpu_predictor.cudafe1.stub.c(1739): note: see reference to class template instantiation 'cub::GridEvenShare<__int64>' being compiled
5>D:\xgboost\xgboost\cub\cub\agent\../grid/grid_even_share.cuh(135): warning C4244: '=': conversion from 'OffsetT' to 'int', possible loss of data
5>        with
5>        [
5>            OffsetT=__int64
5>        ]
5>Done building project "objxgboost.vcxproj".
6>------ Build started: Project: runxgboost, Configuration: Release x64 ------
6>Building Custom Rule D:/xgboost/xgboost/CMakeLists.txt
6>cli_main.cc
6>D:\xgboost\xgboost\src\c_api/c_api_utils.h(154,33): warning C4244: '=': conversion from 'const xgboost::JsonInteger::Int' to 'float', possible loss of data
6>D:\xgboost\xgboost\src\c_api/c_api_utils.h(156,18): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
6>D:\xgboost\xgboost\dmlc-core\include\dmlc\./common.h(68,27): warning C4101: 'ex': unreferenced local variable
6>D:\xgboost\xgboost\include\xgboost/data.h(303): message : see reference to function template instantiation 'void dmlc::OMPException::Run<xgboost::SparsePage::SortRows::<lambda_e8747da59644e603f3d88bad19a78f88>,>(Function)' being compiled
6>        with
6>        [
6>            Function=xgboost::SparsePage::SortRows::<lambda_e8747da59644e603f3d88bad19a78f88>
6>        ]
6>D:\xgboost\xgboost\dmlc-core\include\dmlc\./common.h(73,30): warning C4101: 'ex': unreferenced local variable
6>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\numeric(35,1): warning C4267: '=': conversion from 'size_t' to '_Ty', possible loss of data
6>        with
6>        [
6>            _Ty=int
6>        ]
6>D:\xgboost\xgboost\src\c_api/c_api_utils.h(115): message : see reference to function template instantiation '_Ty std::accumulate<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<unsigned __int64>>>,int,std::multiplies<void>>(const _InIt,const _InIt,_Ty,_Fn)' being compiled
6>        with
6>        [
6>            _Ty=int,
6>            _InIt=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<size_t>>>,
6>            _Fn=std::multiplies<void>
6>        ]
6>LINK : fatal error LNK1181: cannot open input file 'D:\xgboost\xgboost\build\src\objxgboost.dir\Release\c_api\c_api.cc.obj'
6>Done building project "runxgboost.vcxproj" -- FAILED.
7>------ Build started: Project: xgboost, Configuration: Release x64 ------
7>Building Custom Rule D:/xgboost/xgboost/CMakeLists.txt
7>LINK : fatal error LNK1181: cannot open input file 'D:\xgboost\xgboost\build\src\objxgboost.dir\Release\c_api\c_api.cc.obj'
7>Done building project "xgboost.vcxproj" -- FAILED.
8>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
8>Building Custom Rule D:/xgboost/xgboost/CMakeLists.txt
9>------ Skipped Build: Project: INSTALL, Configuration: Release x64 ------
9>Project not selected to build for this solution configuration 
========== Build: 4 succeeded, 3 failed, 0 up-to-date, 2 skipped ==========

更新

以下片段显示为“退出状态为 2”大错误之前的错误(红色)

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(2198): error C26 94: 'std::_Ref_count_obj2<_Ty>::~_Ref_count_obj2(void)': overriding virtual function has less restrictive exception specification than base class virtual member function 'std::_Ref_count_base::~_Ref_count_base(void) noexcept' [D:\xgboost\build\src\objxgboost.vcxproj]

[snip]

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\memory(2198): error C26 94: 'std::_Ref_count_obj2<_Ty>::~_Ref_count_obj2(void)': overriding virtual function has less restrictive exception specification than base class virtual member function 'std::_Ref_count_base::~_Ref_count_base(void) noexcept' [D:\xgboost\build\src\objxgboost.vcxproj]

标签: compilationwindows-10gpuxgboost

解决方案


推荐阅读