自己总结的:

nvidia-docker, 不支持windows,
2019.10, nvidia-docker过时了,从docker 1903开始,安装一个nvidia-container-runtime就行了, --gpus
2020.12, docker 好像可以直接在wsl2里面跑了, 需要windows inside版本
win 10 2021版本直接包含了对GPU的支持,不再需要inside版本

copy from SO:

2021 updated answer

If you need to access NVIDIA CUDA from a Linux container on Windows 10, there is an easy way to do so, if you are fine with the (current) requirement of being on an Insider build. I was successful with training models on GPU in TensorFlow 2 using this method.

  1. Update Windows 10 to build 20149 or higher. At the time of writing, only Insider Dev branch will work -- you can check the build numbers on the Windows Insider webpage.
  2. Install the NVIDIA CUDA WSL driver (free registration is required)
  3. Install Docker Desktop
    • It will guide you through enabling WSL2 if you haven't already.
    • If you already have it installed, update it to the latest version and enable Settings - General - Use the WSL2 backed engine.
    • To be able to use the docker CLI from inside WSL2 (not just from PowerShell/cmd), enable the integration in Settings - Resources - WSL INTEGRATION.
  4. Test using the command docker run --rm -it --gpus=all nvcr.io/nvidia/k8s/cuda-sample:nbody

You need to pass --gpus=all to docker run to enable the container to access GPU. (If you use VSCode Remote Containers, add "runArgs": ["--gpus=all"], to devcontainer.json.)

You may come across mentions of --runtime=nvidia in descriptions of images meant for nvidia-docker (like the official TensorFlow images). Simply replace --runtime=nvidia by --gpus=all in the provided commands.

Ref:

https://stackoverflow.com/questions/49589229/is-gpu-pass-through-possible-with-docker-for-windows (https://www.docker.com/blog/wsl-2-gpu-support-is-here/)

https://stackoverflow.com/questions/25185405/using-gpu-from-a-docker-container

https://collabnix.com/introducing-new-docker-cli-api-support-for-nvidia-gpus-under-docker-engine-19-03-0-beta-release/

Is GPU pass-through possible with docker for Windows?

安装detectron2的docker环境

docker with GPU support的更多相关文章

  1. Ubuntu 16.04 + CUDA 8.0 + cuDNN v5.1 + TensorFlow(GPU support)安装配置详解

    随着图像识别和深度学习领域的迅猛发展,GPU时代即将来临.由于GPU处理深度学习算法的高效性,使得配置一台搭载有GPU的服务器变得尤为必要. 本文主要介绍在Ubuntu 16.04环境下如何配置Ten ...

  2. 谈谈TensorFlow with CPU support or TensorFlow with GPU support(图文详解)

    不多说,直接上干货! You must choose one of the following types of TensorFlow to install: TensorFlow with CPU ...

  3. detectron2安装出现Kernel not compiled with GPU support 报错信息

    在安装使用detectron2的时候碰到Kernel not compiled with GPU support 问题,前后拖了好久都没解决,现总结一下以备以后查阅. 不想看心路历程的可以直接跳到最后 ...

  4. PatentTips - GPU Support for Blending

    Graphics processing units (GPUs) are specialized hardware units used to render 2-dimensional (2-D) a ...

  5. docker使用GPU

    1.物理机安装显卡驱动 2.安装nvidia-docker wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download ...

  6. tensorflow 资源汇总-docker 运行 tensorflow-gpu on nvidia support

    tensorflow 容器运行过程中使用到的命令记录: 使用image启动容器命令: docker run --name=: tensorflow/tensorflow:latest-gpu-py3- ...

  7. 巧用 Docker 快速部署 GPU 环境

    公众号关注 「开源Linux」 回复「学习」,有我为您特别筛选的学习资料~ 在 Linux 服务器上使用 GPU 跑深度学习的模型很正常不过.如果我们想用 Docker 实现同样的需求,就需要做些额外 ...

  8. 【Docker】使用Docker Client和Docker Go SDK为容器分配GPU资源

    目录 背景 使用 Docker Client 调用 GPU 依赖安装 安装 Docker 安装 NVIDIA Container Toolkit¶ --gpus 用法 使用 Docker Go SDK ...

  9. caffe 无GPU 环境搭建

    root@k-Lenovo:/home/k# sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-d ...

  10. docker[caffe&&pycaffe]

    0 引言 今天花了一天,完成了整个caffe的dockerfile编写,其支持python3.6.6,这里主要的注意点是protobuf的版本(在3.6.0之后,只支持c11),还有在制作镜像的时候注 ...

