Unverified Commit c4b5b67d authored by Yi Zhang's avatar Yi Zhang Committed by GitHub
Browse files

improve installing nightly pytorch (#4788)



* improve download nightly pytorch

* update unitest cuda to 11.3

* add nvjpeg in cuda 11.3

* avoid catching exception

* restore to cu111

* Update install.sh

* use conda MatchSpec string

* update linux

* for linux

* Update install.sh
Co-authored-by: default avatarNikita Shulga <nshulga@fb.com>
parent 72054ca0
...@@ -12,6 +12,7 @@ conda activate ./env ...@@ -12,6 +12,7 @@ conda activate ./env
if [ "${CU_VERSION:-}" == cpu ] ; then if [ "${CU_VERSION:-}" == cpu ] ; then
cudatoolkit="cpuonly" cudatoolkit="cpuonly"
version="cpu"
else else
if [[ ${#CU_VERSION} -eq 4 ]]; then if [[ ${#CU_VERSION} -eq 4 ]]; then
CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}" CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}"
...@@ -23,8 +24,17 @@ else ...@@ -23,8 +24,17 @@ else
cudatoolkit="cudatoolkit=${version}" cudatoolkit="cudatoolkit=${version}"
fi fi
case "$(uname -s)" in
Darwin*) os=MacOSX;;
*) os=Linux
esac
printf "Installing PyTorch with %s\n" "${cudatoolkit}" printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest if [ "${os}" == "MacOSX" ]; then
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
else
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" pytest
fi
if [ $PYTHON_VERSION == "3.6" ]; then if [ $PYTHON_VERSION == "3.6" ]; then
printf "Installing minimal PILLOW version\n" printf "Installing minimal PILLOW version\n"
......
...@@ -12,8 +12,10 @@ this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" ...@@ -12,8 +12,10 @@ this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')" eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')"
conda activate ./env conda activate ./env
# TODO, refactor the below logic to make it easy to understand how to get correct cuda_version.
if [ "${CU_VERSION:-}" == cpu ] ; then if [ "${CU_VERSION:-}" == cpu ] ; then
cudatoolkit="cpuonly" cudatoolkit="cpuonly"
version="cpu"
else else
if [[ ${#CU_VERSION} -eq 4 ]]; then if [[ ${#CU_VERSION} -eq 4 ]]; then
CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}" CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}"
...@@ -26,8 +28,7 @@ else ...@@ -26,8 +28,7 @@ else
fi fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}" printf "Installing PyTorch with %s\n" "${cudatoolkit}"
# conda-forge channel is required for cudatoolkit 11.1 on Windows, see https://github.com/pytorch/vision/issues/4458 conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" pytest
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
if [ $PYTHON_VERSION == "3.6" ]; then if [ $PYTHON_VERSION == "3.6" ]; then
printf "Installing minimal PILLOW version\n" printf "Installing minimal PILLOW version\n"
......
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