目录

1、下载deb包

2、Install the repository

(1)For a local NCCL repository

(2)For the network repository

3、Update the APT database

4、Install the libnccl2 package with APT

5、添加环境变量


NVIDIA Collective Communications Library (NCCL) Legacy Download Page:

https://developer.nvidia.com/nccl/nccl-legacy-downloads

Installation Guide:

Installation Guide :: NVIDIA Deep Learning NCCL Documentation

3. Installing NCCL

In order to download NCCL, ensure you are registered for the NVIDIA Developer Program.

  1. Go to: NVIDIA NCCL home page.
  2. Click Download.
  3. Complete the short survey and click Submit.
  4. Accept the Terms and Conditions. A list of available download versions of NCCL displays.
  5. Select the NCCL version you want to install. A list of available resources displays. Refer to the following sections to choose the correct package depending on the Linux distribution you are using.

3.1. Ubuntu

Installing NCCL on Ubuntu requires you to first add a repository to the APT system containing the NCCL packages, then installing the NCCL packages through APT. There are two repositories available; a local repository and a network repository. Choosing the latter is recommended to easily retrieve upgrades when newer versions are posted.

In the following commands, please replace <architecture> with your CPU architecture: x86_64, ppc64le, or sbsa, and replace <distro> with the Ubuntu version, for example ubuntu1604, ubuntu1804, or ubuntu2004.

  1. Install the repository.

    • For a local NCCL repository:

      sudo dpkg -i nccl-repo-<version>.deb

      Note:

      The local repository installation will prompt you to install the local key it embeds and with which packages are signed. Make sure to follow the instructions to install the local key, or the install phase will fail later.

    • For the network repository:
      wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<architecture>/cuda-keyring_1.0-1_all.deb
      sudo dpkg -i cuda-keyring_1.0-1_all.deb
  2. Update the APT database:
    sudo apt update
  3. Install the libnccl2 package with APT. Additionally, if you need to compile applications with NCCL, you can install the libnccl-dev package as well:

    Note: If you are using the network repository, the following command will upgrade CUDA to the latest version.

    sudo apt install libnccl2 libnccl-dev

    If you prefer to keep an older version of CUDA, specify a specific version, for example:

    sudo apt install libnccl2=2.4.8-1+cuda10.0 libnccl-dev=2.4.8-1+cuda10.0

    Refer to the download page for exact package versions.

1、下载deb包

本次选择安装Local installer for Ubuntu 20.04

下载后获得的文件:nccl-local-repo-ubuntu2004-2.8.4-cuda11.2_1.0-1_amd64.deb

2、Install the repository

(1)For a local NCCL repository

sudo dpkg -i nccl-repo-<version>.deb

根据实际文件名修改命令,此处为:

$ sudo dpkg -i nccl-local-repo-ubuntu2004-2.8.4-cuda11.2_1.0-1_amd64.deb
Selecting previously unselected package nccl-local-repo-ubuntu2004-2.8.4-cuda11.2.
(Reading database ... 230937 files and directories currently installed.)
Preparing to unpack nccl-local-repo-ubuntu2004-2.8.4-cuda11.2_1.0-1_amd64.deb ...
Unpacking nccl-local-repo-ubuntu2004-2.8.4-cuda11.2 (1.0-1) ...
Setting up nccl-local-repo-ubuntu2004-2.8.4-cuda11.2 (1.0-1) ...The public CUDA GPG key does not appear to be installed.
To install the key, run this command:
sudo apt-key add /var/nccl-local-repo-ubuntu2004-2.8.4-cuda11.2/7fa2af80.pu

(2)For the network repository

wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<architecture>/cuda-keyring_1.0-1_all.debsudo dpkg -i cuda-keyring_1.0-1_all.deb

其中,

<architecture> 根据CPU架构修改:x86_64, ppc64le, or sbsa

<distro>根据ubuntu版本修改:ubuntu1604, ubuntu1804, or ubuntu2004

