Patch Tuesday June 2024 (#39325)

This commit is contained in:
Billy O'Neal 2024-07-03 20:01:35 -07:00 committed by GitHub
parent 2444315f12
commit 0dab813d5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 572 additions and 927 deletions

View File

@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a48eaf4e2..7b8bc7cb6e 100644
index 3a48eaf..7b8bc7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1049,8 +1049,7 @@ if(USE_MIMALLOC)
@ -13,7 +13,7 @@ index 3a48eaf4e2..7b8bc7cb6e 100644
# ---[ Main build
diff --git a/aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt b/aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt
index fd6b7ff551..d185233529 100644
index fd6b7ff..d185233 100644
--- a/aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt
+++ b/aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt
@@ -368,7 +368,7 @@ elseif(NOT TARGET pthreadpool AND USE_SYSTEM_PTHREADPOOL)
@ -26,7 +26,7 @@ index fd6b7ff551..d185233529 100644
IMPORTED_LOCATION "${PTHREADPOOL_LIBRARY}")
add_library(pthreadpool_interface INTERFACE)
diff --git a/c10/CMakeLists.txt b/c10/CMakeLists.txt
index feebad7cbb..ad407e18cb 100644
index feebad7..ad407e1 100644
--- a/c10/CMakeLists.txt
+++ b/c10/CMakeLists.txt
@@ -109,8 +109,7 @@ else()
@ -40,7 +40,7 @@ index feebad7cbb..ad407e18cb 100644
if(ANDROID)
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index c3abce52e4..cd27c728ff 100644
index c3abce5..cfaf83e 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -285,7 +285,7 @@ endif()
@ -129,7 +129,7 @@ index c3abce52e4..cd27c728ff 100644
endif()
endif()
- add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+
+
+ # setup foxi
+ find_library(FOXI_LOADER_LIBPATH NAMES foxi_loader REQUIRED)
+ list(APPEND Caffe2_DEPENDENCY_LIBS "${FOXI_LOADER_LIBPATH}")
@ -184,7 +184,7 @@ index c3abce52e4..cd27c728ff 100644
list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
diff --git a/cmake/Modules/FindLMDB.cmake b/cmake/Modules/FindLMDB.cmake
index 2f0adb1b6d..8a817fd6f1 100644
index 2f0adb1..8a817fd 100644
--- a/cmake/Modules/FindLMDB.cmake
+++ b/cmake/Modules/FindLMDB.cmake
@@ -12,12 +12,8 @@
@ -203,7 +203,7 @@ index 2f0adb1b6d..8a817fd6f1 100644
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LMDB DEFAULT_MSG LMDB_INCLUDE_DIR LMDB_LIBRARIES)
diff --git a/cmake/public/cuda.cmake b/cmake/public/cuda.cmake
index 32f3ba375b..411293794f 100644
index 32f3ba3..4112937 100644
--- a/cmake/public/cuda.cmake
+++ b/cmake/public/cuda.cmake
@@ -67,8 +67,8 @@ if(NOT CMAKE_CUDA_COMPILER_VERSION STREQUAL CUDAToolkit_VERSION OR
@ -218,7 +218,7 @@ index 32f3ba375b..411293794f 100644
message(STATUS "Caffe2: CUDA detected: " ${CUDA_VERSION})
diff --git a/cmake/public/utils.cmake b/cmake/public/utils.cmake
index 4d48c0f0f3..ebdd39a7fd 100644
index 4d48c0f..ebdd39a 100644
--- a/cmake/public/utils.cmake
+++ b/cmake/public/utils.cmake
@@ -185,9 +185,9 @@ endfunction()

View File

@ -1,61 +1,63 @@
diff --git a/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake b/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
index 9293df3..11bc4bf 100644
--- a/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
+++ b/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
@@ -126,11 +126,11 @@ list(APPEND CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS_${build_configuration}})
# Any -ccbin existing in CUDA_NVCC_FLAGS gets highest priority
list( FIND CUDA_NVCC_FLAGS "-ccbin" ccbin_found0 )
list( FIND CUDA_NVCC_FLAGS "--compiler-bindir" ccbin_found1 )
-if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
+if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER AND 0)
if (CUDA_HOST_COMPILER STREQUAL "@_CUDA_MSVC_HOST_COMPILER@" AND DEFINED CCBIN)
- set(CCBIN -ccbin "${CCBIN}")
+ #set(CCBIN -ccbin "${CCBIN}")
else()
- set(CCBIN -ccbin "${CUDA_HOST_COMPILER}")
+ #set(CCBIN -ccbin "${CUDA_HOST_COMPILER}")
endif()
endif()
diff --git a/cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake b/cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake
index d917738..8f832fe 100644
--- a/cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake
+++ b/cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake
@@ -30,7 +30,7 @@ endif()
set(CUDA_KNOWN_GPU_ARCHITECTURES "Kepler" "Maxwell")
# This list will be used for CUDA_ARCH_NAME = Common option (enabled by default)
-set(CUDA_COMMON_GPU_ARCHITECTURES "3.5" "5.0")
+# set(CUDA_COMMON_GPU_ARCHITECTURES "3.5" "5.0")
# This list is used to filter CUDA archs when autodetecting
set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0")
diff --git a/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake b/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake
index 420ee63..f029b66 100644
--- a/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake
+++ b/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake
@@ -1694,9 +1694,9 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
# Match VERBATIM check below.
if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)")
- list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
+ #list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
else()
- list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}")
+ #list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}")
endif()
endif()
diff --git a/cmake/public/cuda.cmake b/cmake/public/cuda.cmake
index 4112937..3e1af83 100644
--- a/cmake/public/cuda.cmake
+++ b/cmake/public/cuda.cmake
@@ -42,7 +42,7 @@ set(CUDAToolkit_ROOT "${CUDA_TOOLKIT_ROOT_DIR}")
# Must be done before CUDA language is enabled, see
# https://cmake.org/cmake/help/v3.15/variable/CMAKE_CUDA_HOST_COMPILER.html
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
- set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}")
+ #set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}")
endif()
enable_language(CUDA)
if("X${CMAKE_CUDA_STANDARD}" STREQUAL "X" )
diff --git a/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake b/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake
index 420ee63..8bc24a0 100644
--- a/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake
+++ b/cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake
@@ -1691,14 +1691,6 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
# If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here.
list( FIND nvcc_flags "-ccbin" ccbin_found0 )
list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 )
- if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
- # Match VERBATIM check below.
- if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)")
- list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
- else()
- list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}")
- endif()
- endif()
# Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS*
set(config_specific_flags)
diff --git a/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake b/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
index 9293df3..8c12015 100644
--- a/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
+++ b/cmake/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
@@ -126,13 +126,6 @@ list(APPEND CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS_${build_configuration}})
# Any -ccbin existing in CUDA_NVCC_FLAGS gets highest priority
list( FIND CUDA_NVCC_FLAGS "-ccbin" ccbin_found0 )
list( FIND CUDA_NVCC_FLAGS "--compiler-bindir" ccbin_found1 )
-if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
- if (CUDA_HOST_COMPILER STREQUAL "@_CUDA_MSVC_HOST_COMPILER@" AND DEFINED CCBIN)
- set(CCBIN -ccbin "${CCBIN}")
- else()
- set(CCBIN -ccbin "${CUDA_HOST_COMPILER}")
- endif()
-endif()
# cuda_execute_process - Executes a command with optional command echo and status message.
#
diff --git a/cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake b/cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake
index d917738..6d0d4fa 100644
--- a/cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake
+++ b/cmake/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake
@@ -30,7 +30,6 @@ endif()
set(CUDA_KNOWN_GPU_ARCHITECTURES "Kepler" "Maxwell")
# This list will be used for CUDA_ARCH_NAME = Common option (enabled by default)
-set(CUDA_COMMON_GPU_ARCHITECTURES "3.5" "5.0")
# This list is used to filter CUDA archs when autodetecting
set(CUDA_ALL_GPU_ARCHITECTURES "3.5" "5.0")
diff --git a/cmake/public/cuda.cmake b/cmake/public/cuda.cmake
index 4112937..5964429 100644
--- a/cmake/public/cuda.cmake
+++ b/cmake/public/cuda.cmake
@@ -41,9 +41,6 @@ set(CUDAToolkit_ROOT "${CUDA_TOOLKIT_ROOT_DIR}")
# Pass clang as host compiler, which according to the docs
# Must be done before CUDA language is enabled, see
# https://cmake.org/cmake/help/v3.15/variable/CMAKE_CUDA_HOST_COMPILER.html
-if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
- set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}")
-endif()
enable_language(CUDA)
if("X${CMAKE_CUDA_STANDARD}" STREQUAL "X" )
set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD})

View File

