diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a09c45e507..bcd0f365bd0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,13 @@ version: 2.1 orbs: win: circleci/windows@2.0.0 +executors: + windows-gpu-prototype: + machine: + resource_class: windows.gpu.small.prototype + image: windows-server-2019-nvidia:201908-28 + shell: bash.exe + commands: checkout_merge: description: "checkout merge branch" @@ -184,6 +191,20 @@ jobs: bash packaging/build_conda.sh shell: powershell.exe + binary_win_conda_cuda: + <<: *binary_common + executor: windows-gpu-prototype + steps: + - checkout_merge + - run: + command: | + choco install miniconda3 + (& "C:\tools\miniconda3\Scripts\conda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression + conda activate base + conda install -yq conda-build "conda-package-handling!=1.5.0" + bash packaging/build_conda.sh + shell: powershell.exe + binary_macos_wheel: <<: *binary_common macos: @@ -485,6 +506,10 @@ workflows: name: torchvision_win_py3.6_cpu python_version: "3.6" cu_version: "cpu" + - binary_win_conda_cuda: + name: torchvision_win_py3.6_cu101 + python_version: "3.6" + cu_version: "cu101" nightly: jobs: diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 16687a4724f..7ed762fe5e5 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -9,6 +9,13 @@ version: 2.1 orbs: win: circleci/windows@2.0.0 +executors: + windows-gpu-prototype: + machine: + resource_class: windows.gpu.small.prototype + image: windows-server-2019-nvidia:201908-28 + shell: bash.exe + commands: checkout_merge: description: "checkout merge branch" @@ -184,6 +191,20 @@ jobs: bash packaging/build_conda.sh shell: powershell.exe + binary_win_conda_cuda: + <<: *binary_common + executor: windows-gpu-prototype + steps: + - checkout_merge + - run: + command: | + choco install miniconda3 + (& "C:\tools\miniconda3\Scripts\conda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression + conda activate base + conda install -yq conda-build "conda-package-handling!=1.5.0" + bash packaging/build_conda.sh + shell: powershell.exe + binary_macos_wheel: <<: *binary_common macos: @@ -284,6 +305,10 @@ workflows: name: torchvision_win_py3.6_cpu python_version: "3.6" cu_version: "cpu" + - binary_win_conda_cuda: + name: torchvision_win_py3.6_cu101 + python_version: "3.6" + cu_version: "cu101" nightly: {%- endif %} diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 594906ddb73..b999894901a 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -50,21 +50,33 @@ setup_cuda() { # Now work out the CUDA settings case "$CU_VERSION" in cu101) - export CUDA_HOME=/usr/local/cuda-10.1/ + if [[ "$OSTYPE" == "msys" ]]; then + export CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1" + else + export CUDA_HOME=/usr/local/cuda-10.1/ + fi export FORCE_CUDA=1 # Hard-coding gencode flags is temporary situation until # https://github.com/pytorch/pytorch/pull/23408 lands export NVCC_FLAGS="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50" ;; cu100) - export CUDA_HOME=/usr/local/cuda-10.0/ + if [[ "$OSTYPE" == "msys" ]]; then + export CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0" + else + export CUDA_HOME=/usr/local/cuda-10.0/ + fi export FORCE_CUDA=1 # Hard-coding gencode flags is temporary situation until # https://github.com/pytorch/pytorch/pull/23408 lands export NVCC_FLAGS="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50" ;; cu92) - export CUDA_HOME=/usr/local/cuda-9.2/ + if [[ "$OSTYPE" == "msys" ]]; then + export CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2" + else + export CUDA_HOME=/usr/local/cuda-9.2/ + fi export FORCE_CUDA=1 export NVCC_FLAGS="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_50,code=compute_50" ;; diff --git a/packaging/torchvision/bld.bat b/packaging/torchvision/bld.bat index 870759c67b7..73f217c2cf1 100644 --- a/packaging/torchvision/bld.bat +++ b/packaging/torchvision/bld.bat @@ -3,14 +3,14 @@ set TORCHVISION_BUILD_VERSION=%PKG_VERSION% set TORCHVISION_BUILD_NUMBER=%PKG_BUILDNUM% -if not "%CUDA_VERSION%" == "None" ( - set build_with_cuda=1 - set desired_cuda=%CUDA_VERSION:~0,-1%.%CUDA_VERSION:~-1,1% -) else ( - set build_with_cuda= -) +set build_with_cuda= -if "%build_with_cuda%" == "" goto cuda_flags_end +if "%CUDA_VERSION%" == "None" goto cuda_flags_end +if "%CUDA_VERSION%" == "cpu" goto cuda_flags_end +if "%CUDA_VERSION%" == "" goto cuda_flags_end + +set build_with_cuda=1 +set desired_cuda=%CUDA_VERSION:~0,-1%.%CUDA_VERSION:~-1,1% set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%desired_cuda% set CUDA_BIN_PATH=%CUDA_PATH%\bin