Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit b3eb56a

Browse files
authored
Fix unhandled cuda error for Conda build with CUDA 12.6 (#2025)
related pytorch/pytorch#138440 fix error for https://github.com/pytorch/pytorch/pull/138899/files
1 parent 000a40b commit b3eb56a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

conda/build_pytorch.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,10 @@ else
268268
. ./switch_cuda_version.sh "$desired_cuda"
269269
# TODO, simplify after anaconda fixes their cudatoolkit versioning inconsistency.
270270
# see: https://github.com/conda-forge/conda-forge.github.io/issues/687#issuecomment-460086164
271-
if [[ "$desired_cuda" == "12.4" ]]; then
271+
if [[ "$desired_cuda" == "12.6" ]]; then
272+
export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=12.6,<12.7 # [not osx]"
273+
export MAGMA_PACKAGE=" - magma-cuda126 # [not osx and not win]"
274+
elif [[ "$desired_cuda" == "12.4" ]]; then
272275
export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=12.4,<12.5 # [not osx]"
273276
export MAGMA_PACKAGE=" - magma-cuda124 # [not osx and not win]"
274277
elif [[ "$desired_cuda" == "12.1" ]]; then

conda/pytorch-nightly/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if [[ -n "$build_with_cuda" ]]; then
6060
TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;3.7+PTX;9.0"
6161
#for cuda 11.8 include all dynamic loading libraries
6262
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)
63-
elif [[ $CUDA_VERSION == 12.1* || $CUDA_VERSION == 12.4* ]]; then
63+
elif [[ $CUDA_VERSION == 12.1* || $CUDA_VERSION == 12.4* || $CUDA_VERSION == 12.6*]]; then
6464
# cuda 12 does not support sm_3x
6565
TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;9.0"
6666
# for cuda 12.1 (12.4) we use cudnn 9.1 and include all dynamic loading libraries

0 commit comments

Comments
 (0)