install_nccl2.sh 1.1 KB
Newer Older
Y
Yancey1989 已提交
1
#!/bin/bash
2
VERSION=$(nvcc --version | grep release | grep -oEi "release ([0-9]+)\.([0-9])"| sed "s/release //")
3 4
if [ "$VERSION" == "10.0" ]; then
  DEB="nccl-repo-ubuntu1604-2.4.7-ga-cuda10.0_1-1_amd64.deb"
T
tianshuo78520a 已提交
5 6 7 8
elif [ "$VERSION" == "11.0" ]; then
  DEB="nccl-repo-ubuntu1604-2.7.8-ga-cuda11.0_1-1_amd64.deb"
elif [ "$VERSION" == "10.2" ]; then
  DEB="nccl-repo-ubuntu1604-2.7.8-ga-cuda10.2_1-1_amd64.deb"
T
tianshuo78520a 已提交
9
elif [ "$VERSION" == "10.1" ]; then
T
tianshuo78520a 已提交
10
  DEB="nccl-repo-ubuntu1604-2.7.8-ga-cuda10.1_1-1_amd64.deb"
11
elif [ "$VERSION" == "9.0" ]; then
T
tianshuo78520a 已提交
12
  DEB="nccl-repo-ubuntu1604-2.3.7-ga-cuda9.0_1-1_amd64.deb"
13
else
T
tianshuo78520a 已提交
14 15
  echo "nccl not found"
  exit 2
16 17
fi

18 19
URL="http://nccl2-deb.gz.bcebos.com/$DEB"

Y
Yancey1989 已提交
20 21 22 23
DIR="/nccl2"
mkdir -p $DIR
# we cached the nccl2 deb package in BOS, so we can download it with wget
# install nccl2: http://docs.nvidia.com/deeplearning/sdk/nccl-install-guide/index.html#down
T
tianshuo78520a 已提交
24
wget -O $DIR/$DEB $URL
Y
Yancey1989 已提交
25 26 27 28 29 30 31 32

cd $DIR && ar x $DEB && tar xf data.tar.xz
DEBS=$(find ./var/ -name "*.deb")
for sub_deb in $DEBS; do
  echo $sub_deb
  ar x $sub_deb && tar xf data.tar.xz
done
mv -f usr/include/nccl.h /usr/local/include/
M
minqiyang 已提交
33
mv -f usr/lib/x86_64-linux-gnu/libnccl* /usr/local/lib/
Y
Yancey1989 已提交
34
rm -rf $DIR