我正在尝试设置张量流以在运行 Ubuntu 20.04 的 WSL 2 上使用 GPU 加速。我正在跟进本教程 https://ubuntu.com/blog/getting-started-with-cuda-on-ubuntu-on-wsl-2我遇到了所看到的错误here https://stackoverflow.com/questions/62477330/could-not-select-device-driver-with-capabilities-gpu。但是,当我按照那里的解决方案并尝试启动 docker 时sudo service docker start
我被告知 docker 是一个无法识别的服务。但是,考虑到我可以访问帮助菜单等,我知道 docker 已安装。虽然我可以让 docker 使用桌面工具,但由于它不支持前面 SO 帖子中提到的 Cuda,所以它不是很有帮助。它并没有真正给我错误日志或任何东西,所以请询问您是否需要更多详细信息。
编辑:
考虑到缺乏细节,这里列出了我尝试过但无济于事的解决方案。1 https://stackoverflow.com/questions/27597355/docker-unrecognised-service-when-i-run-this-command-sudo-service-docker-stop 2 https://github.com/microsoft/WSL/issues/4385 3 https://unix.stackexchange.com/questions/530840/docker-service-not-starting-on-new-wsl2
更新:我用过sudo dockerd
启动容器并尝试运行 nvidia benchmark 容器却遇到了
INFO[2020-07-18T21:04:05.875283800-04:00] shim containerd-shim started address=/containerd-shim/021834ef5e5600bdf62a6a9e26dff7ffc1c76dd4ec9dadb9c1fcafb6c88b6e1b.sock debug=false pid=1960
INFO[2020-07-18T21:04:05.899420200-04:00] shim reaped id=70316df254d6b2633c743acb51a26ac2d0520f6f8e2f69b69c4e0624eaac1736
ERRO[2020-07-18T21:04:05.909710600-04:00] stream copy error: reading from a closed fifo
ERRO[2020-07-18T21:04:05.909753500-04:00] stream copy error: reading from a closed fifo
ERRO[2020-07-18T21:04:06.001006700-04:00] 70316df254d6b2633c743acb51a26ac2d0520f6f8e2f69b69c4e0624eaac1736 cleanup: failed to delete container from containerd: no such container
ERRO[2020-07-18T21:04:06.001045100-04:00] Handler for POST /v1.40/containers/70316df254d6b2633c743acb51a26ac2d0520f6f8e2f69b69c4e0624eaac1736/start returned error: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:432: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request\\\\n\\\"\"": unknown
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"process_linux.go:432: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request\\\\n\\\"\"": unknown.
ERRO[0000] error waiting for container: context canceled
更新 2:安装 Windows Insider 并尽可能更新所有内容后,我遇到了另一个错误。
Run "nbody -benchmark [-numbodies=<numBodies>]" to measure performance.
-fullscreen (run n-body simulation in fullscreen mode)
-fp64 (use double precision floating point values for simulation)
-hostmem (stores simulation data in host memory)
-benchmark (run benchmark to measure performance)
-numbodies=<N> (number of bodies (>= 1) to run in simulation)
-device=<d> (where d=0,1,2.... for the CUDA device to use)
-numdevices=<i> (where i=(number of CUDA devices > 0) to use for simulation)
-compare (compares simulation results running once on the default GPU and once on the CPU)
-cpu (run n-body simulation on the CPU)
-tipsy=<file.bin> (load a tipsy model file for simulation)
NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.
Error: only 0 Devices available, 1 requested. Exiting.
我有 GTX 970,所以我不确定为什么它没有被检测到。运行后sudo lshw -C display
,已确认未检测到我的显卡。我有:
*-display UNCLAIMED
description: 3D controller
product: Microsoft Corporation
vendor: Microsoft Corporation
physical id: 4
bus info: pci@941e:00:00.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: bus_master cap_list
configuration: latency=0