Caffe 之NCCL安装

在多个 GPU 上运行 Caffe 需要使用 NVIDIA NCCL。可使用以下命令安装 NCCL:
git clone https://github.com/NVIDIA/nccl.git
cd nccl
sudo make install -j4
NCCL 库和文件头将安装在 /usr/local/lib 和 /usr/local/include 中。

如果遇到报错如下:
Compiling src/all_gather.cu > /home/abc/nccl/build/obj/all_gather.o
Compiling src/all_reduce.cu > /home/abc/nccl/build/obj/all_reduce.o
src/core.h:35:16: error: expected unqualified-id before ‘long’
src/core.h:35:16: error: expected ‘)’ before ‘long’
src/core.h:99:1: error: ‘DevRing’ does not name a type
make: *** [/home/liujing/nccl/build/obj/libwrap.o] Error 1
make: *** Waiting for unfinished jobs....
src/core.h:35:16: error: expected unqualified-id before ‘long’
src/core.h:35:16: error: expected ‘)’ before ‘long’
src/core.h:99:1: error: ‘DevRing’ does not name a type

解决:只要在Makefile文件中指定一下CXX就可以了。如下:

BUILDDIR ?= build
BUILDDIR := $(abspath $(BUILDDIR))
CXX := gcc-4.8  //添加这一行

你可能感兴趣的:(AI)