From d94d725b76780ab214581f913110c05f6abc0454 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Thu, 11 Apr 2024 09:22:50 +0200 Subject: [PATCH] VS Integration Files: Auto Should be automatically installed for VS2022: https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/#sample-projects --- .../workflows/dependencies/windows_install_cuda.ps1 | 10 +++++----- .github/workflows/windows.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dependencies/windows_install_cuda.ps1 b/.github/workflows/dependencies/windows_install_cuda.ps1 index 790357b3b27..ba882309638 100644 --- a/.github/workflows/dependencies/windows_install_cuda.ps1 +++ b/.github/workflows/dependencies/windows_install_cuda.ps1 @@ -5,6 +5,9 @@ # License: BSD-3-Clause-LBNL # Authors: Axel Huebl +# fail on first error +$ErrorActionPreference = "Stop" + # skip if already installed if (Test-Path "C:\Program Files\NVIDIA GPU Computing Toolkit\") { exit } @@ -47,7 +50,8 @@ $CudaFeatures = " nvcc_${cuda_version_short} " + ` " nvrtc_dev_${cuda_version_short} " + ` " nvtx_${cuda_version_short} " + ` " sanitizer_${cuda_version_short} " + ` -" thrust_${cuda_version_short} " +" thrust_${cuda_version_short} " + ` +" visual_studio_integration_${cuda_version_short} " $SilentFlag = '-s ' Start-Process -FilePath '.\cuda_install.exe' -ArgumentList @($SilentFlag + $CudaFeatures) -Wait -NoNewWindow @@ -55,10 +59,6 @@ Start-Process -FilePath '.\cuda_install.exe' -ArgumentList @($SilentFlag + $Cuda # cleanup Remove-Item cuda_install.exe -# VisualStudio integration -Copy-item -Force -Recurse -Verbose "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${cuda_version_short}\extras\visual_studio_integration\MSBuildExtensions" -Destination "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\BuildCustomizations" -Copy-item -Force -Recurse -Verbose "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${cuda_version_short}\extras\visual_studio_integration\MSBuildExtensions" -Destination "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations" - # GitHub actions env updates if (Test-Path "env:GITHUB_ACTIONS") { echo "Adding CUDA to CUDA_PATH and PATH" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a4977909db7..ce27f617c3c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -163,7 +163,7 @@ jobs: cmake -S . -B build ^ -A x64 ^ - -DCMAKE_VS_PLATFORM_TOOLSET_CUDA="cuda=12.4" ^ + -DCMAKE_GENERATOR_TOOLSET="cuda=12.4" ^ -DCUDA_TOOLKIT_ROOT_DIR="%CUDA_PATH%" ^ -DCUDAToolkit_ROOT="%CUDA_PATH%" ^ -DCMAKE_BUILD_TYPE=Release ^