@ -1,5 +1,5 @@
diff --git a/c10/cuda/CMakeLists.txt b/c10/cuda/CMakeLists.txt
index c0628d0c96..5dfb7f2abb 100644
index c0628d0..5dfb7f2 100644
--- a/c10/cuda/CMakeLists.txt
+++ b/c10/cuda/CMakeLists.txt
@@ -74,7 +74,11 @@ add_subdirectory(test)
@ -16,7 +16,7 @@ index c0628d0c96..5dfb7f2abb 100644
get_filename_component( dir ${file} DIRECTORY )
install( FILES ${file} DESTINATION include/c10/cuda/${dir} )
diff --git a/c10/util/Exception.h b/c10/util/Exception.h
index ecbc7c1345..2dd1001c9e 100644
index ecbc7c1..2dd1001 100644
--- a/c10/util/Exception.h
+++ b/c10/util/Exception.h
@@ -14,6 +14,9 @@
@ -30,7 +30,7 @@ index ecbc7c1345..2dd1001c9e 100644
/// The primary ATen error class.
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 2c5c5b95d8..8c1742591f 100644
index b46a444..255d7f4 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -1581,19 +1581,10 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
@ -50,7 +50,7 @@ index 2c5c5b95d8..8c1742591f 100644
- endif()
- set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
- message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
+ find_package(onnx REQUIRED)
+ find_package(ONNX REQUIRED)
+ set(ONNX_LIBRARY onnx)
+ set(ONNX_PROTO_LIBRARY onnx_proto)
+ message("-- Found onnx")
@ -58,7 +58,7 @@ index 2c5c5b95d8..8c1742591f 100644
endif()
include_directories(${FOXI_INCLUDE_DIRS})
diff --git a/pyproject.toml b/pyproject.toml
index eb764cb895..c70f317c2f 100644
index eb764cb..c70f317 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,11 +4,9 @@ requires = [
@ -75,7 +75,7 @@ index eb764cb895..c70f317c2f 100644
# Use legacy backend to import local packages in setup.py
build-backend = "setuptools.build_meta:__legacy__"
diff --git a/setup.py b/setup.py
index 17bf16b89a..b90ebbc9eb 100644
index 7016441..a6416c7 100644
--- a/setup.py
+++ b/setup.py
@@ -263,7 +263,7 @@ from tools.setup_helpers.env import build_type, IS_DARWIN, IS_LINUX, IS_WINDOWS
@ -109,7 +109,7 @@ index 17bf16b89a..b90ebbc9eb 100644
all_commands = [entry for f in ninja_files + cmake_files for entry in load(f)]
diff --git a/third_party/nvfuser/csrc/instrumentation.h b/third_party/nvfuser/csrc/instrumentation.h
index cd57825a24..75e81e9fac 100644
index cd57825..75e81e9 100644
--- a/third_party/nvfuser/csrc/instrumentation.h
+++ b/third_party/nvfuser/csrc/instrumentation.h
@@ -2,7 +2,7 @@
@ -122,7 +122,7 @@ index cd57825a24..75e81e9fac 100644
// NOLINTNEXTLINE(modernize-deprecated-headers)
#include <stdio.h>
diff --git a/tools/setup_helpers/env.py b/tools/setup_helpers/env.py
index d87e97a2bb..e1bc42e87c 100644
index d87e97a..6c52f39 100644
--- a/tools/setup_helpers/env.py
+++ b/tools/setup_helpers/env.py
@@ -19,7 +19,7 @@ CONDA_DIR = os.path.join(os.path.dirname(sys.executable), "..")
@ -135,7 +135,7 @@ index d87e97a2bb..e1bc42e87c 100644
def check_env_flag(name: str, default: str = "") -> bool:
diff --git a/torch/lib/libshm/CMakeLists.txt b/torch/lib/libshm/CMakeLists.txt
index 20158a9a25..7d3c475a9b 100644
index 20158a9..7d3c475 100644
--- a/torch/lib/libshm/CMakeLists.txt
+++ b/torch/lib/libshm/CMakeLists.txt
@@ -71,6 +71,10 @@ target_link_libraries(torch_shm_manager PRIVATE shm)
@ -151,7 +151,7 @@ index 20158a9a25..7d3c475a9b 100644
install(FILES libshm.h DESTINATION "include")
install(TARGETS torch_shm_manager DESTINATION "bin")
diff --git a/torch/lib/libshm_windows/CMakeLists.txt b/torch/lib/libshm_windows/CMakeLists.txt
index df2a106493..b86e0b6872 100644
index df2a106..b86e0b6 100644
--- a/torch/lib/libshm_windows/CMakeLists.txt
+++ b/torch/lib/libshm_windows/CMakeLists.txt
@@ -19,9 +19,12 @@ target_include_directories(shm PRIVATE
@ -170,7 +170,7 @@ index df2a106493..b86e0b6872 100644
+ install(FILES $<TARGET_PDB_FILE:shm> DESTINATION "${LIBSHM_INSTALL_BIN_SUBDIR}" OPTIONAL)
endif()
diff --git a/torch/utils/cpp_extension.py b/torch/utils/cpp_extension.py
index 6600eb3cb5..1d5e451c14 100644
index 6600eb3..15ddc8c 100644
--- a/torch/utils/cpp_extension.py
+++ b/torch/utils/cpp_extension.py
@@ -38,7 +38,7 @@ SHARED_FLAG = '/DLL' if IS_WINDOWS else '-shared'

View File

@ -1,13 +0,0 @@
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 8c1742591..a2ca73b6e 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -1581,7 +1581,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
target_compile_options(onnx PRIVATE -Wno-deprecated-declarations)
endif()
else()
- find_package(onnx REQUIRED)
+ find_package(ONNX REQUIRED)
set(ONNX_LIBRARY onnx)
set(ONNX_PROTO_LIBRARY onnx_proto)
message("-- Found onnx")

View File

@ -1,8 +1,8 @@
diff --git a/cmake/public/cuda.cmake b/cmake/public/cuda.cmake
index e8e450d36c..8ba1778b4f 100644
index 5964429..d528597 100644
--- a/cmake/public/cuda.cmake
+++ b/cmake/public/cuda.cmake
@@ -60,6 +60,7 @@ find_package(CUDAToolkit REQUIRED)
@@ -57,6 +57,7 @@ find_package(CUDAToolkit REQUIRED)
cmake_policy(POP)

View File

@ -1,5 +1,5 @@
diff --git a/aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt b/aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt
index d18523352..1f53945cf 100644
index d185233..11f285b 100644
--- a/aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt
+++ b/aten/src/ATen/native/quantized/cpu/qnnpack/CMakeLists.txt
@@ -389,12 +389,12 @@ if(NOT TARGET fxdiv AND NOT USE_SYSTEM_FXDIV)
@ -19,10 +19,10 @@ index d18523352..1f53945cf 100644
target_link_libraries(pytorch_qnnpack PRIVATE fxdiv)
diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
index f7a595e1b..fb315c435 100644
index f7a595e..47faec5 100644
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
@@ -108,11 +108,18 @@ endif()
@@ -108,12 +108,19 @@ endif()
# addressed yet.
if(NOT MSVC AND USE_XNNPACK)
@ -42,3 +42,4 @@ index f7a595e1b..fb315c435 100644
+ target_include_directories(fxdiv INTERFACE "${FXDIV_HDR}")
endif()
endif()

View File

@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b8bc7cb6e..fa6da328b8 100644
index 7b8bc7c..fa6da32 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -383,7 +383,7 @@ if(WIN32)
@ -23,7 +23,7 @@ index 7b8bc7cb6e..fa6da328b8 100644
${PROJECT_SOURCE_DIR}/cmake/Modules/FindCUSPARSELT.cmake
DESTINATION share/cmake/Caffe2/
diff --git a/aten/src/ATen/native/vulkan/api/Allocator.h b/aten/src/ATen/native/vulkan/api/Allocator.h
index d0c8bdf9ec..50df97ae09 100644
index d0c8bdf..50df97a 100644
--- a/aten/src/ATen/native/vulkan/api/Allocator.h
+++ b/aten/src/ATen/native/vulkan/api/Allocator.h
@@ -47,7 +47,7 @@
@ -36,7 +36,7 @@ index d0c8bdf9ec..50df97ae09 100644
#ifdef __clang__
#pragma clang diagnostic pop
diff --git a/aten/src/ATen/native/vulkan/ops/Clamp.cpp b/aten/src/ATen/native/vulkan/ops/Clamp.cpp
index dc22b987ef..f91fbf6788 100644
index dc22b98..f91fbf6 100644
--- a/aten/src/ATen/native/vulkan/ops/Clamp.cpp
+++ b/aten/src/ATen/native/vulkan/ops/Clamp.cpp
@@ -1,3 +1,6 @@
@ -47,7 +47,7 @@ index dc22b987ef..f91fbf6788 100644
#include <torch/library.h>
diff --git a/c10/CMakeLists.txt b/c10/CMakeLists.txt
index ad407e18cb..bbca41bab2 100644
index ad407e1..bbca41b 100644
--- a/c10/CMakeLists.txt
+++ b/c10/CMakeLists.txt
@@ -139,7 +139,11 @@ endif()
@ -64,7 +64,7 @@ index ad407e18cb..bbca41bab2 100644
DESTINATION include
FILES_MATCHING PATTERN "*.h")
diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
index 74d0d55719..cf349c2fa8 100644
index 74d0d55..cf349c2 100644
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
@@ -632,7 +632,11 @@ if(USE_CUDA)
@ -165,7 +165,7 @@ index 74d0d55719..cf349c2fa8 100644
# ---[ Caffe2 HIP sources.
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index cd27c728ff..2c5c5b95d8 100644
index cfaf83e..b46a444 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -1130,7 +1130,7 @@ if(BUILD_PYTHON)
@ -196,7 +196,7 @@ index cd27c728ff..2c5c5b95d8 100644
endif()
diff --git a/cmake/Modules/FindCUSPARSELT.cmake b/cmake/Modules/FindCUSPARSELT.cmake
index 8727f44a90..1e41281b1b 100644
index 8727f44..1e41281 100644
--- a/cmake/Modules/FindCUSPARSELT.cmake
+++ b/cmake/Modules/FindCUSPARSELT.cmake
@@ -24,13 +24,13 @@ list(APPEND CMAKE_PREFIX_PATH ${CUSPARSELT_ROOT})
@ -217,7 +217,7 @@ index 8727f44a90..1e41281b1b 100644
find_package_handle_standard_args(CUSPARSELT DEFAULT_MSG CUSPARSELT_LIBRARY_PATH CUSPARSELT_INCLUDE_PATH)
diff --git a/cmake/Modules/FindMAGMA.cmake b/cmake/Modules/FindMAGMA.cmake
index d2bff53d9b..3af9012503 100644
index d2bff53..3af9012 100644
--- a/cmake/Modules/FindMAGMA.cmake
+++ b/cmake/Modules/FindMAGMA.cmake
@@ -30,18 +30,13 @@ FIND_PATH(MAGMA_INCLUDE_DIR magma.h
@ -254,7 +254,7 @@ index d2bff53d9b..3af9012503 100644
+find_package_handle_standard_args(MAGMA REQUIRED_VARS MAGMA_INCLUDE_DIR MAGMA_LIBRARIES)
\ No newline at end of file
diff --git a/test/cpp/jit/CMakeLists.txt b/test/cpp/jit/CMakeLists.txt
index 2376f1bc43..a8ae4367fd 100644
index 2376f1b..a8ae436 100644
--- a/test/cpp/jit/CMakeLists.txt
+++ b/test/cpp/jit/CMakeLists.txt
@@ -124,7 +124,7 @@ endif()
@ -267,7 +267,7 @@ index 2376f1bc43..a8ae4367fd 100644
target_link_libraries(test_jit PRIVATE ${JIT_TEST_DEPENDENCIES})
diff --git a/third_party/nvfuser/CMakeLists.txt b/third_party/nvfuser/CMakeLists.txt
index b148418af0..7b96083893 100644
index b148418..7b96083 100644
--- a/third_party/nvfuser/CMakeLists.txt
+++ b/third_party/nvfuser/CMakeLists.txt
@@ -158,7 +158,10 @@ endif()
@ -283,7 +283,7 @@ index b148418af0..7b96083893 100644
install(DIRECTORY "${NVFUSER_ROOT}/python_tests/"
DESTINATION "${TORCH_ROOT}/test/_nvfuser"
diff --git a/torch/CMakeLists.txt b/torch/CMakeLists.txt
index 62ee4c12a9..f75073cf3c 100644
index 62ee4c1..f75073c 100644
--- a/torch/CMakeLists.txt
+++ b/torch/CMakeLists.txt
@@ -107,7 +107,7 @@ set(TORCH_PYTHON_LINK_FLAGS "")
@ -308,7 +308,7 @@ index 62ee4c12a9..f75073cf3c 100644
# Generate torch/version.py from the appropriate CMake cache variables.
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
diff --git a/torch/csrc/cuda/shared/nvtx.cpp b/torch/csrc/cuda/shared/nvtx.cpp
index 4fb72c5f79..1abe1b76d6 100644
index 4fb72c5..1abe1b7 100644
--- a/torch/csrc/cuda/shared/nvtx.cpp
+++ b/torch/csrc/cuda/shared/nvtx.cpp
@@ -1,7 +1,7 @@
@ -321,7 +321,7 @@ index 4fb72c5f79..1abe1b76d6 100644
namespace torch::cuda::shared {
diff --git a/torch/csrc/jit/tensorexpr/llvm_codegen.h b/torch/csrc/jit/tensorexpr/llvm_codegen.h
index 7ab506fa8f..2ee3b68b6b 100644
index 7ab506f..2ee3b68 100644
--- a/torch/csrc/jit/tensorexpr/llvm_codegen.h
+++ b/torch/csrc/jit/tensorexpr/llvm_codegen.h
@@ -41,9 +41,9 @@ class TORCH_API LLVMCodeGen : public CodeGen {
@ -338,7 +338,7 @@ index 7ab506fa8f..2ee3b68b6b 100644
at::Tensor empty_strided(
c10::IntArrayRef size,
diff --git a/torch/csrc/profiler/stubs/cuda.cpp b/torch/csrc/profiler/stubs/cuda.cpp
index dec87576f3..3bb368a4df 100644
index dec8757..3bb368a 100644
--- a/torch/csrc/profiler/stubs/cuda.cpp
+++ b/torch/csrc/profiler/stubs/cuda.cpp
@@ -1,6 +1,6 @@

View File

@ -1,3 +1,17 @@
vcpkg_download_distfile(
CUDNN_9_FIX
URLS https://github.com/pytorch/pytorch/commit/e14026bc2a6cd80bedffead77a5d7b75a37f8e67.patch?full_index=1
SHA512 9569547b44b61f9559f0e7ab91f2be51657ece4f5462b6860cb5eae8d23d01187d6af046b369a77a228fe4d7153f5c683b686e84c1296a662f83e5f1f281bc7e
FILENAME libtorch-cudnn-9-fix-e14026bc2a6cd80bedffead77a5d7b75a37f8e67.patch
)
vcpkg_download_distfile(
CUDA_THRUST_MISSING_HEADER_FIX
URLS https://github.com/pytorch/pytorch/commit/2a440348958b3f0a2b09458bd76fe5959b371c0c.patch?full_index=1
SHA512 eff10d81b1c635108ad1b95a430865a76ab3f2079be74e61e06876942ac1fd43a274fc1c73e43c2c01b9ce5aca648213ef75c13c28b8ffa40497e4e26d5e3b16
FILENAME libtorch-cuda-thrust-missing-header-2a440348958b3f0a2b09458bd76fe5959b371c0c.patch
)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
@ -7,13 +21,14 @@ vcpkg_from_github(
SHA512 a8961d78ad785b13c959a0612563a60e0de17a7c8bb9822ddea9a24072796354d07e81c47b6cc8761b21a6448845b088cf80e1661d9e889b0ed5474d3dc76756
HEAD_REF master
PATCHES
"${CUDNN_9_FIX}"
"${CUDA_THRUST_MISSING_HEADER_FIX}"
cmake-fixes.patch
more-fixes.patch
fix-build.patch
clang-cl.patch
cuda-adjustments.patch
fix-api-export.patch
fix-onnx-case.patch
fxdiv.patch
protoc.patch
fix-sleef.patch
@ -22,6 +37,7 @@ vcpkg_from_github(
fix-calculate-minloglevel.patch
force-cuda-include.patch
)
file(REMOVE_RECURSE "${SOURCE_PATH}/caffe2/core/macros.h") # We must use generated header files
vcpkg_from_github(

View File

@ -1,7 +1,7 @@
{
"name": "libtorch",
"version": "2.1.2",
"port-version": 2,
"port-version": 3,
"description": "Tensors and Dynamic neural networks in Python with strong GPU acceleration",
"homepage": "https://pytorch.org/",
"license": null,

View File

@ -7,6 +7,12 @@ vcpkg_download_distfile(ARM64_WINDOWS_FIX
FILENAME opencv4-e5e1a3bfdea96bebda2ad963bc8f6cf17930aef7.patch
)
vcpkg_download_distfile(CUDA_12_4_FIX
URLS https://github.com/opencv/opencv/commit/3e3ee106fb8ccd003aa2c9a943a2340b066537bc.patch?full_index=1
SHA512 d50fd2e11563fc80467303a98d480f80f5587b1c1cb5a425c3a360dc14be937173ffb665d34167e27c67202bcce7b95d47ab68e2d5effb1ae8f7130610dac3e0
FILENAME opencv4-3e3ee106fb8ccd003aa2c9a943a2340b066537bc.patch
)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO opencv/opencv
@ -32,6 +38,7 @@ vcpkg_from_github(
0021-static-openvino.patch # https://github.com/opencv/opencv/pull/23963
"${ARM64_WINDOWS_FIX}"
0022-fix-supportqnx.patch
"${CUDA_12_4_FIX}"
)
# Disallow accidental build of vendored copies
file(REMOVE_RECURSE "${SOURCE_PATH}/3rdparty/openexr")
@ -185,6 +192,24 @@ if("contrib" IN_LIST FEATURES)
set(BUILD_opencv_quality CMAKE_DEPENDS_IN_PROJECT_ONLY)
endif()
vcpkg_download_distfile(CUDA_12_4_CONTRIB_FIX
URLS https://github.com/opencv/opencv_contrib/commit/1ed3dd2c53888e3289afdb22ec4e9ebbff3dba87.patch?full_index=1
SHA512 f4996cf8368b61dce9d434b608bbd5d49d8e0cd51d0f1b2f1536bfa8ce79823715e082ab5db70dcdd50603baf107c129fc4a804f04ee55cd974973e10716dd43
FILENAME opencv-contrib-1ed3dd2c53888e3289afdb22ec4e9ebbff3dba87.patch
)
vcpkg_download_distfile(CUDA_12_4_CONTRIB_FIX_2
URLS https://github.com/opencv/opencv_contrib/commit/9358ad2e56f6d0b99860856fc1b53b783d186e73.patch?full_index=1
SHA512 9d2fef86693e723af4c63417178f3082bf1e1cea2fd0164ecf9bd0ec02d348c374d9c3a707c8e0f224560c9671879ef6f8a6c54cdf38820fe5877faba3545732
FILENAME opencv-contrib-9358ad2e56f6d0b99860856fc1b53b783d186e73.patch
)
vcpkg_download_distfile(CUDA_12_4_CONTRIB_FIX_3
URLS https://github.com/opencv/opencv_contrib/commit/baaeb68b3d6b557536f95b527c0dd87c8f1ce80d.patch?full_index=1
SHA512 1d5dc4fbcff57044f03b0620385d8b23eb99e3a39f211901b68c7622f2f00e4ccaa3a1e1999a6712285e1812ada72acb70280d62eb089d6bdd015b5545d2d4ae
FILENAME opencv-contrib-baaeb68b3d6b557536f95b527c0dd87c8f1ce80d.patch
)
vcpkg_from_github(
OUT_SOURCE_PATH CONTRIB_SOURCE_PATH
REPO opencv/opencv_contrib
@ -196,7 +221,11 @@ if("contrib" IN_LIST FEATURES)
0016-fix-freetype-contrib.patch
0018-fix-depend-tesseract.patch
0019-fix-ogre-dependency.patch
"${CUDA_12_4_CONTRIB_FIX}"
"${CUDA_12_4_CONTRIB_FIX_2}"
"${CUDA_12_4_CONTRIB_FIX_3}"
)
set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules")
vcpkg_download_distfile(OCV_DOWNLOAD

View File

@ -1,7 +1,7 @@
{
"name": "opencv4",
"version": "4.8.0",
"port-version": 20,
"port-version": 21,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",

View File

@ -14,6 +14,7 @@ vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DUTPP_INCLUDE_TESTS_IN_BUILD=OFF
-DUTPP_AMPLIFY_WARNINGS=OFF
)
vcpkg_cmake_install()

View File

@ -1,7 +1,7 @@
{
"name": "unittest-cpp",
"version-semver": "2.0.0",
"port-version": 5,
"port-version": 6,
"description": "A lightweight unit testing framework for C++",
"homepage": "https://github.com/unittest-cpp/unittest-cpp",
"dependencies": [

View File

@ -1,312 +0,0 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
<#
.SYNOPSIS
Returns whether there's a name collision in the resource group.
.DESCRIPTION
Find-ResourceGroupNameCollision takes a list of resources, and checks if $Test
collides names with any of the resources.
.PARAMETER Test
The name to test.
.PARAMETER Resources
The list of resources.
#>
function Find-ResourceGroupNameCollision {
[CmdletBinding()]
Param([string]$Test, $Resources)
foreach ($resource in $Resources) {
if ($resource.ResourceGroupName -eq $Test) {
return $true
}
}
return $false
}
<#
.SYNOPSIS
Attempts to find a name that does not collide with any resources in the resource group.
.DESCRIPTION
Find-ResourceGroupName takes a set of resources from Get-AzResourceGroup, and finds the
first name in {$Prefix, $Prefix-1, $Prefix-2, ...} such that the name doesn't collide with
any of the resources in the resource group.
.PARAMETER Prefix
The prefix of the final name; the returned name will be of the form "$Prefix(-[1-9][0-9]*)?"
#>
function Find-ResourceGroupName {
[CmdletBinding()]
Param([string] $Prefix)
$resources = Get-AzResourceGroup
$result = $Prefix
$suffix = 0
while (Find-ResourceGroupNameCollision -Test $result -Resources $resources) {
$suffix++
$result = "$Prefix-$suffix"
}
return $result
}
<#
.SYNOPSIS
Generates a random password.
.DESCRIPTION
New-Password generates a password, randomly, of length $Length, containing
only alphanumeric characters, underscore, and dash.
.PARAMETER Length
The length of the returned password.
#>
function New-Password {
Param ([int] $Length = 32)
# This 64-character alphabet generates 6 bits of entropy per character.
# The power-of-2 alphabet size allows us to select a character by masking a random Byte with bitwise-AND.
$alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"
$mask = 63
if ($alphabet.Length -ne 64) {
throw 'Bad alphabet length'
}
[Byte[]]$randomData = [Byte[]]::new($Length)
$rng = $null
try {
$rng = [System.Security.Cryptography.RandomNumberGenerator]::Create()
$rng.GetBytes($randomData)
}
finally {
if ($null -ne $rng) {
$rng.Dispose()
}
}
$result = ''
for ($idx = 0; $idx -lt $Length; $idx++) {
$result += $alphabet[$randomData[$idx] -band $mask]
}
return $result
}
<#
.SYNOPSIS
Waits for the shutdown of the specified resource.
.DESCRIPTION
Wait-Shutdown takes a VM, and checks if there's a 'PowerState/stopped'
code; if there is, it returns. If there isn't, it waits ten seconds and
tries again.
.PARAMETER ResourceGroupName
The name of the resource group to look up the VM in.
.PARAMETER Name
The name of the virtual machine to wait on.
#>
function Wait-Shutdown {
[CmdletBinding()]
Param([string]$ResourceGroupName, [string]$Name)
Write-Host "Waiting for $Name to stop..."
while ($true) {
$Vm = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $Name -Status
$highestStatus = $Vm.Statuses.Count
for ($idx = 0; $idx -lt $highestStatus; $idx++) {
if ($Vm.Statuses[$idx].Code -eq 'PowerState/stopped') {
return
}
}
Write-Host "... not stopped yet, sleeping for 10 seconds"
Start-Sleep -Seconds 10
}
}
<#
.SYNOPSIS
Sanitizes a name to be used in a storage account.
.DESCRIPTION
Sanitize-Name takes a string, and removes all of the '-'s and
lowercases the string, since storage account names must have no
'-'s and must be completely lowercase alphanumeric. It then makes
certain that the length of the string is not greater than 24,
since that is invalid.
.PARAMETER RawName
The name to sanitize.
#>
function Sanitize-Name {
[CmdletBinding()]
Param(
[string]$RawName
)
$result = $RawName.Replace('-', '').ToLowerInvariant()
if ($result.Length -gt 24) {
Write-Error 'Sanitized name for storage account $result was too long.'
throw
}
return $result
}
<#
.SYNOPSIS
Creates a new Azure virtual network with locked down firewall rules.
.PARAMETER ResourceGroupName
The name of the resource group in which the virtual network should be created.
.PARAMETER Location
The location (region) where the network is to be created.
#>
function Create-LockedDownNetwork {
[CmdletBinding()]
Param(
[parameter(Mandatory=$true)]
[string]$ResourceGroupName,
[parameter(Mandatory=$true)]
[string]$Location
)
$publicIp = New-AzPublicIpAddress `
-Name "$ResourceGroupName-ip" `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-Sku 'Standard' `
-AllocationMethod 'Static'
$natGateway = New-AzNatGateway `
-Name "$ResourceGroupName-nat" `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-Sku 'Standard' `
-PublicIpAddress $publicIp
$allFirewallRules = @()
$allFirewallRules += New-AzNetworkSecurityRuleConfig `
-Name AllowHTTP `
-Description 'Allow HTTP(S)' `
-Access Allow `
-Protocol Tcp `
-Direction Outbound `
-Priority 1008 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange @(80, 443)
$allFirewallRules += New-AzNetworkSecurityRuleConfig `
-Name AllowSFTP `
-Description 'Allow (S)FTP' `
-Access Allow `
-Protocol Tcp `
-Direction Outbound `
-Priority 1009 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange @(21, 22)
$allFirewallRules += New-AzNetworkSecurityRuleConfig `
-Name AllowDNS `
-Description 'Allow DNS' `
-Access Allow `
-Protocol * `
-Direction Outbound `
-Priority 1010 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange 53
$allFirewallRules += New-AzNetworkSecurityRuleConfig `
-Name AllowGit `
-Description 'Allow git' `
-Access Allow `
-Protocol Tcp `
-Direction Outbound `
-Priority 1011 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange 9418
$allFirewallRules += New-AzNetworkSecurityRuleConfig `
-Name DenyElse `
-Description 'Deny everything else' `
-Access Deny `
-Protocol * `
-Direction Outbound `
-Priority 1013 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange *
$NetworkSecurityGroupName = $ResourceGroupName + 'NetworkSecurity'
$NetworkSecurityGroup = New-AzNetworkSecurityGroup `
-Name $NetworkSecurityGroupName `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-SecurityRules $allFirewallRules
$SubnetName = $ResourceGroupName + 'Subnet'
$Subnet = New-AzVirtualNetworkSubnetConfig `
-Name $SubnetName `
-AddressPrefix "10.0.0.0/16" `
-NetworkSecurityGroup $NetworkSecurityGroup `
-ServiceEndpoint "Microsoft.Storage" `
-NatGateway $natGateway
$VirtualNetworkName = $ResourceGroupName + 'Network'
$VirtualNetwork = New-AzVirtualNetwork `
-Name $VirtualNetworkName `
-ResourceGroupName $ResourceGroupName `
-Location $Location `
-AddressPrefix "10.0.0.0/16" `
-Subnet $Subnet
return $VirtualNetwork
}
function Invoke-AzVMRunCommandWithRetries {
$result = $null
$success = $false
$attempt = 0
while ($success -eq $false) {
try {
++$attempt
Write-Host "Command attempt $attempt..."
$result = Invoke-AzVMRunCommand @args
$success = $true
} catch {
Write-Host "Running command failed. $_ Retrying after 10 seconds..."
Start-Sleep -Seconds 10
if ($attempt -eq 5) {
Write-Error "Running command failed too many times. Giving up!"
throw $_
}
}
}
return $result
}
Export-ModuleMember -Function Find-ResourceGroupName
Export-ModuleMember -Function New-Password
Export-ModuleMember -Function Wait-Shutdown
Export-ModuleMember -Function Sanitize-Name
Export-ModuleMember -Function Create-LockedDownNetwork
Export-ModuleMember -Function Invoke-AzVMRunCommandWithRetries

View File

@ -20,7 +20,7 @@ jobs:
condition: and(succeeded(), contains('^${{ replace(parameters.jobName, '_', '-') }}$', '${{ parameters.tripletPattern }}'))
pool:
name: PrWin-1ES
demands: ImageVersionOverride -equals 2024.05.24
demands: ImageVersionOverride -equals 2024.06.18
workspace:
clean: resources
timeoutInMinutes: 2880 # 2 days

View File

@ -24,14 +24,89 @@ $WindowsServerSku = '2022-datacenter-azure-edition'
$ErrorActionPreference = 'Stop'
$ProgressActivity = 'Creating Windows Image'
$TotalProgress = 18
$TotalProgress = 17
$CurrentProgress = 1
# Assigning this to another variable helps when running the commands in this script manually for
# debugging
$Root = $PSScriptRoot
Import-Module "$Root/../create-vmss-helpers.psm1" -DisableNameChecking -Force
<#
.SYNOPSIS
Generates a random password.
.DESCRIPTION
New-Password generates a password, randomly, of length $Length, containing
only alphanumeric characters, underscore, and dash.
.PARAMETER Length
The length of the returned password.
#>
function New-Password {
Param ([int] $Length = 32)
# This 64-character alphabet generates 6 bits of entropy per character.
# The power-of-2 alphabet size allows us to select a character by masking a random Byte with bitwise-AND.
$alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"
$mask = 63
if ($alphabet.Length -ne 64) {
throw 'Bad alphabet length'
}
[Byte[]]$randomData = [Byte[]]::new($Length)
$rng = $null
try {
$rng = [System.Security.Cryptography.RandomNumberGenerator]::Create()
$rng.GetBytes($randomData)
}
finally {
if ($null -ne $rng) {
$rng.Dispose()
}
}
$result = ''
for ($idx = 0; $idx -lt $Length; $idx++) {
$result += $alphabet[$randomData[$idx] -band $mask]
}
return $result
}
<#
.SYNOPSIS
Waits for the shutdown of the specified resource.
.DESCRIPTION
Wait-Shutdown takes a VM, and checks if there's a 'PowerState/stopped'
code; if there is, it returns. If there isn't, it waits ten seconds and
tries again.
.PARAMETER ResourceGroupName
The name of the resource group to look up the VM in.
.PARAMETER Name
The name of the virtual machine to wait on.
#>
function Wait-Shutdown {
[CmdletBinding()]
Param([string]$ResourceGroupName, [string]$Name)
Write-Host "Waiting for $Name to stop..."
while ($true) {
$Vm = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $Name -Status
$highestStatus = $Vm.Statuses.Count
for ($idx = 0; $idx -lt $highestStatus; $idx++) {
if ($Vm.Statuses[$idx].Code -eq 'PowerState/stopped') {
return
}
}
Write-Host "... not stopped yet, sleeping for 10 seconds"
Start-Sleep -Seconds 10
}
}
$AdminPW = New-Password
$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force
@ -82,53 +157,21 @@ $VMCreatedOsDisk = $VMCreated.StorageProfile.OsDisk.Name
####################################################################################################
Write-Progress `
-Activity $ProgressActivity `
-Status 'Granting permissions to use vcpkg-image-minting storage account' `
-Status 'Minting token for vcpkg-image-minting storage account' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$VcpkgImageMintingAccount = Get-AzStorageAccount -ResourceGroupName 'vcpkg-image-minting' -Name 'vcpkgimageminting'
$CudnnStorageContext = New-AzStorageContext -StorageAccountName 'vcpkgimageminting' -UseConnectedAccount
$AssetStorageContext = New-AzStorageContext -StorageAccountName 'vcpkgimageminting' -UseConnectedAccount
$StartTime = Get-Date
$ExpiryTime = $StartTime.AddDays(1)
$CudnnSas = New-AzStorageContainerSASToken -Name 'assets' -Permission r -StartTime $StartTime -ExpiryTime $ExpiryTime -Context $CudnnStorageContext
$CudnnUrl = "https://vcpkgimageminting.blob.core.windows.net/assets/cudnn-windows-x86_64-8.8.1.3_cuda12-archive.zip?$CudnnSas"
####################################################################################################
Write-Progress `
-Activity $ProgressActivity `
-Status 'Running provisioning script deploy-tlssettings.ps1 in VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$ProvisionImageResult = Invoke-AzVMRunCommandWithRetries `
-ResourceGroupName 'vcpkg-image-minting' `
-VMName $ProtoVMName `
-CommandId 'RunPowerShellScript' `
-ScriptPath "$Root\deploy-tlssettings.ps1"
Write-Host "deploy-tlssettings.ps1 output: $($ProvisionImageResult.value.Message)"
Write-Host 'Waiting 1 minute for VM to reboot...'
Start-Sleep -Seconds 60
####################################################################################################
Write-Progress `
-Activity $ProgressActivity `
-Status 'Running provisioning script deploy-psexec.ps1 in VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$DeployPsExecResult = Invoke-AzVMRunCommandWithRetries `
-ResourceGroupName 'vcpkg-image-minting' `
-VMName $ProtoVMName `
-CommandId 'RunPowerShellScript' `
-ScriptPath "$Root\deploy-psexec.ps1"
Write-Host "deploy-psexec.ps1 output: $($DeployPsExecResult.value.Message)"
$ExpiryTime = $StartTime.AddHours(4)
$AssetsSas = New-AzStorageContainerSASToken -Name 'assets' -Permission r -StartTime $StartTime -ExpiryTime $ExpiryTime -Context $AssetStorageContext
####################################################################################################
function Invoke-ScriptWithPrefix {
param(
[string]$ScriptName,
[switch]$AddAdminPw,
[string]$CudnnUrl = $null
[switch]$SkipSas
)
Write-Progress `
@ -136,29 +179,25 @@ function Invoke-ScriptWithPrefix {
-Status "Running provisioning script $ScriptName in VM" `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$DropToAdminUserPrefix = Get-Content "$Root\drop-to-admin-user-prefix.ps1" -Encoding utf8NoBOM -Raw
$UtilityPrefixContent = Get-Content "$Root\utility-prefix.ps1" -Encoding utf8NoBOM -Raw
$tempScriptFilename = "$env:TEMP\temp-script.txt"
try {
$script = Get-Content "$Root\$ScriptName" -Encoding utf8NoBOM -Raw
if ($AddAdminPw) {
$script = $script.Replace('# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1', $DropToAdminUserPrefix)
}
$script = $script.Replace('# REPLACE WITH UTILITY-PREFIX.ps1', $UtilityPrefixContent);
if (-not [string]::IsNullOrEmpty($CudnnUrl)) {
$script = $script.Replace('# REPLACE WITH CudnnUrl', "`$CudnnUrl = `"$CudnnUrl`"")
}
$replacement = @"
if (Test-Path "`$PSScriptRoot/utility-prefix.ps1") {
. "`$PSScriptRoot/utility-prefix.ps1"
}
"@
$script = $script.Replace($replacement, $UtilityPrefixContent);
Set-Content -Path $tempScriptFilename -Value $script -Encoding utf8NoBOM
$parameter = $null
if ($AddAdminPw) {
$parameter = @{AdminUserPassword = $AdminPW;}
if (-not $SkipSas) {
$parameter = @{SasToken = "`"$AssetsSas`"";}
}
$InvokeResult = Invoke-AzVMRunCommandWithRetries `
$InvokeResult = Invoke-AzVMRunCommand `
-ResourceGroupName 'vcpkg-image-minting' `
-VMName $ProtoVMName `
-CommandId 'RunPowerShellScript' `
@ -172,57 +211,37 @@ function Invoke-ScriptWithPrefix {
}
####################################################################################################
Invoke-ScriptWithPrefix -ScriptName 'deploy-windows-sdks.ps1' -AddAdminPw
Invoke-ScriptWithPrefix -ScriptName 'deploy-tlssettings.ps1' -SkipSas
Write-Host 'Waiting 1 minute for VM to reboot...'
Start-Sleep -Seconds 60
####################################################################################################
Invoke-ScriptWithPrefix -ScriptName 'deploy-visual-studio.ps1' -AddAdminPw
Invoke-ScriptWithPrefix -ScriptName 'deploy-windows-sdks.ps1'
####################################################################################################
Invoke-ScriptWithPrefix -ScriptName 'deploy-mpi.ps1' -AddAdminPw
Invoke-ScriptWithPrefix -ScriptName 'deploy-visual-studio.ps1'
####################################################################################################
Invoke-ScriptWithPrefix -ScriptName 'deploy-cuda.ps1' -AddAdminPw
Invoke-ScriptWithPrefix -ScriptName 'deploy-mpi.ps1'
####################################################################################################
Invoke-ScriptWithPrefix -ScriptName 'deploy-cudnn.ps1' -CudnnUrl $CudnnUrl
Invoke-ScriptWithPrefix -ScriptName 'deploy-cuda.ps1'
####################################################################################################
Invoke-ScriptWithPrefix -ScriptName 'test-cudnn.ps1'
Invoke-ScriptWithPrefix -ScriptName 'deploy-cudnn.ps1'
####################################################################################################
Invoke-ScriptWithPrefix -ScriptName 'deploy-inteloneapi.ps1' -AddAdminPw
Invoke-ScriptWithPrefix -ScriptName 'deploy-inteloneapi.ps1'
####################################################################################################
Invoke-ScriptWithPrefix -ScriptName 'deploy-pwsh.ps1' -AddAdminPw
Invoke-ScriptWithPrefix -ScriptName 'deploy-pwsh.ps1'
####################################################################################################
Write-Progress `
-Activity $ProgressActivity `
-Status 'Running provisioning script deploy-settings.txt (as a .ps1) in VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$ProvisionImageResult = Invoke-AzVMRunCommandWithRetries `
-ResourceGroupName 'vcpkg-image-minting' `
-VMName $ProtoVMName `
-CommandId 'RunPowerShellScript' `
-ScriptPath "$Root\deploy-settings.txt"
Write-Host "deploy-settings.txt output: $($ProvisionImageResult.value.Message)"
Invoke-ScriptWithPrefix -ScriptName 'deploy-settings.txt' -SkipSas
Restart-AzVM -ResourceGroupName 'vcpkg-image-minting' -Name $ProtoVMName
####################################################################################################
Write-Progress `
-Activity $ProgressActivity `
-Status 'Running provisioning script sysprep.ps1 in VM' `
-PercentComplete (100 / $TotalProgress * $CurrentProgress++)
$SysprepResult = Invoke-AzVMRunCommandWithRetries `
-ResourceGroupName 'vcpkg-image-minting' `
-VMName $ProtoVMName `
-CommandId 'RunPowerShellScript' `
-ScriptPath "$Root\sysprep.ps1"
Write-Host "sysprep.ps1 output: $($SysprepResult.value.Message)"
Invoke-ScriptWithPrefix -ScriptName 'sysprep.ps1'
####################################################################################################
Write-Progress `

View File

@ -1,81 +1,65 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
param([string]$SasToken)
# REPLACE WITH UTILITY-PREFIX.ps1
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
. "$PSScriptRoot/utility-prefix.ps1"
}
# If you are running this script outside of our Azure VMs, you will need to download cudnn from NVIDIA and place
# it next to this script.
$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.1.0/network_installers/cuda_12.1.0_windows_network.exe'
[string]$CudaUrl
if ([string]::IsNullOrEmpty($SasToken)) {
$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.5.0/local_installers/cuda_12.5.0_555.85_windows.exe'
} else {
$SasToken = $SasToken.Replace('"', '')
$CudaUrl = "https://vcpkgimageminting.blob.core.windows.net/assets/cuda_12.5.0_555.85_windows.exe?$SasToken"
}
# https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html
# Intentionally omitted:
# demo_suite_12.1
# documentation_12.1
# nvvm_samples_12.1
# demo_suite_12.5
# documentation_12.5
# nvvm_samples_12.5
# visual_studio_integration_12.5
# Display.Driver
$CudaInstallerArgs = @(
DownloadAndInstall -Name 'CUDA' -Url $CudaUrl -Args @(
'-s',
'cublas_12.1',
'cublas_dev_12.1',
'cuda_profiler_api_12.1',
'cudart_12.1',
'cufft_12.1',
'cufft_dev_12.1',
'cuobjdump_12.1',
'cupti_12.1',
'curand_12.1',
'curand_dev_12.1',
'cusolver_12.1',
'cusolver_dev_12.1',
'cusparse_12.1',
'cusparse_dev_12.1',
'cuxxfilt_12.1',
'npp_12.1',
'npp_dev_12.1',
'nsight_compute_12.1',
'nsight_systems_12.1',
'nsight_vse_12.1',
'nvcc_12.1',
'nvdisasm_12.1',
'nvjitlink_12.1',
'nvjpeg_12.1',
'nvjpeg_dev_12.1',
'nvml_dev_12.1',
'nvprof_12.1',
'nvprune_12.1',
'nvrtc_12.1',
'nvrtc_dev_12.1',
'nvtx_12.1',
'occupancy_calculator_12.1',
'opencl_12.1',
'sanitizer_12.1',
'thrust_12.1',
'visual_profiler_12.1',
'visual_studio_integration_12.1'
'cublas_12.5',
'cublas_dev_12.5',
'cuda_profiler_api_12.5',
'cudart_12.5',
'cufft_12.5',
'cufft_dev_12.5',
'cuobjdump_12.5',
'cupti_12.5',
'curand_12.5',
'curand_dev_12.5',
'cusolver_12.5',
'cusolver_dev_12.5',
'cusparse_12.5',
'cusparse_dev_12.5',
'cuxxfilt_12.5',
'npp_12.5',
'npp_dev_12.5',
'nsight_compute_12.5',
'nsight_systems_12.5',
'nsight_vse_12.5',
'nvcc_12.5',
'nvdisasm_12.5',
'nvfatbin_12.5',
'nvjitlink_12.5',
'nvjpeg_12.5',
'nvjpeg_dev_12.5',
'nvml_dev_12.5',
'nvprof_12.5',
'nvprune_12.5',
'nvrtc_12.5',
'nvrtc_dev_12.5',
'nvtx_12.5',
'occupancy_calculator_12.5',
'opencl_12.5',
'sanitizer_12.5',
'thrust_12.5',
'visual_profiler_12.5',
'-n'
)
$destination = "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v12.1"
try {
Write-Host 'Downloading CUDA...'
[string]$installerPath = Get-TempFilePath -Extension 'exe'
curl.exe -L -o $installerPath -s -S $CudaUrl
Write-Host 'Installing CUDA...'
$proc = Start-Process -FilePath $installerPath -ArgumentList $CudaInstallerArgs -Wait -PassThru
$exitCode = $proc.ExitCode
if ($exitCode -eq 0) {
Write-Host 'Installation successful!'
}
else {
Write-Error "Installation failed! Exited with $exitCode."
throw
}
}
catch {
Write-Error "Failed to install CUDA! $($_.Exception.Message)"
throw
}

View File

@ -1,28 +1,24 @@
# REPLACE WITH UTILITY-PREFIX.ps1
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH CudnnUrl
param([string]$SasToken)
$destination = "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v12.1"
$CudnnLocalZipPath = "$PSScriptRoot\cudnn-windows-x86_64-8.8.1.3_cuda12-archive.zip"
try {
if (Test-Path $CudnnLocalZipPath) {
$cudnnZipPath = $CudnnLocalZipPath
} else {
Write-Host 'Attempting to download cudnn. If this fails, you need to agree to NVidia''s EULA, download cudnn, and place it next to this script.'
$cudnnZipPath = Get-TempFilePath -Extension 'zip'
& curl.exe -L -o $cudnnZipPath $CudnnUrl
if ($LASTEXITCODE -ne 0) {
throw 'Failed to download cudnn!'
}
}
Write-Host "Installing CUDNN to $destination..."
tar.exe -xvf "$cudnnZipPath" --strip 1 --directory "$destination"
Write-Host 'Installation successful!'
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
. "$PSScriptRoot/utility-prefix.ps1"
}
catch {
Write-Error "Failed to install CUDNN! $($_.Exception.Message)"
throw
[string]$CudnnUrl
if ([string]::IsNullOrEmpty($SasToken)) {
$CudnnUrl = 'https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-9.2.0.82_cuda12-archive.zip'
} else {
$SasToken = $SasToken.Replace('"', '')
$CudnnUrl = "https://vcpkgimageminting.blob.core.windows.net/assets/cudnn-windows-x86_64-9.2.0.82_cuda12-archive.zip?$SasToken"
}
DownloadAndUnzip -Name 'CUDNN' -Url $CudnnUrl -Destination "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v12.5"
if (Test-Path "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include\cudnn.h") {
Write-Host 'cudnn appears correctly installed'
} else {
Write-Error 'cudnn appears broken!'
}

View File

@ -1,7 +1,11 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH UTILITY-PREFIX.ps1
param([string]$SasToken)
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
. "$PSScriptRoot/utility-prefix.ps1"
}
<#
.SYNOPSIS

View File

@ -1,55 +1,64 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
param([string]$SasToken)
# REPLACE WITH UTILITY-PREFIX.ps1
$oneAPIBaseUrl = 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/19085/w_HPCKit_p_2023.0.0.25931_offline.exe'
$oneAPIHPCComponents = 'intel.oneapi.win.cpp-compiler:intel.oneapi.win.ifort-compiler'
<#
.SYNOPSIS
Installs Intel oneAPI compilers and toolsets. Examples for CI can be found here: https://github.com/oneapi-src/oneapi-ci
.DESCRIPTION
InstallInteloneAPI installs the Intel oneAPI Compiler & Toolkit with the components specified as a
:-separated list of strings in $Components.
.PARAMETER Url
The URL of the Intel Toolkit installer.
.PARAMETER Components
A :-separated list of components to install.
#>
Function InstallInteloneAPI {
Param(
[String]$Url,
[String]$Components
)
try {
[string]$installerPath = Get-TempFilePath -Extension 'exe'
[string]$extractionPath = [System.IO.Path]::GetTempPath() + [System.IO.Path]::GetRandomFileName()
Write-Host 'Downloading Intel oneAPI...to: ' $installerPath
curl.exe -L -o $installerPath -s -S $Url
Write-Host 'Extracting Intel oneAPI...to folder: ' $extractionPath
$proc = Start-Process -FilePath $installerPath -ArgumentList @('-s ', '-x ', '-f ' + $extractionPath , '--log extract.log') -Wait -PassThru
Write-Host 'Install Intel oneAPI...from folder: ' $extractionPath
$proc = Start-Process -FilePath $extractionPath/bootstrapper.exe -ArgumentList @('-s ', '--action install', "--components=$Components" , '--eula=accept', '-p=NEED_VS2017_INTEGRATION=0', '-p=NEED_VS2019_INTEGRATION=0', '-p=NEED_VS2022_INTEGRATION=0', '--log-dir=.') -Wait -PassThru
$exitCode = $proc.ExitCode
if ($exitCode -eq 0) {
Write-Host 'Installation successful!'
}
else {
Write-Error "Installation failed! Exited with $exitCode."
throw
}
}
catch {
Write-Error "Failed to install Intel oneAPI! $($_.Exception.Message)"
throw
}
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
. "$PSScriptRoot/utility-prefix.ps1"
}
InstallInteloneAPI -Url $oneAPIBaseUrl -Components $oneAPIHPCComponents
[string]$oneAPIBaseUrl
if ([string]::IsNullOrEmpty($SasToken)) {
$oneAPIBaseUrl = 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/c95a3b26-fc45-496c-833b-df08b10297b9/w_HPCKit_p_2024.1.0.561_offline.exe'
} else {
$SasToken = $SasToken.Replace('"', '')
$oneAPIBaseUrl = "https://vcpkgimageminting.blob.core.windows.net/assets/w_HPCKit_p_2024.1.0.561_offline.exe?$SasToken"
}
$oneAPIHPCComponents = 'intel.oneapi.win.ifort-compiler'
$LocalName = 'w_HPCKit_p_2024.1.0.561_offline.exe'
try {
[bool]$doRemove = $false
[string]$LocalPath = Join-Path $PSScriptRoot $LocalName
if (Test-Path $LocalPath) {
Write-Host "Using local Intel oneAPI..."
} else {
Write-Host "Downloading Intel oneAPI..."
$tempPath = Get-TempFilePath
New-Item -ItemType Directory -Path $tempPath -Force
$LocalPath = Join-Path $tempPath $LocalName
Invoke-WebRequest -Uri $oneAPIBaseUrl -Outfile $LocalPath
$doRemove = $true
}
[string]$extractionPath = Get-TempFilePath
Write-Host 'Extracting Intel oneAPI...to folder: ' $extractionPath
$proc = Start-Process -FilePath $LocalPath -ArgumentList @('-s ', '-x', '-f', $extractionPath) -Wait -PassThru
$exitCode = $proc.ExitCode
if ($exitCode -eq 0) {
Write-Host 'Extraction successful!'
} else {
Write-Error "Extraction failed! Exited with $exitCode."
throw
}
Write-Host 'Install Intel oneAPI...from folder: ' $extractionPath
$proc = Start-Process -FilePath "$extractionPath/bootstrapper.exe" -ArgumentList @('-s ', '--action install', "--components=$oneAPIHPCComponents" , '--eula=accept', '-p=NEED_VS2017_INTEGRATION=0', '-p=NEED_VS2019_INTEGRATION=0', '-p=NEED_VS2022_INTEGRATION=0', '--log-dir=.') -Wait -PassThru
$exitCode = $proc.ExitCode
if ($exitCode -eq 0) {
Write-Host 'Installation successful!'
} elseif ($exitCode -eq 3010) {
Write-Host 'Installation successful! Exited with 3010 (ERROR_SUCCESS_REBOOT_REQUIRED).'
} else {
Write-Error "Installation failed! Exited with $exitCode."
}
if ($doRemove) {
Remove-Item -Path $LocalPath -Force
}
} catch {
Write-Error "Installation failed! Exception: $($_.Exception.Message)"
}

View File

@ -1,47 +1,18 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
param([string]$SasToken)
# REPLACE WITH UTILITY-PREFIX.ps1
$MpiUrl = 'https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe'
<#
.SYNOPSIS
Installs MPI
.DESCRIPTION
Downloads the MPI installer located at $Url, and installs it with the
correct flags.
.PARAMETER Url
The URL of the installer.
#>
Function InstallMpi {
Param(
[String]$Url
)
try {
Write-Host 'Downloading MPI...'
[string]$installerPath = Get-TempFilePath -Extension 'exe'
curl.exe -L -o $installerPath -s -S $Url
Write-Host 'Installing MPI...'
$proc = Start-Process -FilePath $installerPath -ArgumentList @('-force', '-unattend') -Wait -PassThru
$exitCode = $proc.ExitCode
if ($exitCode -eq 0) {
Write-Host 'Installation successful!'
}
else {
Write-Error "Installation failed! Exited with $exitCode."
throw
}
}
catch {
Write-Error "Failed to install MPI! $($_.Exception.Message)"
throw
}
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
. "$PSScriptRoot/utility-prefix.ps1"
}
InstallMpi -Url $MpiUrl
[string]$MpiUrl
if ([string]::IsNullOrEmpty($SasToken)) {
$MpiUrl = 'https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe'
} else {
$SasToken = $SasToken.Replace('"', '')
$MpiUrl = "https://vcpkgimageminting.blob.core.windows.net/assets/msmpisetup.exe?$SasToken"
}
DownloadAndInstall -Name 'MSMPI' -Url $MpiUrl -Args @('-force', '-unattend')

View File

@ -1,8 +0,0 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$PsExecPath = 'C:\PsExec64.exe'
Write-Host "Downloading psexec to: $PsExecPath"
& curl.exe -L -o $PsExecPath -s -S https://live.sysinternals.com/PsExec64.exe

View File

@ -1,9 +1,18 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
param([string]$SasToken)
# REPLACE WITH UTILITY-PREFIX.ps1
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
. "$PSScriptRoot/utility-prefix.ps1"
}
$PwshUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.msi'
InstallMSI -Url $PwshUrl -Name 'PowerShell Core'
[string]$PwshUrl
if ([string]::IsNullOrEmpty($SasToken)) {
$PwshUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.msi'
} else {
$SasToken = $SasToken.Replace('"', '')
$PwshUrl = "https://vcpkgimageminting.blob.core.windows.net/assets/PowerShell-7.4.2-win-x64.msi?$SasToken"
}
DownloadAndInstall -Url $PwshUrl -Name 'PowerShell Core' -Args @('/quiet', '/norestart')

View File

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'

View File

@ -1,12 +1,15 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
param([string]$SasToken)
# REPLACE WITH UTILITY-PREFIX.ps1
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
. "$PSScriptRoot/utility-prefix.ps1"
}
# See https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history
$VisualStudioBootstrapperUrl = 'https://download.visualstudio.microsoft.com/download/pr/a8a3940c-d415-4078-8df8-6af787f56dfa/ff486670bce61323e52b208ecbb71dc05b034c8bf156d0b7bfc0ad67b2611445/vs_Enterprise.exe'
# 17.8.11
$VisualStudioBootstrapperUrl = 'https://download.visualstudio.microsoft.com/download/pr/107aa087-4efd-4262-87ee-dc15a68f8e76/873485fe8715c7d3f8f81dc2d6288dcba12400bc560e265e470cf34da50581af/vs_Enterprise.exe'
$Workloads = @(
'Microsoft.VisualStudio.Workload.NativeDesktop',
'Microsoft.VisualStudio.Workload.Universal',
@ -18,8 +21,8 @@ $Workloads = @(
'Microsoft.VisualStudio.Component.VC.ATLMFC',
'Microsoft.VisualStudio.Component.VC.ATL.ARM64',
'Microsoft.VisualStudio.Component.VC.MFC.ARM64',
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
"Microsoft.VisualStudio.Component.Windows10SDK.20348",
'Microsoft.VisualStudio.Component.Windows11SDK.22621',
'Microsoft.VisualStudio.Component.Windows10SDK.20348',
'Microsoft.Net.Component.4.8.SDK',
'Microsoft.Net.Component.4.7.2.TargetingPack',
'Microsoft.Component.NetFX.Native',
@ -29,62 +32,10 @@ $Workloads = @(
'Microsoft.VisualStudio.Component.VC.CMake.Project'
)
<#
.SYNOPSIS
Install Visual Studio.
.DESCRIPTION
InstallVisualStudio takes the $Workloads array, and installs it with the
installer that's pointed at by $BootstrapperUrl.
.PARAMETER Workloads
The set of VS workloads to install.
.PARAMETER BootstrapperUrl
The URL of the Visual Studio installer, i.e. one of vs_*.exe.
.PARAMETER InstallPath
The path to install Visual Studio at.
.PARAMETER Nickname
The nickname to give the installation.
#>
Function InstallVisualStudio {
Param(
[String[]]$Workloads,
[String]$BootstrapperUrl,
[String]$InstallPath = $null,
[String]$Nickname = $null
)
try {
Write-Host 'Downloading Visual Studio...'
[string]$bootstrapperExe = Get-TempFilePath -Extension 'exe'
curl.exe -L -o $bootstrapperExe -s -S $BootstrapperUrl
Write-Host 'Installing Visual Studio...'
$vsArgs = @('/c', $bootstrapperExe, '--quiet', '--norestart', '--wait', '--nocache')
foreach ($workload in $Workloads) {
$vsArgs += '--add'
$vsArgs += $workload
}
if (-not ([String]::IsNullOrWhiteSpace($InstallPath))) {
$vsArgs += '--installpath'
$vsArgs += $InstallPath
}
if (-not ([String]::IsNullOrWhiteSpace($Nickname))) {
$vsArgs += '--nickname'
$vsArgs += $Nickname
}
$proc = Start-Process -FilePath cmd.exe -ArgumentList $vsArgs -Wait -PassThru
PrintMsiExitCodeMessage $proc.ExitCode
}
catch {
Write-Error "Failed to install Visual Studio! $($_.Exception.Message)"
throw
}
$vsArgs = @('--quiet', '--norestart', '--wait', '--nocache')
foreach ($workload in $Workloads) {
$vsArgs += '--add'
$vsArgs += $workload
}
InstallVisualStudio -Workloads $Workloads -BootstrapperUrl $VisualStudioBootstrapperUrl -Nickname 'Stable'
DownloadAndInstall -Name 'Visual Studio' -Url $VisualStudioBootstrapperUrl -Args $vsArgs

View File

@ -1,46 +1,18 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
param([string]$SasToken)
# REPLACE WITH UTILITY-PREFIX.ps1
<#
.SYNOPSIS
Installs Windows PSDK/WDK
.DESCRIPTION
Downloads the Windows PSDK/DDK installer located at $Url, and installs it with the
correct flags.
.PARAMETER Url
The URL of the installer.
#>
Function InstallWindowsDK {
Param(
[String]$Url
)
try {
Write-Host "Downloading Windows PSDK or DDK $Url..."
[string]$installerPath = Get-TempFilePath -Extension 'exe'
curl.exe -L -o $installerPath -s -S $Url
Write-Host 'Installing...'
$proc = Start-Process -FilePath $installerPath -ArgumentList @('/features', '+', '/q') -Wait -PassThru
$exitCode = $proc.ExitCode
if ($exitCode -eq 0) {
Write-Host 'Installation successful!'
}
else {
Write-Error "Installation failed! Exited with $exitCode."
throw
}
}
catch {
Write-Error "Failed to install Windows PSDK or DDK! $($_.Exception.Message)"
throw
}
if (Test-Path "$PSScriptRoot/utility-prefix.ps1") {
. "$PSScriptRoot/utility-prefix.ps1"
}
# Windows 10 WDK, version 2004
InstallWindowsDK 'https://go.microsoft.com/fwlink/?linkid=2128854'
[string]$WdkUrl
if ([string]::IsNullOrEmpty($SasToken)) {
$WdkUrl = 'https://go.microsoft.com/fwlink/?linkid=2128854'
} else {
$SasToken = $SasToken.Replace('"', '')
$WdkUrl = "https://vcpkgimageminting.blob.core.windows.net/assets/wdksetup.exe?$SasToken"
}
DownloadAndInstall -Name 'Windows 10 WDK, version 2004' -Url $WdkUrl -Args @('/features', '+', '/q') -LocalName 'wdksetup.exe'

View File

@ -1,27 +0,0 @@
param(
[string]$AdminUserPassword = $null
)
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
if (-Not [string]::IsNullOrEmpty($AdminUserPassword)) {
$PsExecPath = 'C:\PsExec64.exe'
$PsExecArgs = @(
'-u',
'AdminUser',
'-p',
$AdminUserPassword,
'-accepteula',
'-i',
'-h',
'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe',
'-ExecutionPolicy',
'Unrestricted',
'-File',
$PSCommandPath
)
Write-Host "Executing: $PsExecPath $PsExecArgs"
$proc = Start-Process -FilePath $PsExecPath -ArgumentList $PsExecArgs -Wait -PassThru
exit $proc.ExitCode
}

View File

@ -1,14 +1,15 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: MIT
# This script runs all the scripts we run on Azure machines to deploy prerequisites,
# and assumes it is being run as an admin user.
. "$PSScriptRoot\utility-prefix.ps1"
. "$PSScriptRoot\deploy-tlssettings.ps1" -RebootIfRequired 0
. "$PSScriptRoot\deploy-azcopy.ps1"
. "$PSScriptRoot\deploy-windows-sdks.ps1"
. "$PSScriptRoot\deploy-visual-studio.ps1"
. "$PSScriptRoot\deploy-mpi.ps1"
. "$PSScriptRoot\deploy-cuda.ps1"
. "$PSScriptRoot\deploy-cudnn.ps1"
. "$PSScriptRoot\deploy-inteloneapi.ps1"
. "$PSScriptRoot\deploy-pwsh.ps1"
try {

View File

@ -2,6 +2,8 @@
# SPDX-License-Identifier: MIT
#
param([string]$SasToken)
<#
.SYNOPSIS
Prepares the virtual machine for imaging.

View File

@ -1,5 +0,0 @@
if (Test-Path "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include\cudnn.h") {
Write-Host 'cudnn appears correctly installed'
} else {
Write-Error 'cudnn appears broken!'
}

View File

@ -17,109 +17,134 @@ Function Get-TempFilePath {
[String]$Extension
)
if ([String]::IsNullOrWhiteSpace($Extension)) {
throw 'Missing Extension'
}
$tempPath = [System.IO.Path]::GetTempPath()
$tempName = [System.IO.Path]::GetRandomFileName() + '.' + $Extension
$tempName = [System.IO.Path]::GetRandomFileName()
if (-not [String]::IsNullOrWhiteSpace($Extension)) {
$tempName = $tempName + '.' + $Extension
}
return Join-Path $tempPath $tempName
}
<#
.SYNOPSIS
Writes a message to the screen depending on ExitCode.
Download and install a component.
.DESCRIPTION
Since msiexec can return either 0 or 3010 successfully, in both cases
we write that installation succeeded, and which exit code it exited with.
If msiexec returns anything else, we write an error.
DownloadAndInstall downloads an executable from the given URL, and runs it with the given command-line arguments.
.PARAMETER ExitCode
The exit code that msiexec returned.
.PARAMETER Name
The name of the component, to be displayed in logging messages.
.PARAMETER Url
The URL of the installer.
.PARAMETER Args
The command-line arguments to pass to the installer.
#>
Function PrintMsiExitCodeMessage {
Function DownloadAndInstall {
[CmdletBinding(PositionalBinding=$false)]
Param(
$ExitCode
[Parameter(Mandatory)][String]$Name,
[Parameter(Mandatory)][String]$Url,
[Parameter(Mandatory)][String[]]$Args,
[String]$LocalName = $null
)
# 3010 is probably ERROR_SUCCESS_REBOOT_REQUIRED
if ($ExitCode -eq 0 -or $ExitCode -eq 3010) {
Write-Host "Installation successful! Exited with $ExitCode."
}
else {
Write-Error "Installation failed! Exited with $ExitCode."
throw
try {
if ([string]::IsNullOrWhiteSpace($LocalName)) {
$LocalName = [uri]::new($Url).Segments[-1]
}
[bool]$doRemove = $false
[string]$LocalPath = Join-Path $PSScriptRoot $LocalName
if (Test-Path $LocalPath) {
Write-Host "Using local $Name..."
} else {
Write-Host "Downloading $Name..."
$tempPath = Get-TempFilePath
New-Item -ItemType Directory -Path $tempPath -Force | Out-Null
$LocalPath = Join-Path $tempPath $LocalName
Invoke-WebRequest -Uri $Url -OutFile $LocalPath
$doRemove = $true
}
Write-Host "Installing $Name..."
$proc = Start-Process -FilePath $LocalPath -ArgumentList $Args -Wait -PassThru
$exitCode = $proc.ExitCode
if ($exitCode -eq 0) {
Write-Host 'Installation successful!'
} elseif ($exitCode -eq 3010) {
Write-Host 'Installation successful! Exited with 3010 (ERROR_SUCCESS_REBOOT_REQUIRED).'
} else {
Write-Error "Installation failed! Exited with $exitCode."
}
if ($doRemove) {
Remove-Item -Path $LocalPath -Force
}
} catch {
Write-Error "Installation failed! Exception: $($_.Exception.Message)"
}
}
<#
.SYNOPSIS
Install a .msi file.
Download and install a zip file component.
.DESCRIPTION
InstallMSI takes a url where an .msi lives, and installs that .msi to the system.
DownloadAndUnzip downloads a zip from the given URL, and extracts it to the indicated path.
.PARAMETER Name
The name of the thing to install.
The name of the component, to be displayed in logging messages.
.PARAMETER Url
The URL at which the .msi lives.
The URL of the zip to download.
.PARAMETER Destination
The location to which the zip should be extracted
#>
Function InstallMSI {
Function DownloadAndUnzip {
[CmdletBinding(PositionalBinding=$false)]
Param(
[String]$Name,
[String]$Url
[Parameter(Mandatory)][String]$Name,
[Parameter(Mandatory)][String]$Url,
[Parameter(Mandatory)][String]$Destination
)
try {
Write-Host "Downloading $Name..."
[string]$msiPath = Get-TempFilePath -Extension 'msi'
curl.exe -L -o $msiPath -s -S $Url
Write-Host "Installing $Name..."
$args = @('/i', $msiPath, '/norestart', '/quiet', '/qn')
$proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru
PrintMsiExitCodeMessage $proc.ExitCode
}
catch {
Write-Error "Failed to install $Name! $($_.Exception.Message)"
throw
}
}
<#
.SYNOPSIS
Unpacks a zip file to $Dir.
.DESCRIPTION
InstallZip takes a URL of a zip file, and unpacks the zip file to the directory
$Dir.
.PARAMETER Name
The name of the tool being installed.
.PARAMETER Url
The URL of the zip file to unpack.
.PARAMETER Dir
The directory to unpack the zip file to.
#>
Function InstallZip {
Param(
[String]$Name,
[String]$Url,
[String]$Dir
)
try {
Write-Host "Downloading $Name..."
[string]$zipPath = Get-TempFilePath -Extension 'zip'
curl.exe -L -o $zipPath -s -S $Url
Write-Host "Installing $Name..."
Expand-Archive -Path $zipPath -DestinationPath $Dir -Force
}
catch {
Write-Error "Failed to install $Name! $($_.Exception.Message)"
throw
$fileName = [uri]::new($Url).Segments[-1]
if ([string]::IsNullOrWhiteSpace($LocalName)) {
$LocalName = $fileName
}
[string]$zipPath
[bool]$doRemove = $false
[string]$LocalPath = Join-Path $PSScriptRoot $LocalName
if (Test-Path $LocalPath) {
Write-Host "Using local $Name..."
$zipPath = $LocalPath
} else {
$tempPath = Get-TempFilePath
New-Item -ItemType Directory -Path $tempPath -Force | Out-Null
$zipPath = Join-Path $tempPath $LocalName
Write-Host "Downloading $Name ( $Url -> $zipPath )..."
Invoke-WebRequest -Uri $Url -OutFile $zipPath
$doRemove = $true
}
Write-Host "Installing $Name to $Destination..."
& tar.exe -xvf $zipPath --strip 1 --directory $Destination
if ($LASTEXITCODE -eq 0) {
Write-Host 'Installation successful!'
} else {
Write-Error "Installation failed! Exited with $LASTEXITCODE."
}
if ($doRemove) {
Remove-Item -Path $zipPath -Force
}
} catch {
Write-Error "Installation failed! Exception: $($_.Exception.Message)"
}
}

View File

@ -75,8 +75,8 @@ if(NOT _VCPKG_WINDOWS_TOOLCHAIN)
set(MP_BUILD_FLAG "/MP ")
endif()
set(CMAKE_CXX_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc ${MP_BUILD_FLAG}${VCPKG_CXX_FLAGS}" CACHE STRING "")
set(CMAKE_C_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} ${MP_BUILD_FLAG}${VCPKG_C_FLAGS}" CACHE STRING "")
set(CMAKE_CXX_FLAGS " /nologo /DWIN32 /D_WINDOWS ${CHARSET_FLAG} /GR /EHsc ${MP_BUILD_FLAG}${VCPKG_CXX_FLAGS}" CACHE STRING "")
set(CMAKE_C_FLAGS " /nologo /DWIN32 /D_WINDOWS ${CHARSET_FLAG} ${MP_BUILD_FLAG}${VCPKG_C_FLAGS}" CACHE STRING "")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64ec")
string(APPEND CMAKE_CXX_FLAGS " /arm64EC /D_AMD64_ /DAMD64 /D_ARM64EC_ /DARM64EC")

View File

@ -5094,7 +5094,7 @@
},
"libtorch": {
"baseline": "2.1.2",
"port-version": 2
"port-version": 3
},
"libtorrent": {
"baseline": "2.0.10",
@ -6490,7 +6490,7 @@
},
"opencv4": {
"baseline": "4.8.0",
"port-version": 20
"port-version": 21
},
"opendnp3": {
"baseline": "3.1.1",
@ -8994,7 +8994,7 @@
},
"unittest-cpp": {
"baseline": "2.0.0",
"port-version": 5
"port-version": 6
},
"unixodbc": {
"baseline": "2.3.11",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cfd452fa297b8737790b9dae9db4bd027e47955e",
"version": "2.1.2",
"port-version": 3
},
{
"git-tree": "dc47289cdf640ce30bdd1039a49264c8381c2b19",
"version": "2.1.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "946d30019e6bcb9e6043c4b18a9dbe1b719694af",
"version": "4.8.0",
"port-version": 21
},
{
"git-tree": "8dd122a2581222cac0021f986a37159ad5db5949",
"version": "4.8.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f08f75e492c6863c5ef34c67dd083035170fa7c4",
"version-semver": "2.0.0",
"port-version": 6
},
{
"git-tree": "bb7c434ff783ab8c87dfa014eb7142d4ca4727da",
"version-semver": "2.0.0",