2

nvidia-docker 无法与http://localhost:3476/docker/cli/json对话

Traceback (most recent call last):
  File "/usr/local/bin/nvidia-docker-compose", line 43, in <module>
    resp = request.urlopen('http://{0}/docker/cli/json'.format(args.nvidia_docker_host)).read().decode()
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>
4

2 回答 2

0

全新安装的 nvidia-docker-compose 解决了这个问题:

wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb

然后对其进行测试:

测试nvidia-smi

nvidia-docker run --rm nvidia/cuda nvidia-smi
于 2017-05-29T21:25:04.480 回答
0

也遇到了这个问题,客户没有设法运行 nvidia-docker-compose。结果即使在重新安装 docker 和 nvidia-docker 之后,nvidia-docker 对 localhost:3476 上的 docker 进行的查询也没有得到任何响应(请参阅此处的 nvidia-docker-compose 代码)

我设法通过生成一个手工制作的 docker-compose 文件来解决这个问题,因为它们非常简单,按照这个例子,用你的 nvidia 驱动程序版本替换 375.66 并放置尽可能多的 /dev/nvidia[n] 行显卡(没有尝试将服务放在单独的 GPU 上,而是去尝试!):

services:
  exampleservice0:
    devices:
    - /dev/nvidia0
    - /dev/nvidia1
    - /dev/nvidiactl
    - /dev/nvidia-uvm
    - /dev/nvidia-uvm-tools
    environment:
    - EXAMPLE_ENV_VARIABLE=example
    image: company/image
    volumes:
    - ./disk:/disk
    - nvidia_driver_375.66:/usr/local/nvidia:ro
version: '2'
volumes:
  media: null
  nvidia_driver_375.66:
    external: true

然后只需使用经典的 docker-compose 命令运行这个手工制作的 docker-compose 文件。

于 2017-07-21T14:25:40.857 回答