From 8711df89ccd8ef24b14a139a2aa4c61fbd126d46 Mon Sep 17 00:00:00 2001 From: Soumith Chintala Date: Wed, 3 Apr 2019 12:44:35 -0700 Subject: [PATCH] fix nccl compilation to make sure it compiles for architectures that pytorch compiles for (#18739) Summary: resubmit of https://github.com/pytorch/pytorch/pull/18704 with additional fixes Fixes https://github.com/pytorch/pytorch/issues/18359 Pull Request resolved: https://github.com/pytorch/pytorch/pull/18739 Differential Revision: D14737274 Pulled By: soumith fbshipit-source-id: cfbbbf68b098594bd045861d1b2c085da693ea51 --- cmake/External/nccl.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmake/External/nccl.cmake b/cmake/External/nccl.cmake index 47c6027..cb20610 100644 --- a/cmake/External/nccl.cmake +++ b/cmake/External/nccl.cmake @@ -20,12 +20,10 @@ if (NOT __NCCL_INCLUDED) endif() endif() else() - if (TORCH_CUDA_ARCH_LIST) - torch_cuda_get_nvcc_gencode_flag(NVCC_GENCODE) - string(REPLACE "-gencode;" "-gencode=" NVCC_GENCODE "${NVCC_GENCODE}") - # this second replacement is needed when there are multiple archs - string(REPLACE ";-gencode" " -gencode" NVCC_GENCODE "${NVCC_GENCODE}") - endif() + torch_cuda_get_nvcc_gencode_flag(NVCC_GENCODE) + string(REPLACE "-gencode;" "-gencode=" NVCC_GENCODE "${NVCC_GENCODE}") + # this second replacement is needed when there are multiple archs + string(REPLACE ";-gencode" " -gencode" NVCC_GENCODE "${NVCC_GENCODE}") ExternalProject_Add(nccl_external SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/nccl/nccl -- 2.7.4