Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Windows link failures in Debug mode #17633

@larroy

Description

@larroy

Description

Some template functions need to be defined in the compilation unit, right now can't build in debug mode and thus fix issues with GPU builds in windows.

[473/482] Linking CXX shared library mxnet_52.dll
FAILED: mxnet_52.dll mxnet_52.lib
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=CMakeFiles\mxnet_52.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100162~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100162~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1
413~1.261\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\mxnet_52.rsp  /out:mxnet_52.dll /implib:mxnet_52.lib /pdb:mxnet_52.pdb /dll /version:0.0 /machine:x64  /debug /INCREMENTAL   && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1413~1.261\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\mxnet_52.rsp /out:mxnet_52.dll /implib:mxnet_52.lib /pdb:mxnet_52.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL /MANIFEST /MANIFESTFILE:CMakeFiles\
mxnet_52.dir/intermediate.manifest CMakeFiles\mxnet_52.dir/manifest.res" failed (exit code 1120) with the following output:
   Creating library mxnet_52.lib and object mxnet_52.exp
image_random.cc.obj : error LNK2019: unresolved external symbol "void __cdecl mxnet::op::image::ToTensorImplCUDA<class mshadow::bfloat::bf16_t,struct mshadow::Tensor<struct mshadow::gpu,3,class mshadow::bfloat::bf16_t>,struct mshadow::Tensor<struct mshadow::gpu,3,float> >(struct msh
adow::Stream<struct mshadow::gpu> *,struct mshadow::Tensor<struct mshadow::gpu,3,class mshadow::bfloat::bf16_t>,struct mshadow::Tensor<struct mshadow::gpu,3,float>,int,float)" (??$ToTensorImplCUDA@Vbf16_t@bfloat@mshadow@@U?$Tensor@Ugpu@mshadow@@$02Vbf16_t@bfloat@2@@3@U?$Tensor@Ugpu@
mshadow@@$02M@3@@image@op@mxnet@@YAXPEAU?$Stream@Ugpu@mshadow@@@mshadow@@U?$Tensor@Ugpu@mshadow@@$02Vbf16_t@bfloat@2@@4@U?$Tensor@Ugpu@mshadow@@$02M@4@HM@Z) referenced in function "void __cdecl mxnet::op::image::ToTensorOpForward<struct mshadow::cpu>(struct nnvm::NodeAttrs const &,s
truct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const &,class std::vector<enum mxnet::OpReqType,class std::allocator<enum mxnet::OpReqType> > const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet:
:TBlob> > const &)" (??$ToTensorOpForward@Ucpu@mshadow@@@image@op@mxnet@@YAXAEBUNodeAttrs@nnvm@@AEBUOpContext@2@AEBV?$vector@VTBlob@mxnet@@V?$allocator@VTBlob@mxnet@@@std@@@std@@AEBV?$vector@W4OpReqType@mxnet@@V?$allocator@W4OpReqType@mxnet@@@std@@@7@2@Z)
image_random.cc.obj : error LNK2019: unresolved external symbol "void __cdecl mxnet::op::image::ToTensorImplCUDA<class mshadow::bfloat::bf16_t,struct mshadow::Tensor<struct mshadow::gpu,4,class mshadow::bfloat::bf16_t>,struct mshadow::Tensor<struct mshadow::gpu,4,float> >(struct msh
adow::Stream<struct mshadow::gpu> *,struct mshadow::Tensor<struct mshadow::gpu,4,class mshadow::bfloat::bf16_t>,struct mshadow::Tensor<struct mshadow::gpu,4,float>,int,float)" (??$ToTensorImplCUDA@Vbf16_t@bfloat@mshadow@@U?$Tensor@Ugpu@mshadow@@$03Vbf16_t@bfloat@2@@3@U?$Tensor@Ugpu@
mshadow@@$03M@3@@image@op@mxnet@@YAXPEAU?$Stream@Ugpu@mshadow@@@mshadow@@U?$Tensor@Ugpu@mshadow@@$03Vbf16_t@bfloat@2@@4@U?$Tensor@Ugpu@mshadow@@$03M@4@HM@Z) referenced in function "void __cdecl mxnet::op::image::ToTensorOpForward<struct mshadow::cpu>(struct nnvm::NodeAttrs const &,s
truct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const &,class std::vector<enum mxnet::OpReqType,class std::allocator<enum mxnet::OpReqType> > const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet:
:TBlob> > const &)" (??$ToTensorOpForward@Ucpu@mshadow@@@image@op@mxnet@@YAXAEBUNodeAttrs@nnvm@@AEBUOpContext@2@AEBV?$vector@VTBlob@mxnet@@V?$allocator@VTBlob@mxnet@@@std@@@std@@AEBV?$vector@W4OpReqType@mxnet@@V?$allocator@W4OpReqType@mxnet@@@std@@@7@2@Z)
image_random.cc.obj : error LNK2019: unresolved external symbol "void __cdecl mxnet::op::image::NormalizeImplCUDA<class mshadow::bfloat::bf16_t>(struct mshadow::Stream<struct mshadow::gpu> *,class mshadow::bfloat::bf16_t const *,class mshadow::bfloat::bf16_t *,int,int,int,int,int,fl
oat,float,float,float,float,float)" (??$NormalizeImplCUDA@Vbf16_t@bfloat@mshadow@@@image@op@mxnet@@YAXPEAU?$Stream@Ugpu@mshadow@@@mshadow@@PEBVbf16_t@bfloat@4@PEAV564@HHHHHMMMMMM@Z) referenced in function "void __cdecl mxnet::op::image::NormalizeOpForward<struct mshadow::cpu>(struct
 nnvm::NodeAttrs const &,struct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const &,class std::vector<enum mxnet::OpReqType,class std::allocator<enum mxnet::OpReqType> > const &,class std::vector<class mxnet::TBlob,class s
td::allocator<class mxnet::TBlob> > const &)" (??$NormalizeOpForward@Ucpu@mshadow@@@image@op@mxnet@@YAXAEBUNodeAttrs@nnvm@@AEBUOpContext@2@AEBV?$vector@VTBlob@mxnet@@V?$allocator@VTBlob@mxnet@@@std@@@std@@AEBV?$vector@W4OpReqType@mxnet@@V?$allocator@W4OpReqType@mxnet@@@std@@@7@2@Z)
image_random.cc.obj : error LNK2019: unresolved external symbol "void __cdecl mxnet::op::image::NormalizeBackwardImplCUDA<class mshadow::bfloat::bf16_t>(struct mshadow::Stream<struct mshadow::gpu> *,class mshadow::bfloat::bf16_t const *,class mshadow::bfloat::bf16_t *,int,int,int,in
t,int,float,float,float)" (??$NormalizeBackwardImplCUDA@Vbf16_t@bfloat@mshadow@@@image@op@mxnet@@YAXPEAU?$Stream@Ugpu@mshadow@@@mshadow@@PEBVbf16_t@bfloat@4@PEAV564@HHHHHMMM@Z) referenced in function "void __cdecl mxnet::op::image::NormalizeOpBackward<struct mshadow::cpu>(struct nnv
m::NodeAttrs const &,struct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const &,class std::vector<enum mxnet::OpReqType,class std::allocator<enum mxnet::OpReqType> > const &,class std::vector<class mxnet::TBlob,class std::
allocator<class mxnet::TBlob> > const &)" (??$NormalizeOpBackward@Ucpu@mshadow@@@image@op@mxnet@@YAXAEBUNodeAttrs@nnvm@@AEBUOpContext@2@AEBV?$vector@VTBlob@mxnet@@V?$allocator@VTBlob@mxnet@@@std@@@std@@AEBV?$vector@W4OpReqType@mxnet@@V?$allocator@W4OpReqType@mxnet@@@std@@@7@2@Z)
resize.cc.obj : error LNK2019: unresolved external symbol "void __cdecl mxnet::op::image::ResizeImplCUDA<class mshadow::bfloat::bf16_t,struct mshadow::Tensor<struct mshadow::gpu,3,class mshadow::bfloat::bf16_t>,float>(struct mshadow::Stream<struct mshadow::gpu> *,struct mshadow::Ten
sor<struct mshadow::gpu,3,class mshadow::bfloat::bf16_t>,struct mshadow::Tensor<struct mshadow::gpu,3,class mshadow::bfloat::bf16_t>)" (??$ResizeImplCUDA@Vbf16_t@bfloat@mshadow@@U?$Tensor@Ugpu@mshadow@@$02Vbf16_t@bfloat@2@@3@M@image@op@mxnet@@YAXPEAU?$Stream@Ugpu@mshadow@@@mshadow@@
U?$Tensor@Ugpu@mshadow@@$02Vbf16_t@bfloat@2@@4@1@Z) referenced in function "void __cdecl mxnet::op::image::Resize<struct mshadow::cpu>(struct nnvm::NodeAttrs const &,struct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const
 &,class std::vector<enum mxnet::OpReqType,class std::allocator<enum mxnet::OpReqType> > const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const &)" (??$Resize@Ucpu@mshadow@@@image@op@mxnet@@YAXAEBUNodeAttrs@nnvm@@AEBUOpContext@2@AEBV?$vector@VT
