You need to sign in or sign up before continuing.
Unverified Commit c22962d1 authored by Yi Zhang's avatar Yi Zhang Committed by GitHub
Browse files

check torch installation before building package. (#1867)

* check cuda installation

* check in build.sh

* use USE_CUDA

* Update pkg_helpers.bash

* Fix typo
parent bf580c75
#!/usr/bin/env bash #!/usr/bin/env bash
set -ex set -ex
torch_cuda_version=$(python -c "import torch; print(torch.version.cuda)")
echo torch.cuda.version is $torch_cuda_version
echo USE_CUDA is "$USE_CUDA"
shopt -s nocasematch
if [ "${USE_CUDA}" == "1" ] ; then
if [ "$torch_cuda_version" == "None" ]; then
echo "We want to build torch auido with cuda but the installed pytorch isn't with cuda"
exit 1
fi
fi
shopt -u nocasematch
python setup.py install --single-version-externally-managed --record=record.txt python setup.py install --single-version-externally-managed --record=record.txt
...@@ -31,8 +31,8 @@ build: ...@@ -31,8 +31,8 @@ build:
string: py{{py}}_{{ environ.get('CU_VERSION', 'cpu') }} string: py{{py}}_{{ environ.get('CU_VERSION', 'cpu') }}
script_env: script_env:
- BUILD_VERSION - BUILD_VERSION
- USE_CUDA # [not win] - USE_CUDA
- TORCH_CUDA_ARCH_LIST # [not win] - TORCH_CUDA_ARCH_LIST
features: features:
{{ environ.get('CONDA_CPUONLY_FEATURE', '') }} {{ environ.get('CONDA_CPUONLY_FEATURE', '') }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment