gpt4 book ai didi

docker - 如何从 Docker 容器连接到 Nvidia MPS 服务器?

转载 作者:行者123 更新时间:2023-12-02 20:12:46 31 4
gpt4 key购买 nike

我想重叠许多 docker 容器对 GPU 的使用。 Nvidia 提供了一个实用程序来执行此操作:多进程服务,记录在 here .具体来说,它说:

When CUDA is first initialized in a program, the CUDA driver attempts to connect to the MPS control daemon. If the connection attempt fails, the program continues to run as it normally would without MPS. If however, the connection attempt succeeds, the MPS control daemon proceeds to ensure that an MPS server, launched with same user id as that of the connecting client, is active before returning to the client. The MPS client then proceeds to connect to the server. All communication between the MPS client, the MPS control daemon, and the MPS server is done using named pipes.



默认情况下,命名管道放置在 /tmp/nvidia-mps/ ,所以我使用卷与容器共享该目录。

但这还不足以让容器上的 cuda 驱动程序“看到”MPS 服务器。

我应该在主机和容器之间共享哪些资源,以便它可以连接到 MPS 服务器?

最佳答案

要启动一个可以访问 mps 的容器,它必须绑定(bind)挂载到 /tmp/nvidia-mps。和相同的interprocess-communication group作为主人。

例如:

docker run -v /tmp/nvidia-mps:/tmp/nvidia-mps --ipc=host nvidia/cuda

关于docker - 如何从 Docker 容器连接到 Nvidia MPS 服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45724523/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com