Blob@mxnet@@V?$allocator@VTBlob@mxnet@@@std@@@std@@AEBV?$vector@W4OpReqType@mxnet@@V?$allocator@W4OpReqType@mxnet@@@std@@@7@2@Z)
resize.cc.obj : error LNK2019: unresolved external symbol "void __cdecl mxnet::op::image::ResizeImplCUDA<class mshadow::bfloat::bf16_t,struct mshadow::Tensor<struct mshadow::gpu,4,class mshadow::bfloat::bf16_t>,float>(struct mshadow::Stream<struct mshadow::gpu> *,struct mshadow::Ten
sor<struct mshadow::gpu,4,class mshadow::bfloat::bf16_t>,struct mshadow::Tensor<struct mshadow::gpu,4,class mshadow::bfloat::bf16_t>)" (??$ResizeImplCUDA@Vbf16_t@bfloat@mshadow@@U?$Tensor@Ugpu@mshadow@@$03Vbf16_t@bfloat@2@@3@M@image@op@mxnet@@YAXPEAU?$Stream@Ugpu@mshadow@@@mshadow@@
U?$Tensor@Ugpu@mshadow@@$03Vbf16_t@bfloat@2@@4@1@Z) referenced in function "void __cdecl mxnet::op::image::Resize<struct mshadow::cpu>(struct nnvm::NodeAttrs const &,struct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const
 &,class std::vector<enum mxnet::OpReqType,class std::allocator<enum mxnet::OpReqType> > const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const &)" (??$Resize@Ucpu@mshadow@@@image@op@mxnet@@YAXAEBUNodeAttrs@nnvm@@AEBUOpContext@2@AEBV?$vector@VT
