Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] onnxruntime_providers_shared not provided. #19191

Open
Yoloex opened this issue Jan 18, 2024 · 6 comments
Open

[Build] onnxruntime_providers_shared not provided. #19191

Yoloex opened this issue Jan 18, 2024 · 6 comments
Labels
build build issues; typically submitted using template ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform stale issues that have not been addressed in a while; categorized by a bot

Comments

@Yoloex
Copy link

Yoloex commented Jan 18, 2024

Describe the issue

I tried to build onnxruntime with CUDA support.
I'm using CUDA Toolkit 11.8.

But while generating CMake, got the following error.

Urgency

Urgent!!!

Target platform

Windows 10

Build script

build.bat ^
--config Release ^
--parallel 0 ^
--use_cuda ^
--cmake_generator="Visual Studio 17 2022" ^
--minimal_build ^
--enable_reduced_operator_type_support ^
--skip_tests ^
--cuda_home “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8” ^
--cudnn_home “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8” ^
--enable_cuda_line_info ^
--enable_pybind ^
--build_wheel ^
--build_csharp ^
--build_nuget ^
--build_nodejs ^
--build_shared_lib ^
--use_full_protobuf

Error / output

CMake Error at onnxruntime_python.cmake:890 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_python.cmake:890 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_python.cmake:890 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_python.cmake:890 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_providers.cmake:513 (add_dependencies):
  The dependency target "onnxruntime_providers_shared" of target
  "onnxruntime_providers_cuda_obj" does not exist.
Call Stack (most recent call first):
  onnxruntime_providers.cmake:603 (config_cuda_provider_shared_module)
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_providers.cmake:513 (add_dependencies):
  The dependency target "onnxruntime_providers_shared" of target
  "onnxruntime_providers_cuda" does not exist.
Call Stack (most recent call first):
  onnxruntime_providers.cmake:604 (config_cuda_provider_shared_module)
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_providers.cmake:513 (add_dependencies):
  The dependency target "onnxruntime_providers_shared" of target
  "onnxruntime_providers_cuda_ut" does not exist.
Call Stack (most recent call first):
  onnxruntime_unittests.cmake:764 (config_cuda_provider_shared_module)
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_python.cmake:890 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_python.cmake:890 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_python.cmake:890 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1693 (include)


CMake Error at onnxruntime_python.cmake:890 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1693 (include)


-- Generating done (3.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    ONNX_USE_MSVC_STATIC_RUNTIME
    Onnxruntime_GCOV_COVERAGE
    Protobuf_USE_STATIC_LIBS


CMake Generate step failed.  Build files cannot be regenerated correctly.

Visual Studio Version

Visual Studio 17 2022

GCC / Compiler Version

No response

@Yoloex Yoloex added the build build issues; typically submitted using template label Jan 18, 2024
@github-actions github-actions bot added ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform labels Jan 18, 2024
@xadupre
Copy link
Member

xadupre commented Jan 18, 2024

It seems minimal_build and shared_lib are not supported altogether (https://github.com/microsoft/onnxruntime/blob/main/cmake/onnxruntime_providers_cpu.cmake#L220). +@skottmckay

@skottmckay
Copy link
Contributor

Minimal build works fine with a shared library in general as we build that way with the CPU EP, NNAPI, CoreML and XNNPACK EPs depending on the platform/package we're building.

Minimal build however makes no sense with CUDA as the savings from doing a minimal build are tiny in comparison to the size of the CUDA kernels. Given that, we have never looked at enabling the CUDA setup (which builds a separate library for the CUDA EP) with a minimal build and it's not surprising it breaks.

Please remove --minimal_build from your build command.

It is possible to do a reduced operators/types build, but you have to provide a config file listing what should be included. You don't seem to have that, so I'd also suggest removing --enable_reduced_operator_type_support.

@ilya-lavrenov
Copy link
Contributor

I have the same thing when I use cmake -Donnxruntime_USE_OPENVINO=ON -Donnxruntime_ENABLE_PYTHON=ON on macOS:

-- Configuring done (2.0s)
CMake Error at onnxruntime_python.cmake:876 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1722 (include)


CMake Error at onnxruntime_providers_openvino.cmake:44 (add_dependencies):
  The dependency target "onnxruntime_providers_shared" of target
  "onnxruntime_providers_openvino" does not exist.
Call Stack (most recent call first):
  onnxruntime_providers.cmake:144 (include)
  CMakeLists.txt:1722 (include)


CMake Error at onnxruntime_python.cmake:876 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1722 (include)


CMake Error at onnxruntime_python.cmake:876 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_FILE:onnxruntime_providers_shared>

  No target "onnxruntime_providers_shared"
Call Stack (most recent call first):
  CMakeLists.txt:1722 (include)

@Yoloex
Copy link
Author

Yoloex commented Jan 22, 2024

@xadupre
Thanks for your reply.
No target "onnxruntime_providers_shared" This error never showed again but got another problem.
So I tried to build with 1.16.3 release code but got the following error.

2024-01-22 09:46:55,115 util.run [INFO] - Running subprocess in 'D:\project\onnxruntime-1.16.3'
  git submodule sync --recursive
fatal: not a git repository (or any of the parent directories): .git

Could you please provide how to resolve this issue? cc: @skottmckay

@xadupre
Copy link
Member

xadupre commented Jan 22, 2024

The source are provided by default when github publishes a new releases but git dependencies are not included. To build a specific version, you need to clone the reposity and switch to the branch with tag 1.6.3.

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template ep:CUDA issues related to the CUDA execution provider platform:windows issues related to the Windows platform stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

4 participants