自己总结的:

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. 阿里云服务器安装Docker Compose

    官网地址:https://docs.docker.com/compose/install/ 1. sudo curl -L "https://github.com/docker/compos ...

  2. 洛谷P1365

    WJMZBMR打osu! / Easy 题目背景 原 维护队列 参见 P1903 题目描述 某一天WJMZBMR在打osu~~~但是他太弱逼了,有些地方完全靠运气:( 我们来简化一下这个游戏的规则 有 ...

  3. C#-WPF初学

    1.新建一个WPF的应用: 2.拖拽控件并布局好: [小技巧]选中控件,点击"回形针"即可让该控件跟随窗口自动调整大小: 3.编写代码: 主程序代码如下: namespace Wp ...

  4. Linux-makefile命令后面的-j4 -j8是什么意思?

    其实是指在编译指定的文件时用多少个线程进行编程的意思~ 相关命令示例如下: make zImage -j8 make modules -j8 --------------------------- m ...

  5. 高程读后感(四)— 关于BOM本人容易忽略的知识点总结

    目录 window对象 window对象上属性及方法 超时调用setTimeout和间歇调用setInterval BOM location对象及其位置操作 history对象 window对象 wi ...

  6. oeasy教您玩转vim - 51 - # 读写文件

    读写文件 回忆上节课内容 命令行的光标控制 方向键️️️️️可以控制左右移动 shift+️️️️️按照word左右移动光标 ctrl+b 到开头begin ctrl+e 到结尾end ctrl+w ...

  7. docker 具名和匿名挂载

    具名和匿名挂载 -v 容器路径! docker run -d -P --name nginx01 -v /etc/nginx nginx -P 随机使用 端口号 docker volume ls 查看 ...

  8. pip升级导致报错:pip消失

    pip升级导致报错:pip消失 在安装Jupyter Notebook的时候需要用首先更新pip,如下: 使用以下命令更新pip和安装Jupyter pip3 install --upgrade pi ...

  9. 轻松搞定 Nginx 在 CentOS 和 Ubuntu 上的安装与配置

    注:这是对我以前博客进行优化后再次发布的,博客中的截图为以前的.原博客已删除. 如何安装nginx nginx是一款开源.高性能的Web和反向代理服务器,支持HTTP.HTTPS.SMTP.POP3和 ...

  10. 【WSDL】WebService描述语言的实践

    问题的产生: 上班写了一个改接口的需求,其中涉及了一个WSDL这么一个概念 WSDL是个啥???? 翻了翻项目,里面就是个文件,以wsdl为后缀名 内容结构和XML相似,或者直接说是XML文件也可以 ...