gpt4 book ai didi

docker - Docker 容器中的 nvidia-docker GPU

转载 作者:行者123 更新时间:2023-12-02 18:52:05 25 4
gpt4 key购买 nike

我正在尝试复制需要我遵循 this particular tutorial on setting up Jupyter + Tensorflow + Nvidia GPU + Docker + Google Compute Engine 的工作/实验. '

我可以成功安装nvidia-docker .然而,在 tutorial ,在 Verify the GPU is Visible from a Docker Container 部分下,当我尝试运行时

sudo nvidia-docker-plugin

我收到以下错误(见最后一行):
nvidia-docker-plugin | 2019/04/23 15:17:47 Loading NVIDIA unified memory
nvidia-docker-plugin | 2019/04/23 15:17:47 Loading NVIDIA management library
nvidia-docker-plugin | 2019/04/23 15:17:47 Discovering GPU devices
nvidia-docker-plugin | 2019/04/23 15:17:47 Provisioning volumes at /var/lib/nvidia-docker/volumes
nvidia-docker-plugin | 2019/04/23 15:17:47 Serving plugin API at /run/docker/plugins
nvidia-docker-plugin | 2019/04/23 15:17:47 Serving remote API at localhost:3476
nvidia-docker-plugin | 2019/04/23 15:17:47 Error: listen tcp 127.0.0.1:3476: bind: address already in use

当我运行时
sudo nvidia-docker run --rm nvidia/cuda nvidia-smi

我碰巧得到以下 executable file not found in $PATH": unknown错误:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"nvidia-smi\": executable file not found in $PATH": unknown.
ERRO[0000] error waiting for container: context canceled

我对 docker 很陌生;因此,如果有人可以帮助我完成解决方案,那就太好了。我试过搜索 for answers ,但解决问题的实际过程却让我望而却步。任何帮助将不胜感激。

编辑:我按照教程中的说明设置 GCE 实例(即 Ubuntu 16.04 LTS,50GB 引导磁盘,1 个 GPU,带有 jupyter 和 tensorboard)

最佳答案

要解决第一个问题,看起来 nvidia-docker-plugin 已经在运行。要查找此服务,请使用:

sudo netstat -tlpn | grep 3476

并杀死它:
sudo pkill nvidia-docker

第二,安装 nvidia-docker2 并重新加载 Docker 守护进程配置:
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

更多详情的链接:
  • https://github.com/NVIDIA/nvidia-docker/issues/301
  • https://medium.com/@sh.tsang/docker-tutorial-5-nvidia-docker-2-0-installation-in-ubuntu-18-04-cb80f17cac65
  • 关于docker - Docker 容器中的 nvidia-docker GPU,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55814760/

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