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

[Delivery] Win ARM64 wheels + QNN #19162

Open
14 tasks
khmyznikov opened this issue Jan 16, 2024 · 10 comments
Open
14 tasks

[Delivery] Win ARM64 wheels + QNN #19162

khmyznikov opened this issue Jan 16, 2024 · 10 comments
Labels
ep:QNN issues related to QNN exeution provider feature request request for unsupported feature or enhancement platform:windows issues related to the Windows platform

Comments

@khmyznikov
Copy link

khmyznikov commented Jan 16, 2024

Describe the feature request

Creating general issue to track ONNX DX on Windows ARM platform, particularly QNN.

Main problems:

  • Lack of pre-build arm libs/binaries/wheels.

    The necessity of building from source even our own tools create huge obstacles and difficulties for DX. Launching basic SDK demos and examples like this requires a lot of time and mental resources. Days at best, instead of minutes or hours at worse.

  • Necessity to mix/switch x64 and Arm environments to run basic demos.

    This is partially a result of previous problem. Qualcomm SDK and onnxruntime demos for QNN are not arm friendly. Some demos to the point of impossibility of execution on arm machine even with x64 emulation (see lack of AVX instructions emulation).

  • Feels like a development kit rather than a development device.

    Due to the above issues, the DX with Python and ML feels like you are still using an experimental device and requires an additional x64 machine for development. Which is not the case for example for NodeJS/Web development, because everything is cross-platform or arm native already.

Opportunities to improve current state:

Describe scenario use case

The ability to use Windows ARM64 as main machine for ML development, not only as inference target.

@khmyznikov khmyznikov added the feature request request for unsupported feature or enhancement label Jan 16, 2024
@github-actions github-actions bot added the platform:windows issues related to the Windows platform label Jan 16, 2024
@HectorSVC HectorSVC added the ep:QNN issues related to QNN exeution provider label Jan 22, 2024
@jywu-msft
Copy link
Member

Thanks for filing these issues.
QNN EP nightly packages for nuget and python wheels is in progress and should be available shortly. +@adrianlizarraga

@khmyznikov
Copy link
Author

QNN EP nightly packages for nuget and python wheels is in progres

Is the runtime-extensions will be included?

@jywu-msft
Copy link
Member

jywu-msft commented Jan 23, 2024

QNN EP nightly packages for nuget and python wheels is in progres

Is the runtime-extensions will be included?

onnxruntime-extensions is a separate project/package. I see you've already filed an issue at microsoft/onnxruntime-extensions#624
+@wenbingl fyi

@jywu-msft
Copy link
Member

see https://onnxruntime.ai/docs/execution-providers/QNN-ExecutionProvider.html#pre-built-packages for ort-qnn-nightly python package installation instructions

@jywu-msft
Copy link
Member

pip install onnx runs cleanly on Win/ARM devices. with recent ONNX versions (e.g. ONNX 1.15)

@hmartinez82
Copy link

hmartinez82 commented Apr 27, 2024

@jywu not here 😢 I can't for the life of me get it to work.
I'm on a ARM64 Windows 11 machine. It tries to build onnx and some of its deps locally and it always fails.

        randen_slow.cc
        randen_hwaes.cc
        utf8_range.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\utf8_range\Release\utf8_range.lib
        scoped_set_env.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\base\Release\absl_scoped_set_env.lib
      FileTracker : error FTK1011: could not create the new file tracking log file: C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.dir\Release\random_i.C13AF9DB.tlog\Lib-link.read.1.tlog. The system cannot find the path specified. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.vcxproj]



      FileTracker : error FTK1011: could not create the new file tracking log file: C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.dir\Release\random_i.C13AF9DB.tlog\Lib-link.write.1.tlog. The system cannot find the path specified. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.vcxproj]



        random_internal_seed_material.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\Release\absl_random_internal_seed_material.lib
        random_internal_randen_slow.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\Release\absl_random_internal_randen_slow.lib
        usage.cc
        libprotobuf-lite.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\Release\libprotobuf-lite.lib
        flags_usage.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\Release\absl_flags_usage.lib
      C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\flags_parse.vcxproj]
        Building Custom Rule C:/Users/herna/AppData/Local/Temp/pip-install-avijtn3e/onnx_9b6c206d4d2a4980900839fa2d1f9a2e/.setuptools-cmake-build/_deps/abseil-src/absl/flags/CMakeLists.txt
        parse.cc
        flags_parse.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\Release\absl_flags_parse.lib
      Traceback (most recent call last):
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 410, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 395, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 309, in <module>
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
          dist.run_commands()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\normal\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 246, in run
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 225, in run
        File "C:\Program Files\Python311\Lib\subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['C:\\Users\\herna\\AppData\\Local\\Temp\\pip-build-env-w6cyhan5\\overlay\\Scripts\\cmake.EXE', '--build', '.', '--config', 'Release', '--', '/maxcpucount:8']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for onnx
Failed to build onnx
ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects

This is with Python 3.11.9. Which Python version were you using?

@jywu-msft
Copy link
Member

