自己总结的:

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. 运行前端React框架出现node Error: bind EADDRINUSE null的解决方法

    运行前端React代码时,出现这样的错误: node Error: bind EADDRINUSE null 后来发现端口号冲突,换个端口号后问题就可以解决了.

  2. 火山引擎数智平台赋能火花思维,A/B测试加速创新

    更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群.   在数字化浪潮下,火花思维凭借其对数据驱动的理解与实践,搭上了业务快速增长的快车.这一效果的背后,离不开火花思 ...

  3. MViT:性能杠杠的多尺度ViT | ICCV 2021

    论文提出了多尺度视觉Transformer模型MViT,将多尺度层级特征的基本概念与Transformer模型联系起来,在逐层扩展特征复杂度同时降低特征的分辨率.在视频识别和图像分类的任务中,MViT ...

  4. SQL分析“聚集索引、非聚集索引”区别

    概述 聚集索引 一种索引,该索引中键值的逻辑顺序决定了表中相应行的物理顺序. 聚集索引确定表中数据的物理顺序.聚集索引类似于电话簿,后者按姓氏排列数据.由于聚集索引规定数据在表中的物理存储顺序,因此一 ...

  5. CF1956B Nene and the Card Game 题解

    Nene and the Card Game 题意 有 \(2n\) 张牌,\(1,2,3,\dots,n\) 皆有两张. 有两个人在玩游戏,每个人有 \(n\) 张卡片,当一人出了一张编号为 \(k ...

  6. 记一些java里的数据结构

    0.Vector:过期的,被arraylist取代了 0.1Stack:也不建议使用 1.双向链表LinkedList:由list实现的接口类 2.队列Queue:操作为add remove elem ...

  7. hbuilderx打正式包所需的私钥证书的创建方法

    现在使用uniapp作为底层框架来开发app应用已经成为了很多公司的事实标准,而uniapp的开发工具hbuilderx云打包的时候,需要私钥证书和证书profile文件. 而且还需要将打包好的ipa ...

  8. python adb 安卓app性能测试

    主要是进行cpu.内存.冷启动.热启动.流量.电量的监测 可获取到相关数据,同竞类产品对比,或者同版本对比 cpustatus adb命令:adb shell "dumpsys cpuinf ...

  9. os.popen(cmd) 与 os.system(cmd) 的区别

    os.popen(cmd) 与 os.system(cmd) 的区别 1,os.popen(cmd) 不会直接返回任何数据,os.system(cmd) 会直接输出结果(返回的却是int状态码) 2, ...

  10. Streamlit运行出现ModuleNotFoundError: No module named ‘altair.vegalite.v4‘ —— ModuleNotFoundError: No module named 'altair.vegalite.v4'

    参考: https://blog.csdn.net/ikun_King/article/details/131852167 解决方法: pip install altair=4.2.2