Skip to content

Commit ad7b0e3

Browse files
authored
[build] disable vcpkg for Dawn temporarily (#24838)
### Description <!-- Describe your changes. --> ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
1 parent cd2502a commit ad7b0e3

9 files changed

+57
-10
lines changed

.github/workflows/macos-ci-build-and-test-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
--build_objc
5252
--build_java
5353
--build_wheel
54-
${{ inputs.use_webgpu && '--use_webgpu --cmake_extra_defines onnxruntime_BUILD_DAWN_MONOLITHIC_LIBRARY=ON' || '' }}
54+
${{ inputs.use_webgpu && '--use_webgpu' || '' }}
5555
${{ inputs.use_xnnpack && '--use_xnnpack' || '' }}
5656
${{ inputs.use_coreml && '--use_coreml' || '' }}
5757
--use_vcpkg --use_vcpkg_ms_internal_asset_cache

cmake/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,11 @@ if (onnxruntime_USE_WEBGPU)
10671067
list(APPEND ORT_PROVIDER_FLAGS -DUSE_WEBGPU=1)
10681068
list(APPEND ONNXRUNTIME_PROVIDER_NAMES webgpu)
10691069

1070-
if (onnxruntime_USE_VCPKG AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
1070+
# TODO: the following code is used to disable building Dawn using vcpkg temporarily
1071+
# until we figure out how to resolve the packaging pipeline failures
1072+
#
1073+
# if (onnxruntime_USE_VCPKG AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
1074+
if (FALSE)
10711075
if (NOT onnxruntime_BUILD_DAWN_MONOLITHIC_LIBRARY)
10721076
message(FATAL_ERROR "onnxruntime_USE_VCPKG is not supported with onnxruntime_BUILD_DAWN_MONOLITHIC_LIBRARY=OFF")
10731077
endif()

cmake/external/onnxruntime_external_deps.cmake

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,11 @@ endif()
625625

626626

627627
if (onnxruntime_USE_WEBGPU)
628-
if (onnxruntime_USE_VCPKG AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
628+
# TODO: the following code is used to disable building Dawn using vcpkg temporarily
629+
# until we figure out how to resolve the packaging pipeline failures
630+
#
631+
# if (onnxruntime_USE_VCPKG AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
632+
if (FALSE)
629633
# vcpkg does not support Emscripten yet
630634
find_package(dawn REQUIRED)
631635
else()
@@ -739,7 +743,13 @@ if (onnxruntime_USE_WEBGPU)
739743
# - (private) Force enable f16 support for NVIDIA Vulkan
740744
# Dawn disabled f16 support for NVIDIA Vulkan by default because of crashes in f16 CTS tests (crbug.com/tint/2164).
741745
# Since the crashes are limited to specific GPU models, we patched Dawn to remove the restriction.
742-
${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/dawn/dawn_force_enable_f16_nvidia_vulkan.patch)
746+
${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/dawn/dawn_force_enable_f16_nvidia_vulkan.patch &&
747+
748+
# The dawn_fix_copy_dxil_dll.patch contains the following changes:
749+
#
750+
# - (private) Fix copy of dxil.dll in Dawn
751+
# The patch ensures the copy of dxil.dll to be done after the build step of `dxcompiler` target.
752+
${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/dawn/dawn_fix_copy_dxil_dll.patch)
743753

744754
onnxruntime_fetchcontent_declare(
745755
dawn

cmake/onnxruntime_java.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ if (WIN32)
177177
endif()
178178
if (onnxruntime_USE_WEBGPU)
179179
if (onnxruntime_ENABLE_DAWN_BACKEND_D3D12)
180-
if (onnxruntime_USE_VCPKG)
180+
# TODO: the following code is used to disable building Dawn using vcpkg temporarily
181+
# until we figure out how to resolve the packaging pipeline failures
182+
#
183+
# if (onnxruntime_USE_VCPKG)
184+
if (FALSE)
181185
add_custom_command(
182186
TARGET onnxruntime4j_jni POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
183187
$<TARGET_FILE:Microsoft::DXIL>

cmake/onnxruntime_nodejs.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ endif()
7474
if (onnxruntime_USE_WEBGPU)
7575
set(NODEJS_BINDING_USE_WEBGPU "--use_webgpu")
7676
if (WIN32 AND onnxruntime_ENABLE_DAWN_BACKEND_D3D12)
77-
if (onnxruntime_USE_VCPKG)
77+
# TODO: the following code is used to disable building Dawn using vcpkg temporarily
78+
# until we figure out how to resolve the packaging pipeline failures
79+
#
80+
# if (onnxruntime_USE_VCPKG)
81+
if (FALSE)
7882
list(APPEND NODEJS_DLL_DEPS "$<TARGET_FILE:Microsoft::DXIL>")
7983
list(APPEND NODEJS_DLL_DEPS "$<TARGET_FILE:Microsoft::DirectXShaderCompiler>")
8084
else()

cmake/onnxruntime_providers_webgpu.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@
5959
list(APPEND onnxruntime_DELAYLOAD_FLAGS "/DELAYLOAD:webgpu_dawn.dll")
6060
endif()
6161

62-
if (onnxruntime_USE_VCPKG)
62+
# TODO: the following code is used to disable building Dawn using vcpkg temporarily
63+
# until we figure out how to resolve the packaging pipeline failures
64+
#
65+
# if (onnxruntime_USE_VCPKG)
66+
if (FALSE)
6367
# Fix Dawn vcpkg build issue (missing IMPORTED_IMPLIB and IMPORTED_LOCATION for target dawn::webgpu_dawn)
6468
get_target_property(webgpu_dawn_target_IMPORTED_IMPLIB dawn::webgpu_dawn IMPORTED_IMPLIB)
6569
if (NOT webgpu_dawn_target_IMPORTED_IMPLIB)
@@ -82,7 +86,11 @@
8286

8387
if (WIN32 AND onnxruntime_ENABLE_DAWN_BACKEND_D3D12)
8488
# Ensure dxil.dll and dxcompiler.dll exist in the output directory $<TARGET_FILE_DIR:dxcompiler>
85-
if (onnxruntime_USE_VCPKG)
89+
# TODO: the following code is used to disable building Dawn using vcpkg temporarily
90+
# until we figure out how to resolve the packaging pipeline failures
91+
#
92+
# if (onnxruntime_USE_VCPKG)
93+
if (FALSE)
8694
find_package(directx-dxc CONFIG REQUIRED)
8795
target_link_libraries(onnxruntime_providers_webgpu Microsoft::DirectXShaderCompiler)
8896
target_link_libraries(onnxruntime_providers_webgpu Microsoft::DXIL)

cmake/onnxruntime_python.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,11 @@ endif()
10751075

10761076
if (onnxruntime_USE_WEBGPU)
10771077
if (WIN32 AND onnxruntime_ENABLE_DAWN_BACKEND_D3D12)
1078-
if (onnxruntime_USE_VCPKG)
1078+
# TODO: the following code is used to disable building Dawn using vcpkg temporarily
1079+
# until we figure out how to resolve the packaging pipeline failures
1080+
#
1081+
# if (onnxruntime_USE_VCPKG)
1082+
if (FALSE)
10791083
add_custom_command(
10801084
TARGET onnxruntime_pybind11_state POST_BUILD
10811085
COMMAND ${CMAKE_COMMAND} -E copy
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
2+
index cdfde38819..fc5ff76421 100644
3+
--- a/third_party/CMakeLists.txt
4+
+++ b/third_party/CMakeLists.txt
5+
@@ -352,6 +352,8 @@ function(AddSubdirectoryDXC)
6+
TARGET copy_dxil_dll
7+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DXIL_DLL_PATH} $<TARGET_FILE_DIR:dxcompiler>
8+
COMMENT "Copying ${DXIL_DLL_PATH} to $<TARGET_FILE_DIR:dxcompiler>")
9+
+ # Ensure folder "$<TARGET_FILE_DIR:dxcompiler>" exists when copying the dll
10+
+ add_dependencies(copy_dxil_dll dxcompiler)
11+
# Make dxc target depend on copy_dxil_dll
12+
add_dependencies(dxc copy_dxil_dll)
13+
endif()

cmake/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
},
9494
"webgpu-ep": {
9595
"description": "Build with WebGPU EP",
96-
"dependencies": [{ "name": "dawn", "platform": "!emscripten" }]
96+
"dependencies": []
9797
}
9898
},
9999
"overrides": [

0 commit comments

Comments
 (0)