Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .ci/scripts/setup-windows.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
param (
[string]$editable = "false"
[string]$editable = "false",
[string]$cpuOnly = "false"
)

conda create --yes --quiet -n et python=3.12
Expand All @@ -13,6 +14,16 @@ conda activate et
# Install test dependencies
pip install -r .ci/docker/requirements-ci.txt

# The Windows CI image ships CUDA toolkits on PATH, so install_executorch
# (setup.py) auto-enables EXECUTORCH_BUILD_CUDA whenever the detected nvcc
# version is in SUPPORTED_CUDA_VERSIONS. CPU-only jobs install CPU torch, so a
# CUDA build of _portable_lib then fails to load its CUDA DLLs at import time
# ("DLL load failed while importing _portable_lib"). Force a CPU-only build
# when the caller asks for it.
if ($cpuOnly -eq 'true') {
$env:CMAKE_ARGS = "$env:CMAKE_ARGS -DEXECUTORCH_BUILD_CUDA=OFF"
}

if ($editable -eq 'true') {
install_executorch.bat --editable
} else {
Expand Down
9 changes: 9 additions & 0 deletions .ci/scripts/wheel/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ if [[ $UNAME_S == *"MINGW"* || $UNAME_S == *"MSYS"* ]]; then
echo "Enabling symlinks on Windows"
git config core.symlinks true
git checkout -f HEAD

# Windows wheels are CPU-only (build-wheels-windows.yml sets
# with-cuda: disabled), but the Windows CI image ships a CUDA toolkit on
# PATH, which makes setup.py auto-enable EXECUTORCH_BUILD_CUDA. That bakes a
# CUDA _portable_lib into the CPU wheel, which then fails its DLL load in the
# smoke test ("DLL load failed while importing _portable_lib"). Force a
# CPU-only build.
export CMAKE_ARGS="${CMAKE_ARGS:-} -DEXECUTORCH_BUILD_CUDA=OFF"
echo "CMAKE_ARGS=${CMAKE_ARGS}" >> "${GITHUB_ENV}"
fi

# Manually install build requirements because `python setup.py bdist_wheel` does
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true

.ci/scripts/setup-windows.ps1 -editable "${{ inputs.editable }}"
.ci/scripts/setup-windows.ps1 -editable "${{ inputs.editable }}" -cpuOnly true
if (\$LASTEXITCODE -ne 0) {
Write-Host "Setup failed. Exit code: \$LASTEXITCODE."
exit \$LASTEXITCODE
Expand Down
Loading