From 6dc54db3f45b06c9d7b8a80d7d59ea1093cbe11e Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 11 Aug 2022 06:16:22 -0700 Subject: [PATCH 01/12] Introducing pytorch-cuda metapackage --- .circleci/unittest/linux/scripts/install.sh | 8 +++----- packaging/build_conda.sh | 14 +------------- packaging/pkg_helpers.bash | 5 ++++- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index 34bae52120..9e7da8f0de 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -34,12 +34,10 @@ else version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" export CUDATOOLKIT_CHANNEL="nvidia" - cuda_toolkit_pckg="cudatoolkit" - if [[ "$CU_VERSION" == cu116 ]]; then - export CUDATOOLKIT_CHANNEL="nvidia/label/cuda-11.6.2" - cuda_toolkit_pckg="cuda" + cudatoolkit="nvidia::cudatoolkit=${version}" + if [[ "$version" == "11.6" || "$version" == "11.7" ]]; then + cudatoolkit=" pytorch-cuda=${version}" fi - cudatoolkit="${cuda_toolkit_pckg}=${version}" fi printf "Installing PyTorch with %s\n" "${cudatoolkit}" diff --git a/packaging/build_conda.sh b/packaging/build_conda.sh index 04eba64517..9f37a5582b 100755 --- a/packaging/build_conda.sh +++ b/packaging/build_conda.sh @@ -13,21 +13,9 @@ setup_conda_pytorch_constraint setup_conda_cudatoolkit_constraint setup_visual_studio_constraint -# nvidia channel included for cudatoolkit >= 11 however for 11.5 we use conda-forge -# HACK HACK HACK: Remove PYTHON_VERSION check once https://github.com/pytorch/builder/pull/961 is merged export CUDATOOLKIT_CHANNEL="nvidia" -# NOTE: This is needed because `cudatoolkit=11.5` has a dependency on conda-forge -# See: https://github.com/pytorch/audio/pull/2224#issuecomment-1049185550 -export CUDA116_CUDA_DEPENDENCY="" -if [[ ${CU_VERSION} = "cu116" ]]; then - export CUDATOOLKIT_CHANNEL="nvidia/label/cuda-11.6.2" - export CUDA116_CUDA_DEPENDENCY="cuda" -elif [[ ! -z ${CU_VERSION} ]]; then - export CUDA116_CUDA_DEPENDENCY="cudatoolkit" -fi - # NOTE: There are some dependencies that are not available for macOS on Python 3.10 without conda-forge if [[ ${OSTYPE} =~ darwin* ]] && [[ ${PYTHON_VERSION} = "3.10" ]]; then CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c conda-forge" fi -conda build -c defaults -c $CUDATOOLKIT_CHANNEL ${CONDA_CHANNEL_FLAGS:-} --no-anaconda-upload --python "$PYTHON_VERSION" $CUDA116_CUDA_DEPENDENCY packaging/torchaudio +conda build -c defaults -c $CUDATOOLKIT_CHANNEL ${CONDA_CHANNEL_FLAGS:-} --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torchaudio diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 6ceb587db7..6e668edff2 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -237,8 +237,11 @@ setup_conda_cudatoolkit_constraint() { export CONDA_BUILD_VARIANT="cpu" else case "$CU_VERSION" in + cu117) + export CONDA_CUDATOOLKIT_CONSTRAINT="- pytorch-cuda=11.7 # [not osx]" + ;; cu116) - export CONDA_CUDATOOLKIT_CONSTRAINT="" + export CONDA_CUDATOOLKIT_CONSTRAINT="- pytorch-cuda=11.6 # [not osx]" ;; cu113) export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=11.3,<11.4 # [not osx]" From 02248149a158d56065acd8847cdd17a5de9b4df1 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 11 Aug 2022 06:34:20 -0700 Subject: [PATCH 02/12] Fix unit test script --- .circleci/unittest/linux/scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index 9e7da8f0de..dc120f14f0 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -34,7 +34,7 @@ else version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" export CUDATOOLKIT_CHANNEL="nvidia" - cudatoolkit="nvidia::cudatoolkit=${version}" + cudatoolkit="cudatoolkit=${version}" if [[ "$version" == "11.6" || "$version" == "11.7" ]]; then cudatoolkit=" pytorch-cuda=${version}" fi From 71663e9c42e772ec1c5e6e6b861eb28a522fce98 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 11 Aug 2022 08:52:57 -0700 Subject: [PATCH 03/12] Add cuda home variable --- packaging/torchaudio/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/torchaudio/meta.yaml b/packaging/torchaudio/meta.yaml index cf6cf1efc6..344ef0a2b7 100644 --- a/packaging/torchaudio/meta.yaml +++ b/packaging/torchaudio/meta.yaml @@ -45,6 +45,7 @@ build: script_env: - BUILD_VERSION - USE_CUDA + - CUDA_HOME - TORCH_CUDA_ARCH_LIST - USE_FFMPEG - USE_OPENMP From 02f42eb0b7316b6200799d04e76d2650c47f1f03 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 11 Aug 2022 09:34:54 -0700 Subject: [PATCH 04/12] Testing CUDA_HOME inclusion --- tools/setup_helpers/extension.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/setup_helpers/extension.py b/tools/setup_helpers/extension.py index f5c8c89155..b2dd0b110b 100644 --- a/tools/setup_helpers/extension.py +++ b/tools/setup_helpers/extension.py @@ -7,6 +7,7 @@ import torch from setuptools import Extension from setuptools.command.build_ext import build_ext +from torch.utils.cpp_extension import CUDA_HOME __all__ = [ "get_ext_modules", @@ -44,25 +45,29 @@ def _get_build(var, default=False): def get_ext_modules(): + cuda_libs = os.path.join(CUDA_HOME, "lib64") + cuda_inc = os.path.join(CUDA_HOME, "include") + modules = [ - Extension(name="torchaudio.lib.libtorchaudio", sources=[]), - Extension(name="torchaudio._torchaudio", sources=[]), + Extension(name="torchaudio.lib.libtorchaudio", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), + Extension(name="torchaudio._torchaudio", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs] ), ] if _BUILD_CTC_DECODER: modules.extend( [ - Extension(name="torchaudio.lib.libflashlight-text", sources=[]), - Extension(name="torchaudio.flashlight_lib_text_decoder", sources=[]), - Extension(name="torchaudio.flashlight_lib_text_dictionary", sources=[]), + Extension(name="torchaudio.lib.libflashlight-text", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), + Extension(name="torchaudio.flashlight_lib_text_decoder", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), + Extension(name="torchaudio.flashlight_lib_text_dictionary", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), ] ) if _USE_FFMPEG: modules.extend( [ - Extension(name="torchaudio.lib.libtorchaudio_ffmpeg", sources=[]), - Extension(name="torchaudio._torchaudio_ffmpeg", sources=[]), + Extension(name="torchaudio.lib.libtorchaudio_ffmpeg", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), + Extension(name="torchaudio._torchaudio_ffmpeg", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), ] ) + return modules From 4060d206d89030c199280ba201194b2a53c6f2f5 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 11 Aug 2022 13:11:28 -0700 Subject: [PATCH 05/12] Fix CUDA compiler setting --- tools/setup_helpers/extension.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tools/setup_helpers/extension.py b/tools/setup_helpers/extension.py index b2dd0b110b..45d2dd735b 100644 --- a/tools/setup_helpers/extension.py +++ b/tools/setup_helpers/extension.py @@ -7,7 +7,6 @@ import torch from setuptools import Extension from setuptools.command.build_ext import build_ext -from torch.utils.cpp_extension import CUDA_HOME __all__ = [ "get_ext_modules", @@ -45,29 +44,25 @@ def _get_build(var, default=False): def get_ext_modules(): - cuda_libs = os.path.join(CUDA_HOME, "lib64") - cuda_inc = os.path.join(CUDA_HOME, "include") - modules = [ - Extension(name="torchaudio.lib.libtorchaudio", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), - Extension(name="torchaudio._torchaudio", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs] ), + Extension(name="torchaudio.lib.libtorchaudio", sources=[]), + Extension(name="torchaudio._torchaudio", sources=[]), ] if _BUILD_CTC_DECODER: modules.extend( [ - Extension(name="torchaudio.lib.libflashlight-text", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), - Extension(name="torchaudio.flashlight_lib_text_decoder", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), - Extension(name="torchaudio.flashlight_lib_text_dictionary", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), + Extension(name="torchaudio.lib.libflashlight-text", sources=[]), + Extension(name="torchaudio.flashlight_lib_text_decoder", sources=[]), + Extension(name="torchaudio.flashlight_lib_text_dictionary", sources=[]), ] ) if _USE_FFMPEG: modules.extend( [ - Extension(name="torchaudio.lib.libtorchaudio_ffmpeg", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), - Extension(name="torchaudio._torchaudio_ffmpeg", sources=[], include_dirs=[cuda_inc], library_dirs=[cuda_libs]), + Extension(name="torchaudio.lib.libtorchaudio_ffmpeg", sources=[]), + Extension(name="torchaudio._torchaudio_ffmpeg", sources=[]), ] ) - return modules @@ -124,6 +119,10 @@ def build_extension(self, ext): _arches = [arch[:-4] if arch.endswith("+PTX") else f"{arch}-real" for arch in _arches] cmake_args += [f"-DCMAKE_CUDA_ARCHITECTURES={';'.join(_arches)}"] + if CUDA_HOME is not None: + cmake_args += [f"-DCMAKE_CUDA_COMPILER='{CUDA_HOME}/bin/nvcc'"] + cmake_args += [f"-DCUDA_TOOLKIT_ROOT_DIR='{CUDA_HOME}'"] + # Default to Ninja if "CMAKE_GENERATOR" not in os.environ or platform.system() == "Windows": cmake_args += ["-GNinja"] From 3ab408b70fbc52df2689b4d073b9819510a47dbc Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 11 Aug 2022 13:19:59 -0700 Subject: [PATCH 06/12] Include CUDA_HOME --- tools/setup_helpers/extension.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/setup_helpers/extension.py b/tools/setup_helpers/extension.py index 45d2dd735b..cdc4e088ae 100644 --- a/tools/setup_helpers/extension.py +++ b/tools/setup_helpers/extension.py @@ -7,6 +7,7 @@ import torch from setuptools import Extension from setuptools.command.build_ext import build_ext +from torch.utils.cpp_extension import CUDA_HOME __all__ = [ "get_ext_modules", From e04b7d017ae4d1c7ba5ebebb8aee6209b59e37aa Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 11 Aug 2022 13:21:56 -0700 Subject: [PATCH 07/12] Remove whitespace --- .circleci/unittest/linux/scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index dc120f14f0..709d071991 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -36,7 +36,7 @@ else export CUDATOOLKIT_CHANNEL="nvidia" cudatoolkit="cudatoolkit=${version}" if [[ "$version" == "11.6" || "$version" == "11.7" ]]; then - cudatoolkit=" pytorch-cuda=${version}" + cudatoolkit="pytorch-cuda=${version}" fi fi From 18437778894c7145846593ebcdac6072279b0bfd Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 11 Aug 2022 14:11:41 -0700 Subject: [PATCH 08/12] Remove windows from the CUDA cmake flags --- tools/setup_helpers/extension.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/setup_helpers/extension.py b/tools/setup_helpers/extension.py index cdc4e088ae..3eddef379c 100644 --- a/tools/setup_helpers/extension.py +++ b/tools/setup_helpers/extension.py @@ -120,7 +120,7 @@ def build_extension(self, ext): _arches = [arch[:-4] if arch.endswith("+PTX") else f"{arch}-real" for arch in _arches] cmake_args += [f"-DCMAKE_CUDA_ARCHITECTURES={';'.join(_arches)}"] - if CUDA_HOME is not None: + if platform.system() != "Windows" and CUDA_HOME is not None: cmake_args += [f"-DCMAKE_CUDA_COMPILER='{CUDA_HOME}/bin/nvcc'"] cmake_args += [f"-DCUDA_TOOLKIT_ROOT_DIR='{CUDA_HOME}'"] From 9c3ec1975319794d1291b3f0cb9d0f91a4f5f219 Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 12 Aug 2022 06:20:46 -0700 Subject: [PATCH 09/12] Fix smoke tests for 11.6 --- .circleci/config.yml.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index be3be2e381..3a33b1e40c 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -478,7 +478,7 @@ jobs: set -x source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION} if [[ "$CU_VERSION" == cu116 ]]; then - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia/label/cuda-11.6.2 pytorch cuda=${CU_VERSION:2:2}.${CU_VERSION:4} + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge fi @@ -566,7 +566,7 @@ jobs: # Include numpy and cudatoolkit in the install conda-forge chanell is used for cudatoolkit if [[ "$CU_VERSION" == cu116 ]]; then - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia/label/cuda-11.6.2 pytorch numpy ffmpeg cuda=${CU_VERSION:2:2}.${CU_VERSION:4} + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy ffmpeg pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch numpy ffmpeg cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge fi @@ -826,7 +826,7 @@ jobs: set -x source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION} if [[ "$CU_VERSION" == cu116 ]]; then - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia/label/cuda-11.6.2 pytorch cuda=${CU_VERSION:2:2}.${CU_VERSION:4} + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge fi From dd0e04e0f98360b4b2d6dd8ed640f8031c1c8eb6 Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 12 Aug 2022 06:30:41 -0700 Subject: [PATCH 10/12] Trying to fix builds --- .circleci/config.yml | 16 ++++++---------- .circleci/config.yml.in | 10 +++------- packaging/vs2019/conda_build_config.yaml | 3 +-- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f5987b619..1d5be554db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -387,10 +387,6 @@ jobs: eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" conda activate base conda install -yq conda-build "conda-package-handling!=1.5.0" - # cudatoolkit >= 11 isn't available for windows in the nvidia channel - if [[ "${CU_VERSION}" =~ cu11.* ]]; then - export CONDA_CHANNEL_FLAGS="-c conda-forge" - fi export FFMPEG_ROOT="${PWD}/third_party/ffmpeg" bash packaging/build_conda.sh environment: @@ -478,9 +474,9 @@ jobs: set -x source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION} if [[ "$CU_VERSION" == cu116 ]]; then - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia/label/cuda-11.6.2 pytorch cuda=${CU_VERSION:2:2}.${CU_VERSION:4} + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} fi conda install -v -y -c file://$HOME/workspace/conda-bld torchaudio - checkout @@ -566,9 +562,9 @@ jobs: # Include numpy and cudatoolkit in the install conda-forge chanell is used for cudatoolkit if [[ "$CU_VERSION" == cu116 ]]; then - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia/label/cuda-11.6.2 pytorch numpy ffmpeg cuda=${CU_VERSION:2:2}.${CU_VERSION:4} + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy ffmpeg pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch numpy ffmpeg cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch numpy ffmpeg cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} fi # Install from torchaudio file conda install -v -y $(ls ~/workspace/conda-bld/win-64/torchaudio*.tar.bz2) @@ -826,9 +822,9 @@ jobs: set -x source /usr/local/etc/profile.d/conda.sh && conda activate python${PYTHON_VERSION} if [[ "$CU_VERSION" == cu116 ]]; then - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia/label/cuda-11.6.2 pytorch cuda=${CU_VERSION:2:2}.${CU_VERSION:4} + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} fi conda install -v -y -c file://$HOME/workspace/conda-bld torchaudio # gxx_linux-64 is for installing pesq library that depends on cython diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 3a33b1e40c..5becf7a27b 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -387,10 +387,6 @@ jobs: eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" conda activate base conda install -yq conda-build "conda-package-handling!=1.5.0" - # cudatoolkit >= 11 isn't available for windows in the nvidia channel - if [[ "${CU_VERSION}" =~ cu11.* ]]; then - export CONDA_CHANNEL_FLAGS="-c conda-forge" - fi export FFMPEG_ROOT="${PWD}/third_party/ffmpeg" bash packaging/build_conda.sh environment: @@ -480,7 +476,7 @@ jobs: if [[ "$CU_VERSION" == cu116 ]]; then conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} fi conda install -v -y -c file://$HOME/workspace/conda-bld torchaudio - checkout @@ -568,7 +564,7 @@ jobs: if [[ "$CU_VERSION" == cu116 ]]; then conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch numpy ffmpeg pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch numpy ffmpeg cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch numpy ffmpeg cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} fi # Install from torchaudio file conda install -v -y $(ls ~/workspace/conda-bld/win-64/torchaudio*.tar.bz2) @@ -828,7 +824,7 @@ jobs: if [[ "$CU_VERSION" == cu116 ]]; then conda install -v -y -c pytorch-${UPLOAD_CHANNEL} -c nvidia pytorch pytorch-cuda=${CU_VERSION:2:2}.${CU_VERSION:4} else - conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} -c conda-forge + conda install -v -y -c pytorch-${UPLOAD_CHANNEL} pytorch cudatoolkit=${CU_VERSION:2:2}.${CU_VERSION:4} fi conda install -v -y -c file://$HOME/workspace/conda-bld torchaudio # gxx_linux-64 is for installing pesq library that depends on cython diff --git a/packaging/vs2019/conda_build_config.yaml b/packaging/vs2019/conda_build_config.yaml index 358052ec01..7bd8de2ea5 100644 --- a/packaging/vs2019/conda_build_config.yaml +++ b/packaging/vs2019/conda_build_config.yaml @@ -5,8 +5,7 @@ c_compiler: cxx_compiler: - vs2019 # [win] python: - - 3.5 - - 3.6 + - 3.7 # This differs from target_platform in that it determines what subdir the compiler # will target, not what subdir the compiler package will be itself. # For example, we need a win-64 vs2008_win-32 package, so that we compile win-32 From 0961102ae19a702c2dbb77b4fafadc62cb9f9387 Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 12 Aug 2022 06:35:41 -0700 Subject: [PATCH 11/12] Fix the PATH for windows --- packaging/pkg_helpers.bash | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 6e668edff2..eb519dbe94 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -81,8 +81,12 @@ setup_cuda() { ;; esac if [[ -n "$CUDA_HOME" ]]; then - # Adds nvcc binary to the search path so that CMake's `find_package(CUDA)` will pick the right one - export PATH="$CUDA_HOME/bin:$PATH" + if [[ "$OSTYPE" == "msys" ]]; then + export PATH="$CUDA_HOME\\bin:$PATH" + else + # Adds nvcc binary to the search path so that CMake's `find_package(CUDA)` will pick the right one + export PATH="$CUDA_HOME/bin:$PATH" + fi export USE_CUDA=1 fi } From 46227918fd7699ae9726174bb2325fb858fa22b4 Mon Sep 17 00:00:00 2001 From: atalman Date: Fri, 12 Aug 2022 07:19:12 -0700 Subject: [PATCH 12/12] Fix version extraction in windows --- packaging/pkg_helpers.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index eb519dbe94..09f9fb4f6a 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -213,7 +213,11 @@ setup_conda_pytorch_constraint() { CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS}" if [[ -z "$PYTORCH_VERSION" ]]; then export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch-nightly" - export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | python3 -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")" + if [[ "$OSTYPE" == "msys" ]]; then + export PYTORCH_VERSION="$(conda search --json -c pytorch-nightly pytorch | python -c "import sys, json; data=json.load(sys.stdin); print(data['pytorch'][-1]['version'])")" + else + export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | python3 -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")" + fi else export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch -c pytorch-test -c pytorch-nightly" fi