此处为:

$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
--2022-10-26 20:44:28--  https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.199.39.144
Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.199.39.144|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb [following]
--2022-10-26 20:44:30--  https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
Resolving developer.download.nvidia.cn (developer.download.nvidia.cn)... 222.243.53.99, 59.36.216.27, 59.36.216.26, ...
Connecting to developer.download.nvidia.cn (developer.download.nvidia.cn)|222.243.53.99|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4328 (4.2K) [application/x-deb]
Saving to: ‘cuda-keyring_1.0-1_all.deb’cuda-keyring_1.0-1_ 100%[===================>]   4.23K  --.-KB/s    in 0s      2022-10-26 20:44:30 (437 MB/s) - ‘cuda-keyring_1.0-1_all.deb’ saved [4328/4328]$ sudo dpkg -i cuda-keyring_1.0-1_all.deb
Selecting previously unselected package cuda-keyring.
(Reading database ... 230948 files and directories currently installed.)
Preparing to unpack cuda-keyring_1.0-1_all.deb ...
Unpacking cuda-keyring (1.0-1) ...
Setting up cuda-keyring (1.0-1) ...

3、Update the APT database

sudo apt update

否则会找不到接下来的packages

4、Install the libnccl2 package with APT

如果你需要用NCCL编译应用程序,可以安装libccl -dev包

sudo apt install libnccl2 libnccl-dev

如果需要更旧版本的CUDA,可以:

sudo apt install libnccl2=2.4.8-1+cuda10.0 libnccl-dev=2.4.8-1+cuda10.0

本次为:

$ sudo apt install libnccl2 libnccl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:libnccl-dev libnccl2
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 196 MB of archives.
After this operation, 542 MB of additional disk space will be used.
Get:1 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64  libnccl2 2.15.5-1+cuda11.8 [97.5 MB]
Get:2 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64  libnccl-dev 2.15.5-1+cuda11.8 [98.1 MB]
Fetched 196 MB in 2min 24s (1,356 kB/s)
Selecting previously unselected package libnccl2.
(Reading database ... 230953 files and directories currently installed.)
Preparing to unpack .../libnccl2_2.15.5-1+cuda11.8_amd64.deb ...
Unpacking libnccl2 (2.15.5-1+cuda11.8) ...
Selecting previously unselected package libnccl-dev.
Preparing to unpack .../libnccl-dev_2.15.5-1+cuda11.8_amd64.deb ...
Unpacking libnccl-dev (2.15.5-1+cuda11.8) ...
Setting up libnccl2 (2.15.5-1+cuda11.8) ...
Setting up libnccl-dev (2.15.5-1+cuda11.8) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...

5、添加环境变量

(1)查找nccl安装位置

$ whereis nccl
nccl: /usr/include/nccl.h

修改~/.bashrc

#设置cuda库的目录
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64
#将nccl添加到LD_LIBRARY_PATH中
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/include/nccl.h

因为cuda库已经添加了,所以这次只把nccl添加到LD_LIBRARY_PATH中,即只添加了最后一行

使其生效

source ~/.bashrc

部分参考:ubuntu下安装nccl具体教程_TanH.blog的博客-CSDN博客_ubuntu安装nccl