Blob@mxnet@@V?$allocator@VTBlob@mxnet@@@std@@@std@@AEBV?$vector@W4OpReqType@mxnet@@V?$allocator@W4OpReqType@mxnet@@@std@@@7@2@Z)
np_multinomial_op.cc.obj : error LNK2019: unresolved external symbol "void __cdecl mxnet::op::CheckPvalGPU<class mshadow::bfloat::bf16_t>(struct mxnet::OpContext const &,class mshadow::bfloat::bf16_t *,int)" (??$CheckPvalGPU@Vbf16_t@bfloat@mshadow@@@op@mxnet@@YAXAEBUOpContext@1@PEAV
bf16_t@bfloat@mshadow@@H@Z) referenced in function "void __cdecl mxnet::op::NumpyMultinomialForward<struct mshadow::cpu>(struct nnvm::NodeAttrs const &,struct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const &,class std::
vector<enum mxnet::OpReqType,class std::allocator<enum mxnet::OpReqType> > const &,class std::vector<class mxnet::TBlob,class std::allocator<class mxnet::TBlob> > const &)" (??$NumpyMultinomialForward@Ucpu@mshadow@@@op@mxnet@@YAXAEBUNodeAttrs@nnvm@@AEBUOpContext@1@AEBV?$vector@VTBlo
b@mxnet@@V?$allocator@VTBlob@mxnet@@@std@@@std@@AEBV?$vector@W4OpReqType@mxnet@@V?$allocator@W4OpReqType@mxnet@@@std@@@6@2@Z)
mxnet_52.dll : fatal error LNK1120: 7 unresolved externals
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "C:\Users\Administrator\mxnet\ci\build_windows.py", line 288, in <module>
    sys.exit(main())
  File "C:\Users\Administrator\mxnet\ci\build_windows.py", line 276, in main
    windows_build(args)
  File "C:\Users\Administrator\mxnet\ci\build_windows.py", line 191, in windows_build
    check_call(cmd, shell=True)
  File "C:\Python37\lib\subprocess.py", line 328, in check_call

Error Message

(Paste the complete error message. Please also include stack trace by setting environment variable DMLC_LOG_STACK_TRACE_DEPTH=10 before running your script.)

To Reproduce

(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)

Steps to reproduce

(Paste the commands you ran that produced the error.)

Add CMAKE_BUILD_TYPE=Debug in build_windows.py and build -f WIN_GPU

What have you tried to solve it?

Removed the offending operators and was able to compile successfully.

Environment

We recommend using our script for collecting the diagnositc information. Run the following command and paste the outputs below:

curl --retry 10 -s https://raw.githubusercontent.com/dmlc/gluon-nlp/master/tools/diagnose.py | python

# paste outputs here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions