使用 WSL 2 进行 GPU 加速

2024-04-03

我正在尝试设置张量流以在运行 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

None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 WSL 2 进行 GPU 加速 的相关文章

随机推荐

  • 使用 xarray 插值周期边界

    我想插入很多xarray数据集包含一个公共网格的全球气候数据 xarray实际上有一个interp http xarray pydata org en stable interpolation html 工作正常的方法 但据我所知 没有考虑
  • Spring Boot 是否自动解析 javax 和 hibernate 验证注解中的消息键

    我正在编写一个 Spring Boot 应用程序 我想知道 Spring Boot 是否自动解析 javax 和 hibernate 验证注释中的消息键 例如 NotEmpty message message key String name
  • 刷新页面删除引导选择样式

    我正在使用 bootstrap select 并且我是前端新手 我正在尝试在我的页面中实现 bootstrap 的多选组件 但是问题 我面临的是 当我将页面提交到服务器时 如果发生错误 它会从选择框中删除所有 css 类 并仅显示多选列表而
  • 在 django.core.urlresolvers reverse() 调用中包含查询字符串

    我正在尝试反转命名 URL 并在其中包含查询字符串 基本上我修改了登录功能 我想发送 next in it 这就是我现在正在做的事情 reverse name next reverse redirect 这是我想做的 reverse nam
  • 如何解析节点名称中包含无效字符的 XML?

    所以我试图解析一些 XML 其创建不在我的控制之下 问题是 他们以某种方式得到了如下所示的节点
  • 尝试通过 HTTPS 传递 swagger.json 时出现“未提供规范”错误

    如果我尝试使用 Flask RestPlus 通过 HTTPS 交付 Swagger UI 我只会在根 URL 处看到 未提供规范 错误消息 并且完整的 Swagger UI 永远不会加载 但是 如果我访问 API 端点 它们会按预期返回响
  • 无法安装 .NET Standard 2.0

    我正在尝试创建一个 NET Standard 2 0 项目 但是在项目属性页面上它仅具有最高 NET Standard 1 6 的选项 我转到 Visual Studio gt 工具 gt 扩展和更新 gt 更新 gt 产品更新 并将 Vi
  • 删除对象的私有属性

    尝试并搜索了这个 但似乎从未在 SO 中找到它 尝试使用unset this gt property name 但当我使用时它仍然出现print r object name 是否不可能删除对象的私有属性 这是一个示例代码 class my
  • ASP.NET 5 中的 URL 重写

    我使用的是 ASP NET 5 其中整个文件夹结构已更改 并且 web config 已替换 与以前的 ASP NET 版本相比 我正在使用 angularJS 进行客户端路由 并且我有以下路线 when movies add templa
  • 如何使 CPAN::Meta::Spec 的“先决条件”需要发行版而不是软件包?

    我正在研究如何打包我的一些 Perl 应用程序并更好地管理它们的依赖项 以使我和我的客户更容易分发 这很可能根本不包括上传到 CPAN 相反 如果有必要 我会提供自定义存储库 或者更可能的是 访问 Subversion 等 SCM CPAN
  • 你能以编程方式获取 Firefox 附加组件列表吗

    在查看了缓存等之后 我花了相当多的时间试图确定为什么我的网站视图与客户端不匹配 我们确定问题出在其中一个附加组件上 在这种特殊情况下为 Adblock Plus 如果我们能够有一种简单的方法来查询安装了哪些附加组件 并且最好是处于活动状态
  • Spark作业是什么?

    我已经完成了 Spark 安装并执行了一些设置主节点和工作节点的测试用例 也就是说 我对 Spark 上下文 而不是 SparkContext 中的作业到底意味着什么感到非常困惑 我有以下问题 工作与驱动程序有多么不同 应用程序本身是驱动程
  • 如何在多行字符中只显示一个标签?

    我使用 Chart js 创建一个图表 该图有两条线 因此它默认也显示两个标签 但我需要一种配置 其中应该显示红色标签 而应该隐藏蓝色标签 标签not线 感谢您的帮助 var config type line data labels 16
  • 创建自动调整大小的打印输出

    我的应用程序需要打印一些东西 布局应该有点动态 有时特定字段可能包含更多数据 这可能需要它们自动换行或类似的 但打印输出不应超过一页 如果数据太多 我想稍微减小字体大小 然后重试 然后重复 直到所有内容都适合一个页面 永远不会so许多数据的
  • CR 与 LF perl 解析

    我有一个 perl 脚本 它解析一个文本文件并将其每行分解为一个数组 当每行以 LF 终止时它工作正常 但当它们以 CR 终止时我的脚本无法正确处理 我该如何修改这一行来解决这个问题 my allLines split entireFile
  • 检查用户是否已连接 AppleWatch,而不提示手表

    我们正在使用谷歌分析 并想知道我们有多少用户拥有苹果手表 我在 Stack 中搜索了答案 反复出现的答案是使用这个 if WCSession isSupported check if the device support to handle
  • MySQL外键允许NULL吗?

    我正在拼凑一个图像网站 基本模式非常简单 MySQL 但我在尝试表示与图像关联的可能的管理标志 不适当 受版权保护 等 时遇到了一些麻烦 我目前的想法如下 tblImages imageID INT UNSIGNED NOT NULL AU
  • Java 夏令时不适用于遥远的过去(更新:确实如此)?

    下面这段代码 TimeZone getTimeZone Europe Athens inDaylightTime new Date 200 8 14 returns true 与 2011 年的情况非常相似 但是 夏令时 https en
  • 如何使用 Eclipse JDT ASTParser 获取方法的类名?

    我想做的是获取方法的类名 例如 我想获得一类 直到 和 搜索 方法 这是代码 Query query new Query queryStr until dateStr QueryResult queryResult twitter1 sea
  • 使用 WSL 2 进行 GPU 加速

    我正在尝试设置张量流以在运行 Ubuntu 20 04 的 WSL 2 上使用 GPU 加速 我正在跟进本教程 https ubuntu com blog getting started with cuda on ubuntu on wsl