From cfdaaaaa26d7f34427ba941569eca46f02f79f3e Mon Sep 17 00:00:00 2001 From: Huy Do Date: Thu, 21 Aug 2025 03:47:15 +0000 Subject: [PATCH] Fix torchaudio build when TORCH_CUDA_ARCH_LIST is not set (#161084) Fixes https://github.com/pytorch/pytorch/issues/160988. The root cause can be found in the same issue. This fix ensures that when reuse old wheel is on and `torchaudio` wheel is not there, the inductor test job can still rebuild the wheel it needs Pull Request resolved: https://github.com/pytorch/pytorch/pull/161084 Approved by: https://github.com/malfet, https://github.com/zou3519 --- .ci/pytorch/common_utils.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.ci/pytorch/common_utils.sh b/.ci/pytorch/common_utils.sh index 06decc2ea64..f1d30700b99 100644 --- a/.ci/pytorch/common_utils.sh +++ b/.ci/pytorch/common_utils.sh @@ -152,6 +152,12 @@ function get_pinned_commit() { function install_torchaudio() { local commit commit=$(get_pinned_commit audio) + # TODO (huydhn): PyTorch CI docker image set the default TORCH_CUDA_ARCH_LIST + # to Maxwell. This default doesn't make sense anymore and should be cleaned up + if [[ "${BUILD_ENVIRONMENT}" == *cuda* ]]; then + TORCH_CUDA_ARCH_LIST=$(nvidia-smi --query-gpu=compute_cap --format=csv | tail -n 1) + export TORCH_CUDA_ARCH_LIST + fi pip_build_and_install "git+https://github.com/pytorch/audio.git@${commit}" dist/audio }