随机推荐

  1. SpringBoot 解决跨域问题

    今天遇到一个很神奇的问题,之前写的项目,后端跨域都处理好的,按部就班使用原来的方式,前后端都开发完之后,部署本地后,跨域没起效,一脸懵逼,然后使用公司另外一个同事的跨域解决方案,具体我也没深入研究到底 ...

  2. SQL Thinking

    s2下半年我在内部有一次部门级别的技术分享会,以本文内容分享为主. 其实有很多人问过我相同的问题,遇到需要改写的慢sql,不知道怎么改,改好了以后也不知道等不等价?不等价了也不知道错在哪?这个要怎么破 ...

  3. [oeasy]python0009 - 设置断点_break_point

    ​ 调试程序 回忆上次内容 ​py​​ 的程序是按照顺序执行的 是一行行挨排解释执行的 程序并不是数量越多越好 kpi也在不断演化 ​ 编辑 写的代码越多 出现的bug就越多 那什么是bug呢? 如何 ...

  4. Git 克隆仓库报unable to get local issuer certificate错误解决方法

    Git 克隆仓库报unable to get local issuer certificate错误解决方法 By:授客 QQ:1033553122 问题描述 克隆gitlab上的仓库,报错,如下 $ ...

  5. windows edge浏览器免费复制网页文字

    复制时,出现上面提示时候 使用edge浏览器打开链接,在http前面加入read: ,然后打开,即可复制 如果用js,可以参考https://www.cnblogs.com/rmticocean/p/ ...

  6. 我的编程经历,从天桥地摊Basic到西藏阿里的.Net AOT。(一,从井到Sharp)

    撇清一层歧义:标题中的阿里不是指阿里巴巴集团,喜马拉雅也不是指那个做音频频道的公司,文中所及内容以及我本人都与他们没有任何关联.依照地理正式名称:阿里指的是西藏西部阿里地区,喜马拉雅指的是青藏高原地球 ...

  7. 2024-07-31:用go语言,给定两个正整数数组arr1和arr2,我们要找到属于arr1的整数x和属于arr2的整数y组成的所有数对(x, y)中,具有最长公共前缀的长度。 公共前缀是指两个数的

    2024-07-31:用go语言,给定两个正整数数组arr1和arr2,我们要找到属于arr1的整数x和属于arr2的整数y组成的所有数对(x, y)中,具有最长公共前缀的长度. 公共前缀是指两个数的 ...

  8. 【Mybatis-Plus】02 Spring整合,基本CRUD

    创建非骨架普通Maven工程: 引入Spring & MybatisPlus的依赖坐标及其它持久层依赖: <properties> <spring.version>5. ...

  9. 【转载】 一块GPU顶数千个CPU内核,英伟达的这个强化学习利器技术细节终于公开了

    原文地址: https://mp.weixin.qq.com/s/FmFqmIqmknkpBQbNb2ioDA ============================================ ...

  10. 国产软件如何让人再次失望——!20824 mindspore1.3.0gpu version can not compile from source code, because openmpi source code has bug

    如题,该PR地址: https://gitee.com/mindspore/mindspore/pulls/20824#note_7053720 What type of PR is this? Un ...