使用WSL 2进行GPU加速

时间:2020-07-19 00:53:47

标签: docker windows-subsystem-for-linux

我正在尝试设置tensorflow以在运行Ubuntu 20.04的WSL 2中使用GPU加速。我正在关注this tutorial,并遇到了here出现的错误。但是,当我按照那里的解决方案尝试使用sudo service docker start启动docker时,我被告知docker是无法识别的服务。但是,考虑到我可以访问帮助菜单,但我知道已经安装了docker。虽然我可以让Docker使用桌面工具,但是由于它不支持Cuda(如之前的SO帖子所述),因此它并不是很有用。它并没有真正给我错误日志或其他内容,因此请询问您是否需要更多详细信息。

编辑: 考虑到细节的不足,这里列出了我尝试都没有用的解决方案。 1 2 3

更新:我使用sudo dockerd来启动容器,并尝试运行nvidia基准容器,只是为了满足

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

0 个答案:

没有答案
相关问题