Skip to content

Commit 8c5eea5

Browse files
committed
fix: add installation of Visual Studio Build Tools components in Windows CUDA workflow
1 parent 6e96bd5 commit 8c5eea5

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/build-extended-artifacts.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ jobs:
9898
run: |
9999
choco install cuda --version=12.2.0.53625 --no-progress -y --params '"/NoDriver"'
100100
101+
- name: Install Visual Studio Build Tools components
102+
shell: pwsh
103+
run: |
104+
choco install visualstudio2022buildtools --no-progress -y --installargs '--add Microsoft.VisualStudio.Workload.VCTools --quiet --norestart'
105+
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify --installPath "C:\Program Files\Microsoft Visual Studio\2022\BuildTools" --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --passive --norestart
106+
$clRoot = "C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC"
107+
if (-not (Test-Path $clRoot)) { throw "MSVC toolchain not found after installation" }
108+
$vcVersion = Get-ChildItem $clRoot | Sort-Object Name -Descending | Select-Object -First 1
109+
if (-not $vcVersion) { throw "Unable to locate installed MSVC version" }
110+
$binDir = Join-Path $vcVersion.FullName "bin\Hostx64\x64"
111+
Add-Content $env:GITHUB_PATH $binDir
112+
Add-Content $env:GITHUB_ENV "VCToolsInstallDir=$($vcVersion.FullName)"
113+
101114
- name: Configure CUDA environment
102115
shell: pwsh
103116
run: |

0 commit comments

Comments
 (0)