@jywu not here 😢 I can't for the life of me get it to work. I'm on a ARM64 Windows 11 machine. It tries to build onnx and some of its deps locally and it always fails.

        randen_slow.cc
        randen_hwaes.cc
        utf8_range.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\utf8_range\Release\utf8_range.lib
        scoped_set_env.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\base\Release\absl_scoped_set_env.lib
      FileTracker : error FTK1011: could not create the new file tracking log file: C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.dir\Release\random_i.C13AF9DB.tlog\Lib-link.read.1.tlog. The system cannot find the path specified. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.vcxproj]



      FileTracker : error FTK1011: could not create the new file tracking log file: C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.dir\Release\random_i.C13AF9DB.tlog\Lib-link.write.1.tlog. The system cannot find the path specified. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.vcxproj]



        random_internal_seed_material.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\Release\absl_random_internal_seed_material.lib
        random_internal_randen_slow.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\Release\absl_random_internal_randen_slow.lib
        usage.cc
        libprotobuf-lite.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\Release\libprotobuf-lite.lib
        flags_usage.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\Release\absl_flags_usage.lib
      C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\flags_parse.vcxproj]
        Building Custom Rule C:/Users/herna/AppData/Local/Temp/pip-install-avijtn3e/onnx_9b6c206d4d2a4980900839fa2d1f9a2e/.setuptools-cmake-build/_deps/abseil-src/absl/flags/CMakeLists.txt
        parse.cc
        flags_parse.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\Release\absl_flags_parse.lib
      Traceback (most recent call last):
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 410, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 395, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 309, in <module>
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
          dist.run_commands()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\normal\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 246, in run
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 225, in run
        File "C:\Program Files\Python311\Lib\subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['C:\\Users\\herna\\AppData\\Local\\Temp\\pip-build-env-w6cyhan5\\overlay\\Scripts\\cmake.EXE', '--build', '.', '--config', 'Release', '--', '/maxcpucount:8']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for onnx
Failed to build onnx
ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects

This is with Python 3.11.9. Which Python version were you using?

@jywu not here 😢 I can't for the life of me get it to work. I'm on a ARM64 Windows 11 machine. It tries to build onnx and some of its deps locally and it always fails.

        randen_slow.cc
        randen_hwaes.cc
        utf8_range.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\utf8_range\Release\utf8_range.lib
        scoped_set_env.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\base\Release\absl_scoped_set_env.lib
      FileTracker : error FTK1011: could not create the new file tracking log file: C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.dir\Release\random_i.C13AF9DB.tlog\Lib-link.read.1.tlog. The system cannot find the path specified. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.vcxproj]



      FileTracker : error FTK1011: could not create the new file tracking log file: C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.dir\Release\random_i.C13AF9DB.tlog\Lib-link.write.1.tlog. The system cannot find the path specified. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\random_internal_randen_hwaes_impl.vcxproj]



        random_internal_seed_material.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\Release\absl_random_internal_seed_material.lib
        random_internal_randen_slow.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\random\Release\absl_random_internal_randen_slow.lib
        usage.cc
        libprotobuf-lite.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\Release\libprotobuf-lite.lib
        flags_usage.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\Release\absl_flags_usage.lib
      C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\flags_parse.vcxproj]
        Building Custom Rule C:/Users/herna/AppData/Local/Temp/pip-install-avijtn3e/onnx_9b6c206d4d2a4980900839fa2d1f9a2e/.setuptools-cmake-build/_deps/abseil-src/absl/flags/CMakeLists.txt
        parse.cc
        flags_parse.vcxproj -> C:\Users\herna\AppData\Local\Temp\pip-install-avijtn3e\onnx_9b6c206d4d2a4980900839fa2d1f9a2e\.setuptools-cmake-build\_deps\protobuf-build\third_party\abseil-cpp\absl\flags\Release\absl_flags_parse.lib
      Traceback (most recent call last):
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Roaming\Python\Python311-arm64\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 410, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 395, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 309, in <module>
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
          dist.run_commands()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\normal\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 246, in run
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\herna\AppData\Local\Temp\pip-build-env-w6cyhan5\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 225, in run
        File "C:\Program Files\Python311\Lib\subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['C:\\Users\\herna\\AppData\\Local\\Temp\\pip-build-env-w6cyhan5\\overlay\\Scripts\\cmake.EXE', '--build', '.', '--config', 'Release', '--', '/maxcpucount:8']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for onnx
Failed to build onnx
ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects

This is with Python 3.11.9. Which Python version were you using?

you're right. this was previously working. something must have broken with onnx build on arm64. we will need to follow up and report to onnx project

@hmartinez82
Copy link

@jywu I'm not a Python dev.. Do you think that this could be a build issue. For instance, is it possible to try to build it with Ninja instead of MSBuild and see if it works?

@jywu-msft
Copy link
Member

@jywu I'm not a Python dev.. Do you think that this could be a build issue. For instance, is it possible to try to build it with Ninja instead of MSBuild and see if it works?

yes, it's a build issue. the root problem is that onnx project doesn't publish python packages for win/arm64 platform to pypi.
so when you do a pip install on that platform, it tries to build from source. previously the build was succeeding but something is causing it to fail now.
I will file an issue against the onnx project https://github.com/onnx/onnx

@ashumish-QCOM
Copy link

Hi @khmyznikov

Qualcomm NPU (QNN-EP) with ONNX Runtime should be feasible. However, the lack of pre-built ARM64 libraries and binaries can indeed create significant obstacles. Ensuring that your environment paths are correctly set and that you have the necessary dependencies installed is crucial.

For those looking to integrate QNN-EP, make sure to follow the installation instructions provided in the ONNX Runtime documentation. This setup has been effective for other models available from the Qualcomm AI Hub.

Thankyou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:QNN issues related to QNN exeution provider feature request request for unsupported feature or enhancement platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

5 participants