From ed401cc29bede009c9a3227fdc6171604a177c83 Mon Sep 17 00:00:00 2001 From: jiakai Date: Fri, 19 Aug 2016 18:55:41 +0800 Subject: [PATCH 1/2] link library with -lrt; otherwise there is undefined reference to shm_open --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 36bd170..0b675bd 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ NVCC_GENCODE ?= -gencode=arch=compute_35,code=sm_35 \ CXXFLAGS := -I$(CUDA_INC) -fPIC -fvisibility=hidden NVCUFLAGS := -ccbin $(CXX) $(NVCC_GENCODE) -lineinfo -std=c++11 -maxrregcount 96 # Use addprefix so that we can specify more than one path -LDFLAGS := $(addprefix -L,${CUDA_LIB}) -lcudart +LDFLAGS := $(addprefix -L,${CUDA_LIB}) -lcudart -lrt ifeq ($(DEBUG), 0) NVCUFLAGS += -O3 From 47b0797fe1f1b00cf2edfe449ac59370eea45032 Mon Sep 17 00:00:00 2001 From: jiakai Date: Fri, 19 Aug 2016 19:00:14 +0800 Subject: [PATCH 2/2] pass devlist as const int* rather than int* in ncclCommInitAll --- src/core.cu | 2 +- src/nccl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.cu b/src/core.cu index f3d1462..ac0d65f 100644 --- a/src/core.cu +++ b/src/core.cu @@ -750,7 +750,7 @@ ncclResult_t ncclCommInitRank(ncclComm_t* newcomm, int ndev, ncclUniqueId commId } extern "C" DSOGLOBAL -ncclResult_t ncclCommInitAll(ncclComm_t* comms, int ndev, int* devlist) { +ncclResult_t ncclCommInitAll(ncclComm_t* comms, int ndev, const int* devlist) { initDebug(); showVersion(); diff --git a/src/nccl.h b/src/nccl.h index a0a71fc..47bbdd8 100644 --- a/src/nccl.h +++ b/src/nccl.h @@ -85,7 +85,7 @@ ncclResult_t ncclCommInitRank(ncclComm_t* comm, int ndev, ncclUniqueId commId, i * comm should be pre-allocated with size at least ndev*sizeof(ncclComm_t). * If devlist is NULL, the first ndev CUDA devices are used. * Order of devlist defines user-order of processors within the communicator. */ -ncclResult_t ncclCommInitAll(ncclComm_t* comm, int ndev, int* devlist); +ncclResult_t ncclCommInitAll(ncclComm_t* comm, int ndev, const int* devlist); /* Frees resources associated with communicator object. */ void ncclCommDestroy(ncclComm_t comm);