From 7604fab38e1c88432f9a443580e10c69f4f2ad75 Mon Sep 17 00:00:00 2001 From: Ting Lu Date: Tue, 29 Oct 2024 14:55:13 -0700 Subject: [PATCH 1/2] fix unhandled cuda error --- conda/build_pytorch.sh | 3 +++ conda/pytorch-nightly/build.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conda/build_pytorch.sh b/conda/build_pytorch.sh index 3b710f7a6..29818538e 100755 --- a/conda/build_pytorch.sh +++ b/conda/build_pytorch.sh @@ -268,6 +268,9 @@ else . ./switch_cuda_version.sh "$desired_cuda" # TODO, simplify after anaconda fixes their cudatoolkit versioning inconsistency. # see: https://github.com/conda-forge/conda-forge.github.io/issues/687#issuecomment-460086164 + if [[ "$desired_cuda" == "12.6" ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=12.6,<12.7 # [not osx]" + export MAGMA_PACKAGE=" - magma-cuda126 # [not osx and not win]" if [[ "$desired_cuda" == "12.4" ]]; then export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=12.4,<12.5 # [not osx]" export MAGMA_PACKAGE=" - magma-cuda124 # [not osx and not win]" diff --git a/conda/pytorch-nightly/build.sh b/conda/pytorch-nightly/build.sh index eee3a3d86..6d15e5c86 100755 --- a/conda/pytorch-nightly/build.sh +++ b/conda/pytorch-nightly/build.sh @@ -60,7 +60,7 @@ if [[ -n "$build_with_cuda" ]]; then TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;3.7+PTX;9.0" #for cuda 11.8 include all dynamic loading libraries DEPS_LIST=(/usr/local/cuda/lib64/libcudnn*.so.9 /usr/local/cuda-11.8/extras/CUPTI/lib64/libcupti.so.11.8 /usr/local/cuda/lib64/libcusparseLt.so.0) - elif [[ $CUDA_VERSION == 12.1* || $CUDA_VERSION == 12.4* ]]; then + elif [[ $CUDA_VERSION == 12.1* || $CUDA_VERSION == 12.4* || $CUDA_VERSION == 12.6*]]; then # cuda 12 does not support sm_3x TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;9.0" # for cuda 12.1 (12.4) we use cudnn 9.1 and include all dynamic loading libraries From dfa65cd5eaf880a077539889c4a44cfaba597ff4 Mon Sep 17 00:00:00 2001 From: Ting Lu Date: Fri, 1 Nov 2024 00:54:54 -0700 Subject: [PATCH 2/2] fix if condition --- conda/build_pytorch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/build_pytorch.sh b/conda/build_pytorch.sh index 29818538e..8edc86bf0 100755 --- a/conda/build_pytorch.sh +++ b/conda/build_pytorch.sh @@ -271,7 +271,7 @@ else if [[ "$desired_cuda" == "12.6" ]]; then export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=12.6,<12.7 # [not osx]" export MAGMA_PACKAGE=" - magma-cuda126 # [not osx and not win]" - if [[ "$desired_cuda" == "12.4" ]]; then + elif [[ "$desired_cuda" == "12.4" ]]; then export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=12.4,<12.5 # [not osx]" export MAGMA_PACKAGE=" - magma-cuda124 # [not osx and not win]" elif [[ "$desired_cuda" == "12.1" ]]; then