No NCCL is built in when USE_NCCL:ON

Last time when I am using ‘python setup.py install’, I was told that either NCCL 2+ is needed.
So I git clone nccl with the branch v2.3.7-1, which says lacking CMakeLists.txt.
Instead I the following at last build, but still NCCL is built in.
Could somebody give a helping hand, thanks indeed.

  • CMakeLists.txt:
    CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
    CMAKE_POLICY(VERSION 2.8)

IF(NOT CUDA_FOUND)
FIND_PACKAGE(CUDA 7.0 REQUIRED)
ENDIF()

include("${CMAKE_UTILS_PATH}")
torch_cuda_get_nvcc_gencode_flag(NVCC_GENCODE)
string(REPLACE “-gencode;” “-gencode=” NVCC_GENCODE “${NVCC_GENCODE}”)
message(STATUS “Set NVCC_GENCODE for building NCCL: ${NVCC_GENCODE}”)

ADD_CUSTOM_COMMAND(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib/libnccl.so
COMMAND env CUDA_HOME=${CUDA_TOOLKIT_ROOT_DIR} NVCC=${CUDA_NVCC_EXECUTABLE} BUILDDIR=${CMAKE_CURRENT_BINARY_DIR} NVCC_GENCODE="${NVCC_GENCODE}" make -j${NUM_JOBS}
)

ADD_CUSTOM_TARGET(nccl ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lib/libnccl.so)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/nccl.h DESTINATION “include”)

  • Following are the building outputs related to NCCL:

Building wheel torch-1.0.0a0
– Set NVCC_GENCODE for building NCCL: -gencode=arch=compute_30,code=sm_30;-gencode=arch=compute_35,code=sm_35;-gencode=arch=compute_50,code=sm_50;-gencode=arch=compute_52,code=sm_52;-gencode=arch=compute_60,code=sm_60;-gencode=arch=compute_61,code=sm_61;-gencode=arch=compute_70,code=sm_70;-gencode=arch=compute_70,code=compute_70
– Build files have been written to: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/third_party/build/nccl
[100%] Built target nccl
– Found NCCL: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/include
– Determining NCCL version from the header file: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/include/nccl.h
– Found NCCL (include: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/include, library: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/lib/libnccl.so)
– Include NCCL operators
– USE_NCCL : ON
– USE_SYSTEM_NCCL : OFF
[ 77%] Building CXX object caffe2/CMakeFiles/caffe2_gpu.dir/contrib/nccl/cuda_nccl_gpu.cc.o
[ 77%] Building CXX object caffe2/CMakeFiles/caffe2_gpu.dir/contrib/nccl/cuda_nccl_op_gpu.cc.o
– Installing: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/lib/python3.6/site-packages/caffe2/contrib/nccl/init.py
– Installing: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/lib/python3.6/site-packages/caffe2/contrib/nccl/nccl_ops_test.py
– Determining NCCL version from the header file: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/include/nccl.h
– Found NCCL (include: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/include, library: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/lib/libnccl.so)
– NCCL_LIBRARIES: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/lib/libnccl.so
– NCCL_INCLUDE_DIRS: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/include
– Found NCCL, but the NCCL version is either not 2+ or not determinable, will not compile with NCCL distributed backend
– Determining NCCL version from the header file: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/include/nccl.h
– Found NCCL (include: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/include, library: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/lib/libnccl.so)
– NCCL_LIBRARIES: /home/simon/Desktop/pytorch-scripts-1.0rc1/pytorch/torch/lib/tmp_install/lib/libnccl.so
– Found NCCL, but the NCCL version is either not 2+ or not determinable, will not compile with NCCL distributed backend
copying torch/cuda/nccl.py -> build/lib.linux-x86_64-3.6/torch/cuda
copying torch/lib/libnccl.so.1 -> build/lib.linux-x86_64-3.6/torch/lib
copying torch/lib/libnccl.so.1.3.5 -> build/lib.linux-x86_64-3.6/torch/lib
copying torch/lib/libnccl.so -> build/lib.linux-x86_64-3.6/torch/lib
copying torch/lib/include/torch/csrc/cuda/python_nccl.h -> build/lib.linux-x86_64-3.6/torch/lib/include/torch/csrc/cuda
copying torch/lib/include/torch/csrc/cuda/nccl.h -> build/lib.linux-x86_64-3.6/torch/lib/include/torch/csrc/cuda
– Building NCCL library