【发布时间】:2021-03-25 11:17:04
【问题描述】:
我看到了几个关于这个主题的问答,并尝试了这两种方法。任何关于如何继续使用任一路线的建议表示赞赏:
从 WSL2 中运行 nvidia-docker
我关注了NVIDIA docs 和this tutorial。一切都安装好了,docker 命令在 Ubuntu 20.04 中运行。但是,sudo service docker start 返回:docker: unrecognized service
更新: 这变成了known issue。我能够在 these instructions 之后在 Ubuntu 上安装和运行 docker。但是,接下来我遇到了issue like this
$docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
Status: Downloaded newer image for nvcr.io/nvidia/k8s/cuda-sample:nbody
docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: nvml error: driver not loaded: unknown.
ERRO[0065] error waiting for container: context canceled
- WSL1 here 也有类似的问题,建议最好安装 WSL2。我在 WSL2 下遇到了同样的事情。
从 Windows 运行 NVIDIA docker:
另一个school of thought 建议从 WSL Ubuntu 中删除 docker 并改为运行 Windows docker。然后可以从 WSL 连接到它。好吧,我根本无法从 Windows 运行 nvidia-docker:
$ docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
Unable to find image 'nvcr.io/nvidia/k8s/cuda-sample:nbody' locally
nbody: Pulling from nvidia/k8s/cuda-sample
...
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
- 有一些关于如何修复它的提示here,但这都是关于在 Linux 中运行的 docker。哪个不起作用(见上文)。
此外,从 ubuntu 中删除 docker 后,我仍然可以从 Ubuntu20.04 运行 docker,或者当我从 Powershell 运行 wsl 时:
$ which docker
/mnt/c/ProgramData/DockerDesktop/version-bin/docker
$ docker
The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.
See https://docs.docker.com/docker-for-windows/wsl/ for details.
我确实在 Docker 设置的两个不同选项卡中启用了基于 WSL2 的引擎和 Ubuntu 20.04 集成。
系统
Windows 10
WSL 2
Ubuntu 20.04 within WSL2
Windows Docker with WSL2-based engine and integration enabled
非常感谢任何帮助如何进一步诊断它
【问题讨论】:
-
除了你的,我只剩下一件事我没有尝试过,Windows Insider Program 但没有多少耐心了!感谢微软和英伟达!
标签: docker nvidia ubuntu-20.04 wsl-2 nvidia-docker