Skip to content

[Build] cannot build with --disable_contrib_ops on Windows CUDA #33602

Open

Description

Describe the issue

Cannot build onnxruntime 1.31.0 for Windows CUDA DLL with contrib ops disabled.

Urgency

No (I've already written a small patch for this)

Target platform

Windows x64 CUDA

Build script

              --compile_no_warning_as_error
              --use_cuda
              --disable_contrib_ops
              --cmake_extra_defines
              onnxruntime_NVCC_THREADS=1
              onnxruntime_USE_FPA_INTB_GEMM=OFF
              onnxruntime_USE_FLASH_ATTENTION=OFF
              onnxruntime_USE_MEMORY_EFFICIENT_ATTENTION=OFF
              onnxruntime_USE_FP8_KV_CACHE=OFF
              onnxruntime_QUICK_BUILD=ON
              CMAKE_CUDA_ARCHITECTURES=75\;80\;90
              onnxruntime_CUDA_FATBIN_COMPRESS_SIZE=ON
              onnxruntime_BUILD_UNIT_TESTS=OFF

https://github.com/sevenc-nanashi/onnxruntime-builder/blob/761430f26ee9393d0a0be26e3958a59b45a00127/.github/workflows/build.yml

Error / output

     Creating library D:/a/onnxruntime-builder/onnxruntime-builder/build/Release/Release/onnxruntime_providers_cuda.lib and object D:/a/onnxruntime-builder/onnxruntime-builder/build/Release/Release/onnxruntime_providers_cuda.exp
decoder_masked_self_attention.obj : error LNK2019: unresolved external symbol "public: class onnxruntime::common::Status __cdecl onnxruntime::contrib::AttentionBase::CheckInputs(class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,struct onnxruntime::Tensor const * &,struct onnxruntime::Tensor const *,struct onnxruntime::Tensor const *,void *,int,struct onnxruntime::Tensor const *)const " (?CheckInputs@AttentionBase@contrib@onnxruntime@@QEBA?AVStatus@common@3@AEBVTensorShape@3@00AEAPEBUTensor@3@PEBU73@2PEAXH2@Z) referenced in function "public: virtual class onnxruntime::common::Status __cdecl onnxruntime::contrib::cuda::DecoderMaskedSelfAttention<float,float>::ComputeInternal(struct onnxruntime::OpKernelContext *)const " (?ComputeInternal@?$DecoderMaskedSelfAttention@MM@cuda@contrib@onnxruntime@@UEBA?AVStatus@common@4@PEAUOpKernelContext@4@@Z) [D:\a\onnxruntime-builder\onnxruntime-builder\build\Release\onnxruntime_providers_cuda.vcxproj]
attention.cc.obj : error LNK2001: unresolved external symbol "public: class onnxruntime::common::Status __cdecl onnxruntime::contrib::AttentionBase::CheckInputs(class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,struct onnxruntime::Tensor const * &,struct onnxruntime::Tensor const *,struct onnxruntime::Tensor const *,void *,int,struct onnxruntime::Tensor const *)const " (?CheckInputs@AttentionBase@contrib@onnxruntime@@QEBA?AVStatus@common@3@AEBVTensorShape@3@00AEAPEBUTensor@3@PEBU73@2PEAXH2@Z) [D:\a\onnxruntime-builder\onnxruntime-builder\build\Release\onnxruntime_providers_cuda.vcxproj]
embed_layer_norm.obj : error LNK2019: unresolved external symbol "class onnxruntime::common::Status __cdecl onnxruntime::contrib::embed_layer_norm::CheckInputs(struct onnxruntime::OpKernelContext const *,bool)" (?CheckInputs@embed_layer_norm@contrib@onnxruntime@@YA?AVStatus@common@3@PEBUOpKernelContext@3@_N@Z) referenced in function "public: virtual class onnxruntime::common::Status __cdecl onnxruntime::contrib::cuda::EmbedLayerNorm<float>::ComputeInternal(struct onnxruntime::OpKernelContext *)const " (?ComputeInternal@?$EmbedLayerNorm@M@cuda@contrib@onnxruntime@@UEBA?AVStatus@common@4@PEAUOpKernelContext@4@@Z) [D:\a\onnxruntime-builder\onnxruntime-builder\build\Release\onnxruntime_providers_cuda.vcxproj]
fast_gelu.obj : error LNK2019: unresolved external symbol "class onnxruntime::common::Status __cdecl onnxruntime::contrib::bias_gelu_helper::CheckInputs(struct onnxruntime::OpKernelContext const *)" (?CheckInputs@bias_gelu_helper@contrib@onnxruntime@@YA?AVStatus@common@3@PEBUOpKernelContext@3@@Z) referenced in function "public: virtual class onnxruntime::common::Status __cdecl onnxruntime::contrib::cuda::FastGelu<float>::ComputeInternal(struct onnxruntime::OpKernelContext *)const " (?ComputeInternal@?$FastGelu@M@cuda@contrib@onnxruntime@@UEBA?AVStatus@common@4@PEAUOpKernelContext@4@@Z) [D:\a\onnxruntime-builder\onnxruntime-builder\build\Release\onnxruntime_providers_cuda.vcxproj]
longformer_attention.obj : error LNK2019: unresolved external symbol "public: class onnxruntime::common::Status __cdecl onnxruntime::contrib::LongformerAttentionBase::CheckInputs(class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &,class onnxruntime::TensorShape const &)const " (?CheckInputs@LongformerAttentionBase@contrib@onnxruntime@@QEBA?AVStatus@common@3@AEBVTensorShape@3@000000@Z) referenced in function "public: virtual class onnxruntime::common::Status __cdecl onnxruntime::contrib::cuda::LongformerAttention<float>::ComputeInternal(struct onnxruntime::OpKernelContext *)const " (?ComputeInternal@?$LongformerAttention@M@cuda@contrib@onnxruntime@@UEBA?AVStatus@common@4@PEAUOpKernelContext@4@@Z) [D:\a\onnxruntime-builder\onnxruntime-builder\build\Release\onnxruntime_providers_cuda.vcxproj]
D:\a\onnxruntime-builder\onnxruntime-builder\build\Release\Release\onnxruntime_providers_cuda.dll : fatal error LNK1120: 4 unresolved externals [D:\a\onnxruntime-builder\onnxruntime-builder\build\Release\onnxruntime_providers_cuda.vcxproj]
Traceback (most recent call last):

Full build log available here: https://github.com/sevenc-nanashi/onnxruntime-builder/actions/runs/40238574652/job/121305323045#step:26:15077

Visual Studio Version

2022

GCC / Compiler Version

19.44.35229.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buildbuild issues; typically submitted using templateep:CUDAissues related to the CUDA execution providerplatform:windowsissues related to the Windows platform

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions