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] #16283

Closed
ghost opened this issue Jun 8, 2023 · 10 comments
Closed

[Build] #16283

ghost opened this issue Jun 8, 2023 · 10 comments
Labels
build build issues; typically submitted using template ep:DML issues related to the DirectML execution provider platform:windows issues related to the Windows platform

Comments

@ghost
Copy link

ghost commented Jun 8, 2023

Describe the issue

I am building ONNX Runtime for DirectML EP
I am using this command:
build.bat --config RelWithDebInfo --build_shared_lib --parallel --cmake_generator "Visual Studio 17 2022" --use_dml --build_wheel --skip_tests --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=x86_64

my python is 64 bits
my Windows OS is 64 bits

the generated wheel is named onnxruntime_directml-1.16.0-cp310-cp310-win32.whl
and I get this error when I pip install it:

>pip install C:\data\lavoro\MachineLearning\onnx\test2\onnxruntime\build\Windows\RelWithDebInfo\RelWithDebInfo\dist\onnxruntime_directml-1.16.0-cp310-cp310-win32.whl ERROR: onnxruntime_directml-1.16.0-cp310-cp310-win32.whl is not a supported wheel on this platform.

also tried with the following option
--cmake_extra_defines CMAKE_OSX_ARCHITECTURES=x86_64
but nothing changes

Urgency

yes unfortunately this is urgent

Target platform

Windows 64 bits, Python 3.10 64 bits

Build script

build.bat --config RelWithDebInfo --build_shared_lib --parallel --cmake_generator "Visual Studio 17 2022" --use_dml --build_wheel --skip_tests --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=x86_64

Error / output

ERROR: onnxruntime_directml-1.16.0-cp310-cp310-win32.whl is not a supported wheel on this platform.

Visual Studio Version

Visual Studio 17 2022

GCC / Compiler Version

No response

@ghost ghost added the build build issues; typically submitted using template label Jun 8, 2023
@github-actions github-actions bot added ep:DML issues related to the DirectML execution provider platform:windows issues related to the Windows platform labels Jun 8, 2023
@snnn
Copy link
Member

snnn commented Jun 8, 2023

CMAKE_OSX_ARCHITECTURES is for macOS/iOS/tvOS/... . Do not use it on other platforms. See https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html

@snnn snnn closed this as completed Jun 8, 2023
@snnn
Copy link
Member

snnn commented Jun 8, 2023

If you want a 32-bit Win32 build, please make sure you have installed a 32-bit python and it is the only python in PATH.

@ghost
Copy link
Author

ghost commented Jun 8, 2023 via email

@ghost
Copy link
Author

ghost commented Jun 8, 2023 via email

@snnn
Copy link
Member

snnn commented Jun 8, 2023

If you want a 64-bit Windows build, please make sure you have installed a 64-bit python and it is the only python in PATH.

@ghost
Copy link
Author

ghost commented Jun 8, 2023 via email

@ghost
Copy link
Author

ghost commented Jun 8, 2023 via email

@ghost
Copy link
Author

ghost commented Jun 13, 2023

Hi @snnn
I have double checked: this is the only python in PATH:
and in anaconda I only have 64 bits python:
(base) C:\Users\gguasti>python
Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import struct
print(struct.calcsize("P") * 8)
64

(base) C:\Users\gguasti>wmic os get osarchitecture
OSArchitecture
64-bit

but when I build using the command
build.bat --config RelWithDebInfo --build_shared_lib --parallel --cmake_generator "Visual Studio 17 2022" --use_dml --build_wheel --skip_tests

the generated wheel is named
onnxruntime_directml-1.16.0-cp310-cp310-win32.whl

and if I try to install it using pip I get the error message
ERROR: onnxruntime_directml-1.16.0-cp310-cp310-win32.whl is not a supported wheel on this platform.

I suspect there is a bug. Have you tried to reproduce the issue? how to force the build of a win64 wheel?
thanks

@omasoud
Copy link

omasoud commented Jan 21, 2024

This worked for me.

@lishixlnx
Copy link

omasoud's comment is the only correct answer;

To make it easy, I just test :
setting below 3 variable in shell window will stop the "win32.whl" producing and let "win64.whl" producing.

set Platform=x64
set VSCMD_ARG_HOST_ARCH=x64
set VSCMD_ARG_TGT_ARCH=x64

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:DML issues related to the DirectML execution provider platform:windows issues related to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants