如何查看NCCL版本

问题描述 投票:0回答:3

我远程访问高性能计算节点。我不确定 NVIDIA Collective Communications Library (NCCL) 是否安装在我的目录中。有没有办法检查NCCL是否安装?

python tensorflow nvidia horovod
3个回答
20
投票

你可以试试

locate nccl| grep "libnccl.so" | tail -n1 | sed -r 's/^.*\.so\.//'

或者如果您使用 PyTorch:

python -c "import torch;print(torch.cuda.nccl.version())"

查看此链接命令备忘单:检查 Ubuntu 上深度学习已安装软件/库/工具的版本

对于容器,有时没有

locate
可用,可以用
ldconfig -v
代替:

ldconfig -v | grep "libnccl.so" | tail -n1 | sed -r 's/^.*\.so\.//'

0
投票

您可以使用:

❯ python -c "import torch; print(torch.cuda.nccl.version())"
(2, 21, 5)

但请注意,这是用于编译 PyTorch 的 NCCL 版本,而不是运行时必须使用的版本。

验证的最佳方法是使用

LD_DEBUG=libs
:

 LD_DEBUG=libs python -c "import torch; print(torch.cuda.nccl.version())" |& grep libnccl
   3966557:     find library=libnccl.so.2 [0]; searching
   3966557:     calling init: .venv/lib/python3.11/site-packages/torch/lib/../../nvidia/nccl/lib/libnccl.so.2

然后用

strings
看看里面:

 strings .venv/lib/python3.11/site-packages/torch/lib/../../nvidia/nccl/lib/libnccl.so.2 | grep 'NCCL version'
NCCL version 2.24.3+cuda12.2

参见 https://discuss.pytorch.org/t/how-can-i-change-nccl-version-in-pytorch/143942/20


-4
投票

您通常可以在命令行中执行此操作:

nvcc --version

你可能需要运行:

sudo apt install nvidia-cuda-toolkit

也是。


正如其他回答者提到的,你可以这样做:

torch.cuda.nccl.version()

在火炬中。将其复制粘贴到您的终端中:

python -c "import torch;print(torch.cuda.nccl.version())"

我确信张量流中有类似的东西。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.