NCCL+Ubuntu20.04安装相关推荐

  1. 优麒麟Ubuntu20.04安装各种问题

    优麒麟Ubuntu用了六年了,版本旧了,所以按照20.04版. 1.adobe-flashplugin的安装极其慢 慎重啊!需要好几个小时,无法忍受啊! 2.dpkg被中断的解决方法 关闭掉Ubunt ...

  2. ubuntu20.04 安装 Qt5.12步骤

    转载链接:ubuntu20.04 安装 Qt5.12_仙海寻波的博客-CSDN博客_ubuntu20.04安装qt第一步 下载 Qt5.12.9安装包使用清华镜像进行下载:https://mirror ...

  3. 了解Docker、Ubuntu20.04安装docker教程

    Docker 的前世今生 https://my.oschina.net/u/4126211/blog/4517028 Ubuntu20.04安装docker教程 https://blog.csdn.n ...

  4. ubuntu20.04安装ROS及常见问题

    ubuntu20.04安装ROS及常见问题 一.ubuntu安装参考(双系统) 1.ios镜像官网下载地址: https://releases.ubuntu.com/?_ga=2.239339907. ...

  5. Ubuntu20.04安装,并Linux微信等

    Ubuntu20.04安装,并Linux微信等 一.Ubuntu20.04双硬盘双系统安装 电脑状况:256G+260G双固态硬盘,其中256G(sda)分C.D盘安装win10,460G(sdb)硬 ...

  6. ubuntu20.04安装小鹤双拼输入法挂接音形改简体中文Rime

    ubuntu20.04安装小鹤双拼输入法挂接音形改简体中文Rime 方案1,按照这个挂接方法,原始的繁体等其他的也还在: 替换方案 方案2 修改成默认简体中文: 更改皮肤 设置-区域与语言-改成中文- ...

  7. 微星主板 Ubuntu20.04安装以及配置

    1 设置U盘启动 1)插入使用软碟通制作好的U盘,开机按del键进入BIOS: 2)Boot Option 中 选择U盘启动: 3)设置硬盘BBS(我也不知道是什么): 4)点击左边Settings, ...

  8. Ubuntu20.04安装NVIDIA显卡驱动、CUDA、CUDNN及突破NVENC并发限制

    1.查看当前系统版本 cat /proc/version 显示为: 2.查看当前显卡型号: sudo lshw -numeric  -C display 显示我的显卡型号为:GM107M[GeForc ...

  9. Ubuntu20.04安装yum

    Ubuntu20.04安装yum 1打开终端,备份你原来Ubuntu默认的源地址 sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup ...

最新文章

  1. c语言中的if语句_If ... C中的其他语句解释
  2. input 选择框改变背景小技巧
  3. uestWrapper.getSession(HttpServletRequestWrapper.java:241) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
  4. SharePoint 2013技巧分享系列 - 同步Exchange显示高清用户照片
  5. 如何用python写html的插件,使用python开发vim插件及心得分享
  6. background-size在IE8不兼容问题
  7. Android NDK工程创建与编译运行
  8. 手机是怎么确定位置信息的?
  9. mybatisplus 一次性执行多条SQL语句
  10. wgs84转经纬度_wgs84经纬度转为cgcs2000平面坐标
  11. ftk学习记(对话框篇)
  12. 信号与系统_严国志_第一章_绪论
  13. set-cookie无法存入到浏览器cookie问题汇总
  14. mysql双机热备份
  15. [Winter Vacation] 语文实词虚词练习册答案
  16. ERROR 999999: Error executing function. The table name is invalid. No spatial reference exists.
  17. python 爬取财经新闻_Python爬虫并自制新闻网站,太好玩了
  18. 与其说我害怕成为普通人,还不如说我害怕生活,害怕找不到一种自己喜欢的方式去度过人生...
  19. 验证码识别-Java版
  20. Tensorflow中的masking和padding

热门文章

  1. 试用期合同可以随时离职吗
  2. 20164305徐广皓 - Exp1 PC平台逆向破解(5)M
  3. houdini快速物体拖尾笔记
  4. 将markdown 文件渲染 mhtml 的方式
  5. agv系统介绍_AGV小车控制系统介绍
  6. Sicily2000——Toy Shopping
  7. 小米其实已在悄悄涨价了,用户反应不一
  8. 清华、商汤提出SIM方法,让自监督学习兼顾语义对齐与空间分辨能力
  9. 计算机启动修复怎么还原,电脑开机出现系统恢复选项该怎么办
  10. 华为拍摄月亮专利公布: 多次曝光获取月亮清晰轮廓